From: Greg Kroah-Hartman Date: Tue, 1 Oct 2024 08:36:37 +0000 (+0200) Subject: 6.10-stable patches X-Git-Tag: v6.6.54~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58bfce6f2a499543ee4a0816e8b786c175cf725c;p=thirdparty%2Fkernel%2Fstable-queue.git 6.10-stable patches added patches: io_uring-sqpoll-do-not-put-cpumask-on-stack.patch selftests-bpf-correctly-move-log-upon-successful-match.patch --- diff --git a/queue-6.10/io_uring-sqpoll-do-not-put-cpumask-on-stack.patch b/queue-6.10/io_uring-sqpoll-do-not-put-cpumask-on-stack.patch new file mode 100644 index 00000000000..1a81dbd04d0 --- /dev/null +++ b/queue-6.10/io_uring-sqpoll-do-not-put-cpumask-on-stack.patch @@ -0,0 +1,50 @@ +From 7f44beadcc11adb98220556d2ddbe9c97aa6d42d Mon Sep 17 00:00:00 2001 +From: Felix Moessbauer +Date: Mon, 16 Sep 2024 13:11:50 +0200 +Subject: io_uring/sqpoll: do not put cpumask on stack + +From: Felix Moessbauer + +commit 7f44beadcc11adb98220556d2ddbe9c97aa6d42d upstream. + +Putting the cpumask on the stack is deprecated for a long time (since +2d3854a37e8), as these can be big. Given that, change the on-stack +allocation of allowed_mask to be dynamically allocated. + +Fixes: f011c9cf04c0 ("io_uring/sqpoll: do not allow pinning outside of cpuset") +Signed-off-by: Felix Moessbauer +Link: https://lore.kernel.org/r/20240916111150.1266191-1-felix.moessbauer@siemens.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/sqpoll.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +--- a/io_uring/sqpoll.c ++++ b/io_uring/sqpoll.c +@@ -461,15 +461,22 @@ __cold int io_sq_offload_create(struct i + return 0; + + if (p->flags & IORING_SETUP_SQ_AFF) { +- struct cpumask allowed_mask; ++ cpumask_var_t allowed_mask; + int cpu = p->sq_thread_cpu; + + ret = -EINVAL; + if (cpu >= nr_cpu_ids || !cpu_online(cpu)) + goto err_sqpoll; +- cpuset_cpus_allowed(current, &allowed_mask); +- if (!cpumask_test_cpu(cpu, &allowed_mask)) ++ ret = -ENOMEM; ++ if (!alloc_cpumask_var(&allowed_mask, GFP_KERNEL)) + goto err_sqpoll; ++ ret = -EINVAL; ++ cpuset_cpus_allowed(current, allowed_mask); ++ if (!cpumask_test_cpu(cpu, allowed_mask)) { ++ free_cpumask_var(allowed_mask); ++ goto err_sqpoll; ++ } ++ free_cpumask_var(allowed_mask); + sqd->sq_cpu = cpu; + } else { + sqd->sq_cpu = -1; diff --git a/queue-6.10/selftests-bpf-correctly-move-log-upon-successful-match.patch b/queue-6.10/selftests-bpf-correctly-move-log-upon-successful-match.patch new file mode 100644 index 00000000000..007921fd7ee --- /dev/null +++ b/queue-6.10/selftests-bpf-correctly-move-log-upon-successful-match.patch @@ -0,0 +1,35 @@ +From d0a29cdb6ef95d8a175e09ab2d1334271f047e60 Mon Sep 17 00:00:00 2001 +From: Eduard Zingerman +Date: Tue, 20 Aug 2024 03:23:50 -0700 +Subject: selftests/bpf: correctly move 'log' upon successful match + +From: Eduard Zingerman + +commit d0a29cdb6ef95d8a175e09ab2d1334271f047e60 upstream. + +Suppose log="foo bar buz" and msg->substr="bar". +In such case current match processing logic would update 'log' as +follows: log += strlen(msg->substr); -> log += 3 -> log=" bar". +However, the intent behind the 'log' update is to make it point after +the successful match, e.g. to make log=" buz" in the example above. + +Fixes: 4ef5d6af4935 ("selftests/bpf: no need to track next_match_pos in struct test_loader") +Signed-off-by: Eduard Zingerman +Link: https://lore.kernel.org/r/20240820102357.3372779-3-eddyz87@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/bpf/test_loader.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/testing/selftests/bpf/test_loader.c ++++ b/tools/testing/selftests/bpf/test_loader.c +@@ -545,7 +545,7 @@ static void validate_msgs(char *log_buf, + if (msg->substr) { + match = strstr(log, msg->substr); + if (match) +- log += strlen(msg->substr); ++ log = match + strlen(msg->substr); + } else { + err = regexec(&msg->regex, log, 1, reg_match, 0); + if (err == 0) { diff --git a/queue-6.10/series b/queue-6.10/series index f5b25f763ef..df50ce042fd 100644 --- a/queue-6.10/series +++ b/queue-6.10/series @@ -464,3 +464,5 @@ drm-amd-display-fix-synaptics-cascaded-panamera-dsc-determination.patch xen-move-checks-for-e820-conflicts-further-up.patch xen-allow-mapping-acpi-data-using-a-different-physical-address.patch io_uring-sqpoll-retain-test-for-whether-the-cpu-is-valid.patch +io_uring-sqpoll-do-not-put-cpumask-on-stack.patch +selftests-bpf-correctly-move-log-upon-successful-match.patch