public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Nyberg <alexn@dsv.su.se>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Errenous use of memset and memcpy
Date: Sun, 20 Feb 2005 10:38:42 +0000	[thread overview]
Message-ID: <1108895922.2272.1.camel@boxen> (raw)
In-Reply-To: <1108848352.682.2.camel@boxen>

> That should be copy_from_user, and the error checking needs to stay.
> 

Makes sense, thanks.

=== arch/ia64/ia32/ia32_signal.c 1.35 vs edited ==--- 1.35/arch/ia64/ia32/ia32_signal.c	2005-01-25 21:23:45 +01:00
+++ edited/arch/ia64/ia32/ia32_signal.c	2005-02-20 11:32:55 +01:00
@@ -460,9 +460,9 @@ __ia32_rt_sigsuspend (compat_sigset_t *s
 	sigset_t oldset, set;
 
 	scr->scratch_unat = 0;	/* avoid leaking kernel bits to user level */
-	memset(&set, 0, sizeof(&set));
+	memset(&set, 0, sizeof(sigset_t));
 
-	if (memcpy(&set.sig, &sset->sig, sigsetsize))
+	if (copy_from_user(&set.sig, &sset->sig, sigsetsize))
 		return -EFAULT;
 
 	sigdelsetmask(&set, ~_BLOCKABLE);




  parent reply	other threads:[~2005-02-20 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-19 21:25 [PATCH] Errenous use of memset and memcpy Alexander Nyberg
2005-02-19 21:55 ` Andreas Schwab
2005-02-20 10:38 ` Alexander Nyberg [this message]
2005-02-22 17:37 ` Bjorn Helgaas
2005-03-03 20:53 ` Arun Sharma

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=1108895922.2272.1.camel@boxen \
    --to=alexn@dsv.su.se \
    --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