diff options
author | sirlucjan | 2017-05-02 13:41:53 +0200 |
---|---|---|
committer | sirlucjan | 2017-05-02 13:41:53 +0200 |
commit | d846e3202d5ab405ff2e980af661ffbf374bcfbb (patch) | |
tree | 13b9b4466a7b9257c708451c2d613c0cadaf942a | |
parent | d4eb520650cc44450e18d73ee5c5abd9ba600e0c (diff) | |
download | aur-d846e3202d5ab405ff2e980af661ffbf374bcfbb.tar.gz |
Bump to BFQ v8r11
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | 0005-BFQ-update-to-v8r11.patch | 116 | ||||
-rw-r--r-- | PKGBUILD | 7 |
3 files changed, 122 insertions, 3 deletions
@@ -22,6 +22,7 @@ pkgbase = linux-bfq source = config.x86_64 source = 90-linux.hook source = linux.preset + source = 0005-BFQ-update-to-v8r11.patch validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E sha512sums = c3690125a8402df638095bd98a613fcf1a257b81de7611c84711d315cd11e2634ab4636302b3742aedf1e3ba9ce0fea53fe8c7d48e37865d8ee5db3565220d90 @@ -37,6 +38,7 @@ pkgbase = linux-bfq sha512sums = 6afb164bc7a38fea08a49c70690afafb209d1245588e1ecf57998926f5b43fe85d39a1ab1a133900b82bc1d3d97538330bf5c646b62e782653d69b6139d72200 sha512sums = d6faa67f3ef40052152254ae43fee031365d0b1524aa0718b659eb75afc21a3f79ea8d62d66ea311a800109bed545bc8f79e8752319cd378eef2cbd3a09aba22 sha512sums = 2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf + sha512sums = 554c5a9b3ed415f42f8ba0e25e6d0449b378ab10933e7628ce1fad07bcfcffe3a2319df05360aed4761ac3388e8f05b36e237e2ff1847128672e3461c99fe2c7 pkgname = linux-bfq pkgdesc = Linux Kernel and modules with the BFQ scheduler. diff --git a/0005-BFQ-update-to-v8r11.patch b/0005-BFQ-update-to-v8r11.patch new file mode 100644 index 000000000000..97ad479b3865 --- /dev/null +++ b/0005-BFQ-update-to-v8r11.patch @@ -0,0 +1,116 @@ +From 1114a7985d8ca1f04210b38a2d90f0e837b4ea05 Mon Sep 17 00:00:00 2001 +From: Paolo Valente <paolo.valente@linaro.org> +Date: Wed, 26 Apr 2017 19:14:04 +0200 +Subject: [PATCH 1/3] block, bfq: use pointer entity->sched_data only if set + +In the function __bfq_deactivate_entity, the pointer +entity->sched_data could happen to be used before being properly +initialized. This led to a NULL pointer dereference. This commit fixes +this bug by just using this pointer only where it is safe to do so. + +Reported-by: Tom Harrison <l12436.tw@gmail.com> +Tested-by: Tom Harrison <l12436.tw@gmail.com> +Signed-off-by: Paolo Valente <paolo.valente@linaro.org> +--- + block/bfq-sched.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/block/bfq-sched.c b/block/bfq-sched.c +index 70aac56..8311bdb 100644 +--- a/block/bfq-sched.c ++++ b/block/bfq-sched.c +@@ -1280,14 +1280,23 @@ static bool __bfq_deactivate_entity(struct bfq_entity *entity, + bool ins_into_idle_tree) + { + struct bfq_sched_data *sd = entity->sched_data; +- struct bfq_service_tree *st = bfq_entity_service_tree(entity); +- bool is_in_service = entity == sd->in_service_entity; ++ struct bfq_service_tree *st; ++ bool is_in_service; + + if (!entity->on_st) { /* entity never activated, or already inactive */ +- BUG_ON(entity == entity->sched_data->in_service_entity); ++ BUG_ON(sd && entity == sd->in_service_entity); + return false; + } + ++ /* ++ * If we get here, then entity is active, which implies that ++ * bfq_group_set_parent has already been invoked for the group ++ * represented by entity. Therefore, the field ++ * entity->sched_data has been set, and we can safely use it. ++ */ ++ st = bfq_entity_service_tree(entity); ++ is_in_service = entity == sd->in_service_entity; ++ + BUG_ON(is_in_service && entity->tree && entity->tree != &st->active); + + if (is_in_service) + +From 614555e901cf87767e339ab4a5e632f938841fe6 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Thu, 20 Apr 2017 15:07:18 +0100 +Subject: [PATCH 2/3] block, bfq: don't dereference bic before null checking it + +The call to bfq_check_ioprio_change will dereference bic, however, +the null check for bic is after this call. Move the the null +check on bic to before the call to avoid any potential null +pointer dereference issues. + +Detected by CoverityScan, CID#1430138 ("Dereference before null check") + +Signed-off-by: Colin Ian King <colin.king@canonical.com> +Signed-off-by: Jens Axboe <axboe@fb.com> +--- + block/bfq-iosched.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c +index 59b1891..77db5a5 100644 +--- a/block/bfq-iosched.c ++++ b/block/bfq-iosched.c +@@ -4561,6 +4561,8 @@ static int bfq_set_request(struct request_queue *q, struct request *rq, + if (!bic) + goto queue_fail; + ++ bfq_check_ioprio_change(bic, bio); ++ + bfq_bic_update_cgroup(bic, bio); + + new_queue: + +From 547022587388ae4e2f27bc45ba23eb040c0558b1 Mon Sep 17 00:00:00 2001 +From: Paolo Valente <paolo.valente@linaro.org> +Date: Mon, 1 May 2017 19:15:43 +0200 +Subject: [PATCH 3/3] BFQ-v8r11 + +Signed-off-by: Paolo Valente <paolo.valente@linaro.org> +--- + block/bfq-iosched.c | 2 +- + block/bfq.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c +index 77db5a5..6d06c3c 100644 +--- a/block/bfq-iosched.c ++++ b/block/bfq-iosched.c +@@ -5259,7 +5259,7 @@ static struct blkcg_policy blkcg_policy_bfq = { + static int __init bfq_init(void) + { + int ret; +- char msg[60] = "BFQ I/O-scheduler: v8r10"; ++ char msg[60] = "BFQ I/O-scheduler: v8r11"; + + #ifdef CONFIG_BFQ_GROUP_IOSCHED + ret = blkcg_policy_register(&blkcg_policy_bfq); +diff --git a/block/bfq.h b/block/bfq.h +index 7cb3240..8cd2b6f 100644 +--- a/block/bfq.h ++++ b/block/bfq.h +@@ -1,5 +1,5 @@ + /* +- * BFQ v8r10 for 4.10.0: data structures and common functions prototypes. ++ * BFQ v8r11 for 4.10.0: data structures and common functions prototypes. + * + * Based on ideas and code from CFQ: + * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk> @@ -80,7 +80,7 @@ source=("http://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" # standard config files for mkinitcpio ramdisk 'linux.preset' # patches from https://github.com/linusw/linux-bfq/commits/bfq-v8 - ) + '0005-BFQ-update-to-v8r11.patch') _kernelname=${pkgbase#linux} @@ -93,7 +93,7 @@ prepare() { ### Patch source with BFQ msg "Patching source with BFQ patches" - for p in "${srcdir}"/000{1,2,3,4}-*BFQ*.patch; do + for p in "${srcdir}"/000{1,2,3,4,5}-*BFQ*.patch; do msg " $p" patch -Np1 -i "$p" done @@ -435,7 +435,8 @@ sha512sums=('c3690125a8402df638095bd98a613fcf1a257b81de7611c84711d315cd11e2634ab '1f0a8695b7c106d7946d67eaa8ebcf4e0bccd2cae01b0cd5621af04aa42f7e9a1b379764fb9bd9917f85ff719ec28e081eeb7c143a682f6d179e2bd1d7d15d7e' '6afb164bc7a38fea08a49c70690afafb209d1245588e1ecf57998926f5b43fe85d39a1ab1a133900b82bc1d3d97538330bf5c646b62e782653d69b6139d72200' 'd6faa67f3ef40052152254ae43fee031365d0b1524aa0718b659eb75afc21a3f79ea8d62d66ea311a800109bed545bc8f79e8752319cd378eef2cbd3a09aba22' - '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf') + '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf' + '554c5a9b3ed415f42f8ba0e25e6d0449b378ab10933e7628ce1fad07bcfcffe3a2319df05360aed4761ac3388e8f05b36e237e2ff1847128672e3461c99fe2c7') validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds |