From 80deb7724939e8130871e84abd0cd98a1c4d8b2f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 20 Dec 2019 15:10:19 +0100 Subject: [PATCH] 2.35-0.4: fix agetty --- ...ep-freed-issue-file-pointer-zeroized.patch | 55 +++++++++++++++++++ util-linux.spec | 9 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0001-agetty-keep-freed-issue-file-pointer-zeroized.patch diff --git a/0001-agetty-keep-freed-issue-file-pointer-zeroized.patch b/0001-agetty-keep-freed-issue-file-pointer-zeroized.patch new file mode 100644 index 0000000..a5441b1 --- /dev/null +++ b/0001-agetty-keep-freed-issue-file-pointer-zeroized.patch @@ -0,0 +1,55 @@ +From 9418ba6d05feed6061f5343741b1bc56e7bde663 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Fri, 20 Dec 2019 15:05:33 +0100 +Subject: [PATCH] agetty: keep freed issue file pointer zeroized + +References: https://bugzilla.redhat.com/show_bug.cgi?id=1784536 +Signed-off-by: Karel Zak +--- + term-utils/agetty.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/term-utils/agetty.c b/term-utils/agetty.c +index 3c20acc98..dfc4921f5 100644 +--- a/term-utils/agetty.c ++++ b/term-utils/agetty.c +@@ -1820,8 +1820,12 @@ static int issuefile_read_stream( + if (fstat(fileno(f), &st) || !S_ISREG(st.st_mode)) + return 1; + +- if (!ie->output) +- ie->output = open_memstream(&ie->mem, &ie->mem_sz); ++ if (!ie->output) { ++ free(ie->mem); ++ ie->mem_sz = 0; ++ ie->mem = NULL; ++ ie->output = open_memstream(&ie->mem, &ie->mem_sz); ++ } + + while ((c = getc(f)) != EOF) { + if (c == '\\') +@@ -1965,8 +1969,10 @@ done: + if (netlink_groups != 0) + open_netlink(); + #endif +- if (ie->output) ++ if (ie->output) { + fclose(ie->output); ++ ie->output = NULL; ++ } + } + + /* This is --show-issue backend, executed by normal user on the current +@@ -1985,7 +1991,8 @@ static void show_issue(struct options *op) + + if (ie.mem_sz) + write_all(STDOUT_FILENO, ie.mem, ie.mem_sz); +- ++ if (ie.output) ++ fclose(ie.output); + free(ie.mem); + } + +-- +2.21.0 + diff --git a/util-linux.spec b/util-linux.spec index d1c5d18..88fd569 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.35 -Release: 0.3%{?dist} +Release: 0.4%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: http://en.wikipedia.org/wiki/Util-linux @@ -106,6 +106,10 @@ Requires: libfdisk = %{version}-%{release} # 151635 - makeing /var/log/lastlog Patch0: 2.28-login-lastlog-create.patch +# 1784536 - Segfaults in agetty during Cloud image testing +Patch1: 0001-agetty-keep-freed-issue-file-pointer-zeroized.patch + + %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -932,6 +936,9 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Fri Dec 20 2019 Karel Zak - 2.35-0.4 +- fix #1784536 - Segfaults in agetty during Cloud image testing + * Fri Dec 20 2019 Karel Zak - 2.35-0.3 - upgrade to the upstream git snapshot (v2.35-rc1-20-g63f8c66af) - fix #1783066 - Fedora-Rawhide images do not boot