Skip to content

Commit

Permalink
Util-linux : Update to version 2.32, fix CVE-2018-7738
Browse files Browse the repository at this point in the history
Change-Id: Ie58ed58bbb32c1264535da104872a95fe29e3a94
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4996
Tested-by: gerrit-photon <[email protected]>
Reviewed-by: Anish Swaminathan <[email protected]>
  • Loading branch information
xiaolin-vmware authored and suezzelur committed Apr 17, 2018
1 parent d98eda4 commit 359c588
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
72 changes: 72 additions & 0 deletions SPECS/systemd/systemd-236-util-linux-build-failure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <[email protected]>
Date: Mon, 26 Mar 2018 17:34:53 +0200
Subject: [PATCH] core: don't include libmount.h in a header file (#8580)

linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
definitions.

To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
should be included. And missing.h must be included last.

Without this, building systemd may fail with:

In file included from [...]/libmount/libmount.h:31:0,
from ../systemd-238/src/core/manager.h:23,
from ../systemd-238/src/core/emergency-action.h:37,
from ../systemd-238/src/core/unit.h:34,
from ../systemd-238/src/core/dbus-timer.h:25,
from ../systemd-238/src/core/timer.c:26:
[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
---
src/core/dbus-execute.c | 1 +
src/core/manager.h | 3 ++-
src/core/mount.c | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 7344623ebf6..c342093bca4 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -18,6 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/

+#include <sys/mount.h>
#include <sys/prctl.h>
#include <stdio_ext.h>

diff --git a/src/core/manager.h b/src/core/manager.h
index 28c5da225b1..e09e0cdf5e9 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -20,7 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/

-#include <libmount.h>
#include <stdbool.h>
#include <stdio.h>

@@ -34,6 +33,8 @@
#include "list.h"
#include "ratelimit.h"

+struct libmnt_monitor;
+
/* Enforce upper limit how many names we allow */
#define MANAGER_MAX_NAMES 131072 /* 128K */

diff --git a/src/core/mount.c b/src/core/mount.c
index 0e755da5c02..0154ebda5d6 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <sys/epoll.h>

+#include <libmount.h>
+
#include "sd-messages.h"

#include "alloc-util.h"
6 changes: 5 additions & 1 deletion SPECS/systemd/systemd.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: Systemd-236
Name: systemd
Version: 236
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+ and GPLv2+ and MIT
URL: http://www.freedesktop.org/wiki/Software/systemd/
Group: System Environment/Security
Expand All @@ -18,6 +18,7 @@ Patch0: 01-enoX-uses-instance-number-for-vmware-hv.patch
Patch1: 02-install-general-aliases.patch
Patch2: systemd-236-default-dns-from-env.patch
Patch3: systemd-macros.patch
Patch4: systemd-236-util-linux-build-failure.patch

#TODO: Verify this patch is necessary or not
#Patch4: systemd-233-query-duid.patch
Expand Down Expand Up @@ -78,6 +79,7 @@ EOF
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

sed -i "s#\#DefaultTasksMax=512#DefaultTasksMax=infinity#g" src/core/system.conf

Expand Down Expand Up @@ -231,6 +233,8 @@ rm -rf %{buildroot}/*
%files lang -f %{name}.lang

%changelog
* Wed Apr 11 2018 Xiaolin Li <[email protected]> 236-3
- Build systemd with util-linux 2.32.
* Wed Jan 17 2018 Divya Thaluru <[email protected]> 236-2
- Fixed the log file directory structure
* Fri Dec 29 2017 Anish Swaminathan <[email protected]> 236-1
Expand Down
6 changes: 4 additions & 2 deletions SPECS/util-linux/util-linux.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Summary: Utilities for file systems, consoles, partitions, and messages
Name: util-linux
Version: 2.31.1
Version: 2.32
Release: 1%{?dist}
URL: http://www.kernel.org/pub/linux/utils/util-linux
License: GPLv2+
Group: Applications/System
Vendor: VMware, Inc.
Distribution: Photon
Source0: %{name}-%{version}.tar.xz
%define sha1 util-linux=66e1eaeedfb3137b1e583d038a4a3f404474ded1
%define sha1 util-linux=4a21387d51f73bab44230c3bf9fe5a291e761111
BuildRequires: ncurses-devel
%if %{with_check}
BuildRequires: ncurses-terminfo
Expand Down Expand Up @@ -97,6 +97,8 @@ rm -rf %{buildroot}/lib/systemd/system
%{_mandir}/man3/*

%changelog
* Mon Apr 09 2018 Xiaolin Li <[email protected]> 2.32-1
- Update to version 2.32, fix CVE-2018-7738
* Wed Dec 27 2017 Anish Swaminathan <[email protected]> 2.31.1-1
- Upgrade to version 2.31.1.
* Mon Oct 02 2017 Alexey Makhalov <[email protected]> 2.29.2-5
Expand Down

0 comments on commit 359c588

Please sign in to comment.