]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 10:21:44 +0000 (12:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 10:21:44 +0000 (12:21 +0200)
added patches:
bpf-fix-comment-for-helper-bpf_current_task_under_cgroup.patch
ubi-fastmap-return-error-code-if-memory-allocation-fails-in-add_aeb.patch

queue-4.19/bpf-fix-comment-for-helper-bpf_current_task_under_cgroup.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/ubi-fastmap-return-error-code-if-memory-allocation-fails-in-add_aeb.patch [new file with mode: 0644]

diff --git a/queue-4.19/bpf-fix-comment-for-helper-bpf_current_task_under_cgroup.patch b/queue-4.19/bpf-fix-comment-for-helper-bpf_current_task_under_cgroup.patch
new file mode 100644 (file)
index 0000000..5736d31
--- /dev/null
@@ -0,0 +1,48 @@
+From 58617014405ad5c9f94f464444f4972dabb71ca7 Mon Sep 17 00:00:00 2001
+From: Hengqi Chen <hengqi.chen@gmail.com>
+Date: Thu, 10 Mar 2022 23:53:35 +0800
+Subject: bpf: Fix comment for helper bpf_current_task_under_cgroup()
+
+From: Hengqi Chen <hengqi.chen@gmail.com>
+
+commit 58617014405ad5c9f94f464444f4972dabb71ca7 upstream.
+
+Fix the descriptions of the return values of helper bpf_current_task_under_cgroup().
+
+Fixes: c6b5fb8690fa ("bpf: add documentation for eBPF helpers (42-50)")
+Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Acked-by: Yonghong Song <yhs@fb.com>
+Link: https://lore.kernel.org/bpf/20220310155335.1278783-1-hengqi.chen@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/uapi/linux/bpf.h       |    4 ++--
+ tools/include/uapi/linux/bpf.h |    4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/include/uapi/linux/bpf.h
++++ b/include/uapi/linux/bpf.h
+@@ -1207,8 +1207,8 @@ union bpf_attr {
+  *    Return
+  *            The return value depends on the result of the test, and can be:
+  *
+- *            * 0, if current task belongs to the cgroup2.
+- *            * 1, if current task does not belong to the cgroup2.
++ *            * 1, if current task belongs to the cgroup2.
++ *            * 0, if current task does not belong to the cgroup2.
+  *            * A negative error code, if an error occurred.
+  *
+  * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
+--- a/tools/include/uapi/linux/bpf.h
++++ b/tools/include/uapi/linux/bpf.h
+@@ -1205,8 +1205,8 @@ union bpf_attr {
+  *    Return
+  *            The return value depends on the result of the test, and can be:
+  *
+- *            * 0, if current task belongs to the cgroup2.
+- *            * 1, if current task does not belong to the cgroup2.
++ *            * 1, if current task belongs to the cgroup2.
++ *            * 0, if current task does not belong to the cgroup2.
+  *            * A negative error code, if an error occurred.
+  *
+  * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
index 830cf3e4a309777416bc5896a4b8da74e6bcccb9..3b776d178ad16e91c813b65b9bc26e9ae0bb6870 100644 (file)
@@ -247,3 +247,5 @@ acpi-cppc-avoid-out-of-bounds-access-when-parsing-_cpc-data.patch
 mm-mmap-return-1-from-stack_guard_gap-__setup-handler.patch
 mm-memcontrol-return-1-from-cgroup.memory-__setup-handler.patch
 mm-usercopy-return-1-from-hardened_usercopy-__setup-handler.patch
+bpf-fix-comment-for-helper-bpf_current_task_under_cgroup.patch
+ubi-fastmap-return-error-code-if-memory-allocation-fails-in-add_aeb.patch
diff --git a/queue-4.19/ubi-fastmap-return-error-code-if-memory-allocation-fails-in-add_aeb.patch b/queue-4.19/ubi-fastmap-return-error-code-if-memory-allocation-fails-in-add_aeb.patch
new file mode 100644 (file)
index 0000000..aa9755b
--- /dev/null
@@ -0,0 +1,86 @@
+From c3c07fc25f37c157fde041b3a0c3dfcb1590cbce Mon Sep 17 00:00:00 2001
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+Date: Mon, 27 Dec 2021 11:22:42 +0800
+Subject: ubi: fastmap: Return error code if memory allocation fails in add_aeb()
+
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+
+commit c3c07fc25f37c157fde041b3a0c3dfcb1590cbce upstream.
+
+Abort fastmap scanning and return error code if memory allocation fails
+in add_aeb(). Otherwise ubi will get wrong peb statistics information
+after scanning.
+
+Fixes: dbb7d2a88d2a7b ("UBI: Add fastmap core")
+Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/ubi/fastmap.c |   28 +++++++++++++++++++---------
+ 1 file changed, 19 insertions(+), 9 deletions(-)
+
+--- a/drivers/mtd/ubi/fastmap.c
++++ b/drivers/mtd/ubi/fastmap.c
+@@ -477,7 +477,9 @@ static int scan_pool(struct ubi_device *
+                       if (err == UBI_IO_FF_BITFLIPS)
+                               scrub = 1;
+-                      add_aeb(ai, free, pnum, ec, scrub);
++                      ret = add_aeb(ai, free, pnum, ec, scrub);
++                      if (ret)
++                              goto out;
+                       continue;
+               } else if (err == 0 || err == UBI_IO_BITFLIPS) {
+                       dbg_bld("Found non empty PEB:%i in pool", pnum);
+@@ -647,8 +649,10 @@ static int ubi_attach_fastmap(struct ubi
+               if (fm_pos >= fm_size)
+                       goto fail_bad;
+-              add_aeb(ai, &ai->free, be32_to_cpu(fmec->pnum),
+-                      be32_to_cpu(fmec->ec), 0);
++              ret = add_aeb(ai, &ai->free, be32_to_cpu(fmec->pnum),
++                            be32_to_cpu(fmec->ec), 0);
++              if (ret)
++                      goto fail;
+       }
+       /* read EC values from used list */
+@@ -658,8 +662,10 @@ static int ubi_attach_fastmap(struct ubi
+               if (fm_pos >= fm_size)
+                       goto fail_bad;
+-              add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
+-                      be32_to_cpu(fmec->ec), 0);
++              ret = add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
++                            be32_to_cpu(fmec->ec), 0);
++              if (ret)
++                      goto fail;
+       }
+       /* read EC values from scrub list */
+@@ -669,8 +675,10 @@ static int ubi_attach_fastmap(struct ubi
+               if (fm_pos >= fm_size)
+                       goto fail_bad;
+-              add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
+-                      be32_to_cpu(fmec->ec), 1);
++              ret = add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
++                            be32_to_cpu(fmec->ec), 1);
++              if (ret)
++                      goto fail;
+       }
+       /* read EC values from erase list */
+@@ -680,8 +688,10 @@ static int ubi_attach_fastmap(struct ubi
+               if (fm_pos >= fm_size)
+                       goto fail_bad;
+-              add_aeb(ai, &ai->erase, be32_to_cpu(fmec->pnum),
+-                      be32_to_cpu(fmec->ec), 1);
++              ret = add_aeb(ai, &ai->erase, be32_to_cpu(fmec->pnum),
++                            be32_to_cpu(fmec->ec), 1);
++              if (ret)
++                      goto fail;
+       }
+       ai->mean_ec = div_u64(ai->ec_sum, ai->ec_count);