mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [CHECKER][PATCH] pnpbios dereferencing user pointer
@ 2003-06-02 20:10 Hollis Blanchard
  2003-06-02 21:03 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Hollis Blanchard @ 2003-06-02 20:10 UTC (permalink / raw)
  To: linux-kernel

[-- 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);

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

end of thread, other threads:[~2003-06-02 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02 20:10 [CHECKER][PATCH] pnpbios dereferencing user pointer Hollis Blanchard
2003-06-02 21:03 ` Andrew Morton

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®