lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 15 May 2009 14:20:53 -0500
From:	Jason Wessel <jason.wessel@...driver.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org, kgdb-bugreport@...ts.sourceforge.net
Subject: Re: [PATCH 2/3] kgdb,i386: use address that SP register points to
 in the exception frame

Linus Torvalds wrote:
> Is this only ever used for kernel register state?
>
> Because in the _general_ case, the code should likely be something like
>
> 	if (user_mode_vm(regs)) {
> 		gdb_regs[GDB_SS] = regs->ss;
> 		gdb_regs[GDB_SP] = regs->sp;
> 	} else {
> 		gdb_regs[GDB_SS] = __KERNEL_DS;
> 		gdb_regs[GDB_SP] = (unsigned long)&regs->sp
> 	}
>   

You have discovered a long standing corner case.  The only way you can
end up with user_mode_vm() being true is the death by NMI watch dog or
from the IPI to bring the non master kgdb cpus into debugger. By default
the kgdb exception handler is not going to end up with that condition,
because there is a check against regs in the kgdb notify handler for the
non NMI/IPI events.

Thank you for the suggestion.   I went ahead and tested it out to
confirm the behavior, as well as to run the standard set of kgdb
regression tests.

The corner case is fixed in the attached patch, and I updated for_linus
branch with just this patch, if you would prefer to pull it.

 
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git
for_linus

Thanks,
Jason.

View attachment "0001-kgdb-i386-Fix-corner-case-access-to-sp-with-NMI-watc.patch" of type "text/x-diff" (1269 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ