Files
kernel_arpi/include/linux
Eric Biggers 9bd2bbc01d elevator: fix truncation of icq_cache_name
gcc 7.1 reports the following warning:

    block/elevator.c: In function ‘elv_register’:
    block/elevator.c:898:5: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
         "%s_io_cq", e->elevator_name);
         ^~~~~~~~~~
    block/elevator.c:897:3: note: ‘snprintf’ output between 7 and 22 bytes into a destination of size 21
       snprintf(e->icq_cache_name, sizeof(e->icq_cache_name),
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "%s_io_cq", e->elevator_name);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The bug is that the name of the icq_cache is 6 characters longer than
the elevator name, but only ELV_NAME_MAX + 5 characters were reserved
for it --- so in the case of a maximum-length elevator name, the 'q'
character in "_io_cq" would be truncated by snprintf().  Fix it by
reserving ELV_NAME_MAX + 6 characters instead.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-06-06 11:20:47 -06:00
..
2017-04-21 10:45:01 -04:00
2017-04-28 18:09:59 -04:00
2017-05-01 14:09:21 -07:00
2017-04-26 23:54:06 -04:00
2017-04-27 05:13:04 -04:00
2017-05-25 13:44:28 -04:00
2017-05-12 15:57:15 -07:00
2017-05-03 15:52:10 -07:00
2017-05-08 17:15:12 -07:00
2017-05-03 15:52:10 -07:00
2017-04-24 14:30:46 -04:00
2017-04-26 13:03:04 -04:00
2017-05-09 16:43:23 +03:00
2017-05-03 15:52:10 -07:00
2017-05-08 17:15:12 -07:00
2017-05-09 16:43:22 +03:00