public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* yet another sparse-detected bug fix
@ 2004-10-04 15:45 David Mosberger
  2004-10-04 19:46 ` Arun Sharma
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Mosberger @ 2004-10-04 15:45 UTC (permalink / raw)
  To: linux-ia64

Arun,

copy_siginfo_from_user32() directly dereferences a user-pointer, which
is a no-no.  At that point, to->si_code already has been initialized
so I think we can just use to->si_code instead.  Compile-tested (only)
patch attached.

Signed-off-by: davidm@hpl.hp.com

=== arch/ia64/ia32/ia32_signal.c 1.30 vs edited ==--- 1.30/arch/ia64/ia32/ia32_signal.c	2004-09-21 12:36:02 -07:00
+++ edited/arch/ia64/ia32/ia32_signal.c	2004-10-04 07:38:03 -07:00
@@ -78,10 +78,10 @@
 	err |= __get_user(to->si_errno, &from->si_errno);
 	err |= __get_user(to->si_code, &from->si_code);
 
-	if (from->si_code < 0)
+	if (to->si_code < 0)
 		err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
 	else {
-		switch (from->si_code >> 16) {
+		switch (to->si_code >> 16) {
 		      case __SI_CHLD >> 16:
 			err |= __get_user(to->si_utime, &from->si_utime);
 			err |= __get_user(to->si_stime, &from->si_stime);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-05 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 15:45 yet another sparse-detected bug fix David Mosberger
2004-10-04 19:46 ` Arun Sharma
2004-10-05  7:21 ` David Mosberger
2004-10-05 15:40 ` Luck, Tony
2004-10-05 15:59 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox