Arjan van de Ven 2886a8bdfa floppy: Add an extra bound check on ioctl arguments
gcc is not convinced that the floppy.c ioctl has sufficient bound checks:

In function `copy_from_user',
    inlined from `fd_copyin' at drivers/block/floppy.c:3080,
    inlined from `fd_ioctl' at drivers/block/floppy.c:3503:
    arch/x86/include/asm/uaccess_32.h:211:
warning: call to `copy_from_user_overflow' declared with attribute
warning: copy_from_user buffer size is not provably correct

And frankly, as a human I have a hard time proving the same more or less
(the size comes from the ioctl argument.  humpf.  maybe.  the code isn't
very nice)

This patch adds an explicit check to make 100% sure it's safe, better than
finding out later that there indeed was a gap.

[akpm@linux-foundation.org: add WARN_ON()]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:25 -08:00
..
2009-12-11 11:55:21 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-13 21:23:33 +01:00
2009-12-11 11:55:21 -08:00
2009-12-15 08:53:25 -08:00
2009-12-02 01:13:11 -08:00
2009-12-14 00:26:26 +01:00
2009-12-14 21:17:26 +01:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-09 17:14:38 +11:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:25 -08:00