mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [CHECKER] copy_*_user length bugs?
@ 2001-04-18  4:39 Dawson Engler
  2001-04-18  8:52 ` David Schleef
  2001-04-18 12:18 ` Richard B. Johnson
  0 siblings, 2 replies; 7+ messages in thread
From: Dawson Engler @ 2001-04-18  4:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dawson Engler

Hi All,

at the suggestion of Chris (chris@ferret.lmh.ox.ac.uk) I wrote a simple
checker to warn when the length parameter to copy_*_user was (1) an
integer and (2) not checked < 0.    

As an example, the ipv6 routine rawv6_geticmpfilter gets an integer 'len'
from user space, checks that it is smaller than a struct size and then
uses length as an argument to copy_to_user: 

                if (get_user(len, optlen))
                        return -EFAULT;
                if (len > sizeof(struct icmp6_filter))
                        len = sizeof(struct icmp6_filter);
                if (put_user(len, optlen))
                        return -EFAULT;
                if (copy_to_user(optval, &sk->tp_pinfo.tp_raw.filter, len))
                        return -EFAULT;

Is this a real bug?  Or is the checked rule only applicable to
__copy_*_user routines rather than copy_*_user routines?  (If its a real
bug, theres about 8 others that we found).

Thanks,
Dawson

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

end of thread, other threads:[~2001-04-18 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-18  4:39 [CHECKER] copy_*_user length bugs? Dawson Engler
2001-04-18  8:52 ` David Schleef
2001-04-18 11:14   ` Chris Evans
2001-04-18 13:00     ` Russell King
2001-04-18 13:11       ` Chris Evans
2001-04-18 15:21     ` Andreas Schwab
2001-04-18 12:18 ` Richard B. Johnson

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®