From: Greg Kroah-Hartman Date: Sun, 28 Jul 2019 09:27:54 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.2.5~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e7a3d12c45eac46d0be03c2ce8ce0f9b99c6f03;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: elevator-fix-truncation-of-icq_cache_name.patch --- diff --git a/queue-4.4/elevator-fix-truncation-of-icq_cache_name.patch b/queue-4.4/elevator-fix-truncation-of-icq_cache_name.patch new file mode 100644 index 00000000000..aec096fe361 --- /dev/null +++ b/queue-4.4/elevator-fix-truncation-of-icq_cache_name.patch @@ -0,0 +1,50 @@ +From 9bd2bbc01d17ddd567cc0f81f77fe1163e497462 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Fri, 2 Jun 2017 20:35:51 -0700 +Subject: elevator: fix truncation of icq_cache_name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Eric Biggers + +commit 9bd2bbc01d17ddd567cc0f81f77fe1163e497462 upstream. + +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 +Reviewed-by: Bart Van Assche +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/elevator.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/elevator.h ++++ b/include/linux/elevator.h +@@ -97,7 +97,7 @@ struct elevator_type + struct module *elevator_owner; + + /* managed by elevator core */ +- char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */ ++ char icq_cache_name[ELV_NAME_MAX + 6]; /* elvname + "_io_cq" */ + struct list_head list; + }; + diff --git a/queue-4.4/series b/queue-4.4/series index 69e3f09a356..be857d57a5d 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -98,3 +98,4 @@ bonding-validate-ip-header-before-check-ipproto_igmp.patch net-bridge-mcast-fix-stale-nsrcs-pointer-in-igmp3-mld2-report-handling.patch net-bridge-mcast-fix-stale-ipv6-hdr-pointer-when-handling-v6-query.patch net-bridge-stp-don-t-cache-eth-dest-pointer-before-skb-pull.patch +elevator-fix-truncation-of-icq_cache_name.patch