Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Comment about missing stackframe member ini...



details:   https://anonhg.NetBSD.org/src/rev/648cdcaf5875
branches:  trunk
changeset: 325919:648cdcaf5875
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 11 17:14:00 2014 +0000

description:
Comment about missing stackframe member initialization (Richard Hansen)

I haven't studied the code, but I'm concerned that not initializing
sf->sf_edi could potentially leak a few bytes of information to a new
userspace process.

diffstat:

 sys/arch/x86/x86/vm_machdep.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 2589004b9be4 -r 648cdcaf5875 sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c     Sat Jan 11 17:11:50 2014 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c     Sat Jan 11 17:14:00 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.18 2013/12/01 01:05:16 christos Exp $ */
+/*     $NetBSD: vm_machdep.c,v 1.19 2014/01/11 17:14:00 christos Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.18 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.19 2014/01/11 17:14:00 christos Exp $");
 
 #include "opt_mtrr.h"
 
@@ -228,6 +228,11 @@
        pcb2->pcb_rsp = (uint64_t)sf;
        pcb2->pcb_rbp = (uint64_t)l2;
 #else
+       /*
+        * XXX Is there a reason sf->sf_edi isn't initialized here?
+        * Could this leak potentially sensitive information to new
+        * userspace processes?
+        */
        sf->sf_esi = (int)func;
        sf->sf_ebx = (int)arg;
        sf->sf_eip = (int)lwp_trampoline;



Home | Main Index | Thread Index | Old Index