block: reject invalid queue attribute values
authorDave Reisner <dreisner@archlinux.org>
Sat, 8 Sep 2012 15:55:45 +0000 (11:55 -0400)
committerJens Axboe <axboe@kernel.dk>
Sun, 9 Sep 2012 08:39:18 +0000 (10:39 +0200)
commitb1f3b64d76cf88cc250e5cdd1de783ba9737078e
treec7ec8496a2b9a8af239fa78090f65178f30063c7
parentbf800ef1816b4283a885e55ad38068aec9711e4d
block: reject invalid queue attribute values

Instead of using simple_strtoul which "converts" invalid numbers to 0,
use strict_strtoul and perform error checking to ensure that userspace
passes us a valid unsigned long. This addresses problems with functions
such as writev, which might want to write a trailing newline -- the
newline should rightfully be rejected, but the value preceeding it
should be preserved.

Fixes BZ#46981.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-sysfs.c