From: Pádraig Brady
Date: Wed, 30 Aug 2017 07:27:41 +0000 (-0700)
Subject: runcon: revert "disable use of the TIOCSTI ioctl"
X-Git-Tag: v8.28~10
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5d7c0842ef7adc2be6e85f9ef66b35ebbbd6a61;p=thirdparty%2Fcoreutils.git
runcon: revert "disable use of the TIOCSTI ioctl"
This reverts commit v8.27-97-g8cb06d4 because
the setsid() fallback was not implemented correctly
and disabling the ioctl was not a complete solution
to the security issue of the child being passed
the tty of the parent.
Given runcon is not really a sandbox command,
the advice is to use `runcon ... setsid ...`
to avoid this particular issue.
---
diff --git a/NEWS b/NEWS
index cc4a56e82d..b7ba1d5007 100644
--- a/NEWS
+++ b/NEWS
@@ -72,10 +72,6 @@ GNU coreutils NEWS -*- outline -*-
non regular files are specified, as inotify is ineffective with these.
[bug introduced with inotify support added in coreutils-7.5]
- runcon now disables use of the TIOCSTI ioctl in its children, which could
- be used to inject commands to the terminal and run at the original context.
- [the issue dates back to the initial implementation]
-
uptime no longer outputs the AM/PM component of the current time,
as that's inconsistent with the 24 hour time format used.
[bug introduced in coreutils-7.0]
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index de0657b826..ef915bd378 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -63,19 +63,6 @@ AC_DEFUN([coreutils_MACROS],
esac
fi
])
-
- # Used by runcon.c
- LIB_SECCOMP=
- AC_SUBST([LIB_SECCOMP])
- if test "$with_selinux" != no; then
- AC_SEARCH_LIBS([seccomp_init], [seccomp],
- [test "$ac_cv_search_seccomp_init" = "none required" ||
- LIB_SECCOMP=$ac_cv_search_seccomp_init
- AC_DEFINE([HAVE_SECCOMP], [1], [libseccomp usability])],
- [test "$ac_cv_header_selinux_selinux_h" = yes &&
- AC_MSG_WARN([libseccomp library was not found or not usable])
- AC_MSG_WARN([runcon will be vulnerable to tty injection])])
- fi
LIBS=$coreutils_saved_libs
# Used by sort.c.
diff --git a/src/local.mk b/src/local.mk
index 9275b1f2ee..1cb685906c 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -243,7 +243,6 @@ src_mkfifo_LDADD += $(LIB_SMACK)
src_mknod_LDADD += $(LIB_SELINUX)
src_mknod_LDADD += $(LIB_SMACK)
src_runcon_LDADD += $(LIB_SELINUX)
-src_runcon_LDADD += $(LIB_SECCOMP)
src_stat_LDADD += $(LIB_SELINUX)
# for nvlist_lookup_uint64_array
diff --git a/src/runcon.c b/src/runcon.c
index 611b788876..92f519df8a 100644
--- a/src/runcon.c
+++ b/src/runcon.c
@@ -45,10 +45,6 @@
#include