From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: yet another sparse-detected bug fix
Date: Mon, 04 Oct 2004 15:45:26 +0000 [thread overview]
Message-ID: <200410041545.i94FjQd0031552@napali.hpl.hp.com> (raw)
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);
next reply other threads:[~2004-10-04 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-04 15:45 David Mosberger [this message]
2004-10-04 19:46 ` yet another sparse-detected bug fix Arun Sharma
2004-10-05 7:21 ` David Mosberger
2004-10-05 15:40 ` Luck, Tony
2004-10-05 15:59 ` David Mosberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200410041545.i94FjQd0031552@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox