Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8ca79e82d69e69634092dd5e66a66a8d46cc449d
commit 8ca79e82d69e69634092dd5e66a66a8d46cc449d Author: crazy <[email protected]> Date: Fri Sep 30 13:41:48 2016 +0200 util-linux-2.28.2-3-x86_64 * backport sec fix from git diff --git a/source/base/util-linux/CVE-2016-2779.patch b/source/base/util-linux/CVE-2016-2779.patch new file mode 100644 index 0000000..abe9dea --- /dev/null +++ b/source/base/util-linux/CVE-2016-2779.patch @@ -0,0 +1,120 @@ +From 8e4925016875c6a4f2ab4f833ba66f0fc57396a2 Mon Sep 17 00:00:00 2001 +From: Karel Zak <[email protected]> +Date: Thu, 29 Sep 2016 16:32:33 +0200 +Subject: su,runuser: add libseccomp based workaround for TIOCSTI ioctl + +This patch add libseccomp based syscalls filter to disable TIOCSTI +ioctl in su/runuser children. + +IMHO it is not elegant solution due to dependence on libseccomp +(--without-seccomp if hate it)... but there is nothing better for now. + +Addresses: CVE-2016-2779 +Signed-off-by: Karel Zak <[email protected]> +--- + configure.ac | 16 ++++++++++++++++ + login-utils/Makemodule.am | 7 ++++--- + login-utils/su-common.c | 20 ++++++++++++++++++++ + 3 files changed, 40 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 680f5b6..6346865 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1691,6 +1691,22 @@ AS_IF([test "x$with_user" != xno], [ + ]) + AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes]) + ++ ++AC_ARG_WITH([libseccomp], AS_HELP_STRING([--without-seccomp], [compile without libseccomp]), ++ [], [with_seccomp=check] ++) ++have_seccomp=no ++AS_IF([test "x$with_seccomp" != xno], [ ++ PKG_CHECK_MODULES(SECCOMP,[libseccomp], [have_seccomp=yes], [have_seccomp=no]) ++ AS_CASE([$with_seccomp:$have_seccomp], ++ [yes:no], ++ [AC_MSG_ERROR([seccomp selected but libseccomp not found])], ++ [*:yes], ++ [AC_DEFINE([HAVE_LIBSECCOMP], [1], [Define if libseccomp is available])] ++ ) ++]) ++ ++ + AC_ARG_ENABLE([chfn-chsh-password], + AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]), + [], [enable_chfn_chsh_password=yes] +diff --git a/login-utils/Makemodule.am b/login-utils/Makemodule.am +index be07ace..12f27e1 100644 +--- a/login-utils/Makemodule.am ++++ b/login-utils/Makemodule.am +@@ -140,9 +140,9 @@ su_SOURCES = \ + login-utils/su-common.h \ + login-utils/logindefs.c \ + login-utils/logindefs.h +-su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) ++su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) $(SECCOMP_CFLAGS) + su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) +-su_LDADD = $(LDADD) libcommon.la -lpam ++su_LDADD = $(LDADD) libcommon.la -lpam $(SECCOMP_LIBS) + if HAVE_LINUXPAM + su_LDADD += -lpam_misc + endif +@@ -158,7 +158,8 @@ runuser_SOURCES = \ + login-utils/su-common.h \ + login-utils/logindefs.c \ + login-utils/logindefs.h +-runuser_LDADD = $(LDADD) libcommon.la -lpam ++runuser_LDADD = $(LDADD) libcommon.la -lpam $(SECCOMP_LIBS) ++runuser_CFLAGS = $(AM_CFLAGS) $(SECCOMP_CFLAGS) + if HAVE_LINUXPAM + runuser_LDADD += -lpam_misc + endif +diff --git a/login-utils/su-common.c b/login-utils/su-common.c +index ff20a2f..5ab2a1a 100644 +--- a/login-utils/su-common.c ++++ b/login-utils/su-common.c +@@ -59,6 +59,9 @@ enum + #include <sys/wait.h> + #include <syslog.h> + #include <utmp.h> ++#ifdef HAVE_LIBSECCOMP ++# include <seccomp.h> ++#endif + + #include "err.h" + +@@ -674,6 +677,21 @@ restricted_shell (const char *shell) + return true; + } + ++static void disable_tty_hijack(void) ++{ ++#ifdef HAVE_LIBSECCOMP ++ scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_ALLOW); ++ if (!ctx) ++ err(EXIT_FAILURE, _("failed to initialize seccomp context")); ++ if (seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(ioctl), 1, ++ SCMP_A1(SCMP_CMP_EQ, (int)TIOCSTI)) < 0) ++ err(EXIT_FAILURE, _("failed to add seccomp rule")); ++ if (seccomp_load(ctx) < 0) ++ err(EXIT_FAILURE, _("failed to load seccomp rule")); ++ seccomp_release(ctx); ++#endif /* HAVE_LIBSECCOMP */ ++} ++ + static void __attribute__((__noreturn__)) + usage (int status) + { +@@ -970,6 +988,8 @@ su_main (int argc, char **argv, int mode) + change_identity (pw); + if (!same_session) + setsid (); ++ else ++ disable_tty_hijack(); + + /* Set environment after pam_open_session, which may put KRB5CCNAME + into the pam_env, etc. */ +-- +cgit v0.12 + diff --git a/source/base/util-linux/FrugalBuild b/source/base/util-linux/FrugalBuild index 43369e2..6e80ddc 100644 --- a/source/base/util-linux/FrugalBuild +++ b/source/base/util-linux/FrugalBuild @@ -4,7 +4,7 @@ pkgname=util-linux pkgver=2.28.2 -pkgrel=2 +pkgrel=3 pkgdesc="Miscellaneous system utilities for Linux" url="http://www.kernel.org/pub/linux/utils/util-linux/" backup=('etc/sysconfig/numlock') @@ -17,11 +17,12 @@ up2date="lynx -dump http://git.kernel.org/cgit/utils/util-linux/util-linux.git/r # see bzr for more description on ${pkgver%%.?} source=($url/v${pkgver%%.?}/util-linux-$pkgver.tar.xz \ frugalwaregetty numlock \ - README.Frugalware) + README.Frugalware CVE-2016-2779.patch) sha1sums=('76053b05a6c8bf3f6fcbef8679cfaa01135bf67f' \ '29c664063cce384e855f9af93df9ea71b88f0742' \ 'cf32c54ca7f4ca3b7a91ebe309f114ed4d296a09' \ - '9c85fa0556553a6982d0db66e24298fe95e1dd20') + '9c85fa0556553a6982d0db66e24298fe95e1dd20' \ + 'a75ec4c911dddbd77418e0ab2c36d6a044e55d28') Finclude python replaces=('eject') _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
