| Constantine A. Murenin ( @ 2007-09-03 15:22:00 |
| Entry tags: | freebsd, gsoc2007, gsoc2007.en, kern_sysctl.c, phk, sysctl |
12-year-old bug in FreeBSD's kern_sysctl.c
The other week, I found a 12-year-old bug in FreeBSD's /sys/kern/kern_sysctl.c.
The bug is in the incorrect len parameter that is being passed to useracc(9).
I originally thought that it might have some security implications, but in reality, subsequent copyin(9) in sysctl_new_user() is supposed to take care of any boundary problems, so in the end, I'm not sure why this useracc(9) call is even there in the first place, buggy or not. ;)
Although fixing this bug so far doesn't seem to be of any real value to anyone -- tell me if it is to you -- it is nonetheless interesting to find bugs that were introduced so many years ago. ;)
Thanks to Robert Watson for taking his time to commit my patch and for the discussion. Here are some links to the mailing list regarding my fix being committed, read the message in the second link for my complete description of what the bug is about.
http://lists.freebsd.org/pipermail/c
http://lists.freebsd.org/pipermail/c
And here is the history of this bug:
http://cvsweb.freebsd.org/src/sys/k
http://cvsweb.freebsd.org/src/sys/k
http://cvsweb.freebsd.org/src/sys/k
I've also emailed Matt Dillon, and he committed my patch to DragonFly BSD, too:
http://www.dragonflybsd.org/cvsweb/s
P.S. If you're actually looking for a useful but slightly younger bug that I've fixed, then look no further than in my “10-year-old pointer-arithmetic bug in make(1) is now gone…” entry. ;)
Best regards,
Constantine.