Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common Remove unused variable p from linux_...



details:   https://anonhg.NetBSD.org/src/rev/f3766f16da29
branches:  trunk
changeset: 831809:f3766f16da29
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun Apr 15 03:25:25 2018 +0000

description:
Remove unused variable p from linux_sys_clone()

After refactoring by <chs> in 2010 (r. 1.63) the p variable is no longer
used.

As noted by <Mateusz Guzik> its usage is also unsafe and might cause
use-after-free scenarios.

No functional change intended.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by <The NetBSD Foundation>

diffstat:

 sys/compat/linux/common/linux_sched.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r ccdbde78464b -r f3766f16da29 sys/compat/linux/common/linux_sched.c
--- a/sys/compat/linux/common/linux_sched.c     Sun Apr 15 00:19:23 2018 +0000
+++ b/sys/compat/linux/common/linux_sched.c     Sun Apr 15 03:25:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_sched.c,v 1.69 2017/04/21 15:10:34 christos Exp $        */
+/*     $NetBSD: linux_sched.c,v 1.70 2018/04/15 03:25:25 kamil Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.69 2017/04/21 15:10:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.70 2018/04/15 03:25:25 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -103,7 +103,6 @@
                syscallarg(void *) tls;
                syscallarg(void *) child_tidptr;
        } */
-       struct proc *p;
        struct linux_emuldata *led;
        int flags, sig, error;
 
@@ -159,7 +158,7 @@
         * that makes this adjustment is a noop.
         */
        if ((error = fork1(l, flags, sig, SCARG(uap, stack), 0,
-           linux_child_return, NULL, retval, &p)) != 0) {
+           linux_child_return, NULL, retval, NULL)) != 0) {
                DPRINTF(("%s: fork1: error %d\n", __func__, error));
                return error;
        }



Home | Main Index | Thread Index | Old Index