alistair23-linux/include
Alexey Dobriyan 9774a1f54f [PATCH] Compile-time check re world-writeable module params
One of the mistakes a module_param() user can make is to supply default
value of module parameter as the last argument.  module_param() accepts
permissions instead.  If default value is, say, 3 (-------wx), parameter
becomes world-writeable.

So far, the only remedy was to apply grep(1) and read drivers submitted
to -mm. BTDT.

With this patch applied, compiler will finally do some job.

*) bounds checking on permissions
*) world-writeable bit checking on permissions
*) compile breakage if checks trigger

First version of this check (only "& 2" part) directly caught 4 out of 7
places during my last grep.

    Subject: Neverending module_param() bugs
    [X] drivers/acpi/sbs.c:101:module_param(capacity_mode, int, CAPACITY_UNIT);
    [X] drivers/acpi/sbs.c:102:module_param(update_mode, int, UPDATE_MODE);
    [ ] drivers/acpi/sbs.c:103:module_param(update_info_mode, int, UPDATE_INFO_MODE);
    [ ] drivers/acpi/sbs.c:104:module_param(update_time, int, UPDATE_TIME);
    [ ] drivers/acpi/sbs.c:105:module_param(update_time2, int, UPDATE_TIME2);
    [X] drivers/char/watchdog/sbc8360.c:203:module_param(timeout, int, 27);
    [X] drivers/media/video/tuner-simple.c:13:module_param(offset, int, 0666);

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:34 -08:00
..
acpi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-alpha [NET]: Alpha checksum annotations and cleanups. 2006-12-02 21:23:01 -08:00
asm-arm WorkQueue: Fix up arch-specific work items where possible 2006-12-05 19:36:26 +00:00
asm-arm26 [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-avr32 [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
asm-cris [NET]: Cris checksum annotations and cleanups. 2006-12-02 21:23:02 -08:00
asm-frv [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
asm-generic [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
asm-h8300 [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
asm-i386 [PATCH] swsusp: Support i386 systems with PAE or without PSE 2006-12-07 08:39:28 -08:00
asm-ia64 [PATCH] numa node ids are int, page_to_nid and zone_to_nid should return int 2006-12-07 08:39:23 -08:00
asm-m32r [NET]: M32R checksum annotations and cleanups. 2006-12-02 21:23:06 -08:00
asm-m68k [NET]: M68K checksum annotations and cleanups. 2006-12-02 21:23:07 -08:00
asm-m68knommu [PATCH] m68knommu: remove FP conditionals in ucontext struct 2006-12-06 07:41:26 -08:00
asm-mips [PATCH] mm: k{,um}map_atomic() vs in_atomic() 2006-12-07 08:39:21 -08:00
asm-parisc [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
asm-powerpc [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-ppc [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
asm-s390 [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
asm-sh sh: sh775x/titan fixes for irq header changes. 2006-12-06 12:05:02 +09:00
asm-sh64 [NET]: SH64 checksum annotations and cleanups. 2006-12-02 21:23:11 -08:00
asm-sparc [NET]: SPARC checksum annotations and cleanups. 2006-12-02 21:23:22 -08:00
asm-sparc64 [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
asm-um Driver core: add dev_archdata to struct device 2006-12-01 14:52:01 -08:00
asm-v850 [PATCH] fix v850 compilation 2006-12-07 08:39:29 -08:00
asm-x86_64 [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
asm-xtensa [NET]: XTENSA checksum annotations and cleanups. 2006-12-02 21:23:24 -08:00
crypto [CRYPTO] digest: Added user API for new hash type 2006-09-21 11:46:17 +10:00
keys [PATCH] keys: discard the contents of a key on revocation 2006-06-26 09:58:18 -07:00
linux [PATCH] Compile-time check re world-writeable module params 2006-12-07 08:39:34 -08:00
math-emu
media V4L/DVB (4666): Ensure the WM8775 driver is loaded generically for any board. 2006-10-03 15:13:48 -03:00
mtd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-10-01 17:55:53 +01:00
net [PATCH] lockdep: annotate nfs/nfsd in-kernel sockets 2006-12-07 08:39:30 -08:00
pcmcia [PATCH] pcmcia: multifunction card handling fixes 2006-12-04 20:09:15 -05:00
rdma IB/cm: Fix automatic path migration support 2006-11-29 15:33:10 -08:00
rxrpc
scsi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
sound Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 17:01:28 +00:00
video fix file specification in comments 2006-10-03 23:01:26 +02:00
Kbuild [HEADERS] One line per header in Kbuild files to reduce conflicts 2006-09-19 12:43:58 +01:00