mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: [CHECKER][PATCH] pnpbios dereferencing user pointer
Date: Mon, 2 Jun 2003 15:10:12 -0500	[thread overview]
Message-ID: <37C2C7CC-9536-11D7-BBCD-000A95A0560C@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Another simple case of a memcpy that should be copy_from_user...

-- 
Hollis Blanchard
IBM Linux Technology Center

[-- Attachment #2: pnpbios-memcpy.diff --]
[-- Type: application/octet-stream, Size: 475 bytes --]

--- linux-2.5.70/drivers/pnp/pnpbios/proc.c.orig	Mon Mar 24 16:30:11 2003
+++ linux-2.5.70/drivers/pnp/pnpbios/proc.c	Tue May 27 13:18:57 2003
@@ -185,7 +185,10 @@
 		return -EIO;
 	if (count != node->size - sizeof(struct pnp_bios_node))
 		return -EINVAL;
-	memcpy(node->data, buf, count);
+	if (copy_from_user(node->data, buf, count)) {
+		kfree(node);
+		return -EFAULT;
+	}
 	if (pnp_bios_set_dev_node(node->handle, boot, node) != 0)
 	    return -EINVAL;
 	kfree(node);

             reply	other threads:[~2003-06-02 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-02 20:10 Hollis Blanchard [this message]
2003-06-02 21:03 ` Andrew Morton

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=37C2C7CC-9536-11D7-BBCD-000A95A0560C@us.ibm.com \
    --to=hollisb@us.ibm.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®