Coly Li
70e8b1e006
bcache: fix input overflow to sequential_cutoff
...
[ Upstream commit 8c27a3953e92eb0b22dbb03d599f543a05f9574e ]
People may set sequential_cutoff of a cached device via sysfs file,
but current code does not check input value overflow. E.g. if value
4294967295 (UINT_MAX) is written to file sequential_cutoff, its value
is 4GB, but if 4294967296 (UINT_MAX + 1) is written into, its value
will be 0. This is an unexpected behavior.
This patch replaces d_strtoi_h() by sysfs_strtoul_clamp() to convert
input string to unsigned integer value, and limit its range in
[0, UINT_MAX]. Then the input overflow can be fixed.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:31:34 +02:00
..
2019-04-05 22:31:34 +02:00
2018-01-23 19:58:18 +01:00
2017-12-17 15:08:00 +01:00
2017-11-02 11:10:55 +01:00
2017-06-19 11:03:50 -04:00
2017-06-09 09:27:32 -06:00
2017-06-19 11:03:50 -04:00
2017-03-07 11:30:16 -05:00
2017-08-23 12:49:55 -06:00
2018-03-15 10:54:33 +01:00
2017-08-28 11:47:17 -04:00
2017-11-02 11:10:55 +01:00
2017-05-17 09:44:53 -04:00
2017-03-07 13:28:31 -05:00
2016-12-16 00:13:41 +02:00
2018-12-21 14:13:06 +01:00
2017-03-07 13:28:31 -05:00
2017-03-07 13:28:31 -05:00
2017-05-14 21:54:33 -04:00
2017-03-07 13:28:31 -05:00
2018-10-18 09:16:24 +02:00
2017-11-30 08:40:43 +00:00
2019-02-20 10:20:54 +01:00
2017-08-23 12:49:55 -06:00
2017-08-23 12:49:55 -06:00
2018-10-18 09:16:24 +02:00
2019-03-23 14:35:28 +01:00
2017-08-23 12:49:55 -06:00
2018-11-13 11:15:10 -08:00
2019-01-26 09:37:05 +01:00
2018-10-18 09:16:24 +02:00
2017-09-14 13:43:16 -07:00
2018-04-26 11:02:07 +02:00
2017-08-23 12:49:55 -06:00
2018-10-10 08:54:24 +02:00
2017-02-17 00:54:09 -05:00
2017-08-28 10:23:28 -04:00
2017-08-28 10:23:28 -04:00
2017-05-31 10:50:23 -04:00
2019-01-26 09:37:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 13:43:16 -07:00
2017-09-14 13:43:16 -07:00
2018-07-11 16:29:23 +02:00
2017-06-09 09:27:32 -06:00
2019-01-31 08:13:45 +01:00
2019-01-31 08:13:45 +01:00
2019-04-05 22:31:28 +02:00
2017-07-26 15:55:44 -04:00
2017-03-16 09:37:31 -04:00
2019-01-13 10:01:04 +01:00
2017-04-24 15:37:04 -04:00
2017-06-09 09:27:32 -06:00
2018-11-13 11:15:10 -08:00
2017-07-26 15:55:43 -04:00
2019-01-13 10:01:04 +01:00
2017-06-19 11:05:20 -04:00
2018-10-18 09:16:24 +02:00
2017-04-27 17:08:44 -04:00
2017-08-23 12:49:55 -06:00
2017-06-19 11:05:20 -04:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-03 17:00:47 -07:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:15:18 -08:00
2018-07-08 15:30:50 +02:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2018-07-08 15:30:50 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-20 10:20:54 +01:00
2017-11-02 11:10:55 +01:00
2019-02-06 17:31:37 +01:00
2018-10-10 08:54:20 +02:00
2017-12-20 10:10:36 +01:00
2019-03-23 14:35:30 +01:00
2017-11-02 11:10:55 +01:00
2019-03-23 14:35:30 +01:00
2017-11-02 11:10:55 +01:00