From 0a6fd1833138331a6b9007e65f344a2fcb1a59f4 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 15 Feb 2022 06:53:51 -0600 Subject: kernel-5.17-0.rc4.d567f5db412e.97 * Tue Feb 15 2022 Fedora Kernel Team [5.17-0.rc4.d567f5db412e.97] - mm/sparsemem: Fix 'mem_section' will never be NULL gcc 12 warning (Waiman Long) - tools: Fix use-after-free for realloc(..., 0) (Kees Cook) Resolves: rhbz# Signed-off-by: Justin M. Forbes --- patch-5.17-redhat.patch | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'patch-5.17-redhat.patch') diff --git a/patch-5.17-redhat.patch b/patch-5.17-redhat.patch index c7be88cf8..9de2761b4 100644 --- a/patch-5.17-redhat.patch +++ b/patch-5.17-redhat.patch @@ -74,8 +74,8 @@ security/lockdown/Kconfig | 13 + security/lockdown/lockdown.c | 1 + security/security.c | 6 + - tools/lib/subcmd/subcmd-util.h | 9 +- - 77 files changed, 1748 insertions(+), 196 deletions(-) + tools/lib/subcmd/subcmd-util.h | 11 +- + 77 files changed, 1746 insertions(+), 200 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index f5a27f067db9..f4dc42f2f82a 100644 @@ -3436,24 +3436,24 @@ index 22261d79f333..20336365f864 100644 int security_perf_event_open(struct perf_event_attr *attr, int type) { diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h -index 794a375dad36..7009fc176636 100644 +index 794a375dad36..b2aec04fce8f 100644 --- a/tools/lib/subcmd/subcmd-util.h +++ b/tools/lib/subcmd/subcmd-util.h -@@ -49,13 +49,12 @@ static NORETURN inline void die(const char *err, ...) - +@@ -50,15 +50,8 @@ static NORETURN inline void die(const char *err, ...) static inline void *xrealloc(void *ptr, size_t size) { -- void *ret = realloc(ptr, size); + void *ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); -+ void *ret; -+ if (!size) -+ size = 1; -+ ret = realloc(ptr, size); - if (!ret) { - ret = realloc(ptr, size); +- if (!ret) { +- ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); - if (!ret) - die("Out of memory, realloc failed"); - } +- if (!ret) +- die("Out of memory, realloc failed"); +- } ++ if (!ret) ++ die("Out of memory, realloc failed"); + return ret; + } + -- cgit