* [PATCH] ethtool_get_regs copy right number of bytes to user
@ 2004-06-15 22:55 Chris Wright
2004-08-01 19:03 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wright @ 2004-06-15 22:55 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-kernel
If regs.len is smaller than reglen it's possible to copy more bytes out
than the user asked for.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/core/ethtool.c 1.14 vs edited =====
--- 1.14/net/core/ethtool.c 2004-06-02 14:54:28 -07:00
+++ edited/net/core/ethtool.c 2004-06-13 12:59:15 -07:00
@@ -157,7 +157,7 @@
if (copy_to_user(useraddr, ®s, sizeof(regs)))
goto out;
useraddr += offsetof(struct ethtool_regs, data);
- if (copy_to_user(useraddr, regbuf, reglen))
+ if (copy_to_user(useraddr, regbuf, regs.len))
goto out;
ret = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-01 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-15 22:55 [PATCH] ethtool_get_regs copy right number of bytes to user Chris Wright
2004-08-01 19:03 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).