From b1adfad7934355d47ca4d10da2dddae1d7cbb62f Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Thu, 6 Jun 2024 11:52:08 +0800 Subject: [PATCH] sync community patches --- ...helpers-for-unaligned-structure-acce.patch | 35 +++++++++++++ ...-libblkid-drbd-reduce-false-positive.patch | 50 +++++++++++++++++++ util-linux.spec | 12 ++++- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch create mode 100644 backport-libblkid-drbd-reduce-false-positive.patch diff --git a/backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch b/backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch new file mode 100644 index 0000000..8721f20 --- /dev/null +++ b/backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch @@ -0,0 +1,35 @@ +From 68459714838c8c0c2d34b6d658638f5d59298bc7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sun, 1 Oct 2023 13:57:12 +0200 +Subject: [PATCH] include/c.h: add helpers for unaligned structure access +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Thomas Weißschuh +--- + include/c.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/include/c.h b/include/c.h +index 752f568c5..224a8e54f 100644 +--- a/include/c.h ++++ b/include/c.h +@@ -213,6 +213,14 @@ + (type *)( (char *)__mptr - offsetof(type,member) );}) + #endif + ++#define read_unaligned_member(p, m) __extension__ ({ \ ++ size_t offset = offsetof(__typeof__(* p), m); \ ++ __typeof__(p->m) v; \ ++ memcpy(&v, ((unsigned char *)p) + offset, sizeof(v)); \ ++ v; }) ++ ++#define member_ptr(p, m) (((unsigned char *)p) + offsetof(__typeof__(*p), m)) ++ + #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME + # ifdef HAVE___PROGNAME + extern char *__progname; +-- +2.33.0 + diff --git a/backport-libblkid-drbd-reduce-false-positive.patch b/backport-libblkid-drbd-reduce-false-positive.patch new file mode 100644 index 0000000..114e349 --- /dev/null +++ b/backport-libblkid-drbd-reduce-false-positive.patch @@ -0,0 +1,50 @@ +From 1ab5d84d66f144ef0a9d1ac9502a59a842466504 Mon Sep 17 00:00:00 2001 +From: biubiuzy <294772273@qq.com> +Date: Wed, 17 Jan 2024 11:23:47 +0800 +Subject: [PATCH] libblkid: (drbd) reduce false-positive + +--- + libblkid/src/superblocks/drbd.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/libblkid/src/superblocks/drbd.c b/libblkid/src/superblocks/drbd.c +index 1723229..410e21d 100644 +--- a/libblkid/src/superblocks/drbd.c ++++ b/libblkid/src/superblocks/drbd.c +@@ -18,6 +18,13 @@ + + #include "superblocks.h" + ++/* ++ * drbd/drbd_int.h ++ */ ++#define BM_BLOCK_SHIFT 12 /* 4k per bit */ ++#define BM_BLOCK_SIZE (1<magic) != DRBD_MD_MAGIC_84_UNCLEAN) + return 1; + ++ if (be32_to_cpu(read_unaligned_member(md, bm_bytes_per_bit)) != BM_BLOCK_SIZE) ++ return 1; ++ + /* + * DRBD does not have "real" uuids; the following resembles DRBD's + * notion of uuids (64 bit, see struct above) +@@ -197,6 +197,9 @@ static int probe_drbd_90(blkid_probe pr) + if (be32_to_cpu(md->magic) != DRBD_MD_MAGIC_09) + return 1; + ++ if (be32_to_cpu(read_unaligned_member(md, bm_bytes_per_bit)) != BM_BLOCK_SIZE) ++ return 1; ++ + /* + * DRBD does not have "real" uuids; the following resembles DRBD's + * notion of uuids (64 bit, see struct above) +-- +2.33.0 + diff --git a/util-linux.spec b/util-linux.spec index a3bba0e..e257ff1 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Name: util-linux Version: 2.35.2 -Release: 16 +Release: 17 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -88,6 +88,8 @@ Patch6008: backport-wall-convert-homebrew-buffering-to-open_memstream.patch Patch6009: backport-wall-use-fputs_careful.patch Patch6010: backport-CVE-2024-28085.patch Patch6011: backport-tests-fix-misc-setarch-run-in-a-docker-environment.patch +Patch6012: backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch +Patch6013: backport-libblkid-drbd-reduce-false-positive.patch Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch Patch9001: modify-rescuemode-chinese-error.patch @@ -439,6 +441,14 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Thu Jun 06 2024 fuanan - 2.35.2-17 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:sync community patches + backport-include-c.h-add-helpers-for-unaligned-structure-acce.patch + backport-libblkid-drbd-reduce-false-positive.patch + * Fri Mar 29 2024 zhangyao - 2.35.2-16 - Type:CVE - CVE:CVE-2024-28085