1. 02 3月, 2017 2 次提交
  2. 28 2月, 2017 1 次提交
  3. 25 2月, 2017 1 次提交
  4. 10 2月, 2017 2 次提交
  5. 08 2月, 2017 3 次提交
    • S
      selinux: fix off-by-one in setprocattr · 0c461cb7
      Stephen Smalley 提交于
      SELinux tries to support setting/clearing of /proc/pid/attr attributes
      from the shell by ignoring terminating newlines and treating an
      attribute value that begins with a NUL or newline as an attempt to
      clear the attribute.  However, the test for clearing attributes has
      always been wrong; it has an off-by-one error, and this could further
      lead to reading past the end of the allocated buffer since commit
      bb646cdb ("proc_pid_attr_write():
      switch to memdup_user()").  Fix the off-by-one error.
      
      Even with this fix, setting and clearing /proc/pid/attr attributes
      from the shell is not straightforward since the interface does not
      support multiple write() calls (so shells that write the value and
      newline separately will set and then immediately clear the attribute,
      requiring use of echo -n to set the attribute), whereas trying to use
      echo -n "" to clear the attribute causes the shell to skip the
      write() call altogether since POSIX says that a zero-length write
      causes no side effects. Thus, one must use echo -n to set and echo
      without -n to clear, as in the following example:
      $ echo -n unconfined_u:object_r:user_home_t:s0 > /proc/$$/attr/fscreate
      $ cat /proc/$$/attr/fscreate
      unconfined_u:object_r:user_home_t:s0
      $ echo "" > /proc/$$/attr/fscreate
      $ cat /proc/$$/attr/fscreate
      
      Note the use of /proc/$$ rather than /proc/self, as otherwise
      the cat command will read its own attribute value, not that of the shell.
      
      There are no users of this facility to my knowledge; possibly we
      should just get rid of it.
      
      UPDATE: Upon further investigation it appears that a local process
      with the process:setfscreate permission can cause a kernel panic as a
      result of this bug.  This patch fixes CVE-2017-2618.
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      [PM: added the update about CVE-2017-2618 to the commit description]
      Cc: stable@vger.kernel.org # 3.5: d6ea83ecSigned-off-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      0c461cb7
    • A
      selinux: allow changing labels for cgroupfs · 1ea0ce40
      Antonio Murdaca 提交于
      This patch allows changing labels for cgroup mounts. Previously, running
      chcon on cgroupfs would throw an "Operation not supported". This patch
      specifically whitelist cgroupfs.
      
      The patch could also allow containers to write only to the systemd cgroup
      for instance, while the other cgroups are kept with cgroup_t label.
      Signed-off-by: NAntonio Murdaca <runcom@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      1ea0ce40
    • S
      selinux: fix off-by-one in setprocattr · a050a570
      Stephen Smalley 提交于
      SELinux tries to support setting/clearing of /proc/pid/attr attributes
      from the shell by ignoring terminating newlines and treating an
      attribute value that begins with a NUL or newline as an attempt to
      clear the attribute.  However, the test for clearing attributes has
      always been wrong; it has an off-by-one error, and this could further
      lead to reading past the end of the allocated buffer since commit
      bb646cdb ("proc_pid_attr_write():
      switch to memdup_user()").  Fix the off-by-one error.
      
      Even with this fix, setting and clearing /proc/pid/attr attributes
      from the shell is not straightforward since the interface does not
      support multiple write() calls (so shells that write the value and
      newline separately will set and then immediately clear the attribute,
      requiring use of echo -n to set the attribute), whereas trying to use
      echo -n "" to clear the attribute causes the shell to skip the
      write() call altogether since POSIX says that a zero-length write
      causes no side effects. Thus, one must use echo -n to set and echo
      without -n to clear, as in the following example:
      $ echo -n unconfined_u:object_r:user_home_t:s0 > /proc/$$/attr/fscreate
      $ cat /proc/$$/attr/fscreate
      unconfined_u:object_r:user_home_t:s0
      $ echo "" > /proc/$$/attr/fscreate
      $ cat /proc/$$/attr/fscreate
      
      Note the use of /proc/$$ rather than /proc/self, as otherwise
      the cat command will read its own attribute value, not that of the shell.
      
      There are no users of this facility to my knowledge; possibly we
      should just get rid of it.
      
      UPDATE: Upon further investigation it appears that a local process
      with the process:setfscreate permission can cause a kernel panic as a
      result of this bug.  This patch fixes CVE-2017-2618.
      Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov>
      [PM: added the update about CVE-2017-2618 to the commit description]
      Cc: stable@vger.kernel.org # 3.5: d6ea83ecSigned-off-by: NPaul Moore <paul@paul-moore.com>
      a050a570
  6. 28 1月, 2017 2 次提交
  7. 25 1月, 2017 1 次提交
    • K
      Introduce a sysctl that modifies the value of PROT_SOCK. · 4548b683
      Krister Johansen 提交于
      Add net.ipv4.ip_unprivileged_port_start, which is a per namespace sysctl
      that denotes the first unprivileged inet port in the namespace.  To
      disable all privileged ports set this to zero.  It also checks for
      overlap with the local port range.  The privileged and local range may
      not overlap.
      
      The use case for this change is to allow containerized processes to bind
      to priviliged ports, but prevent them from ever being allowed to modify
      their container's network configuration.  The latter is accomplished by
      ensuring that the network namespace is not a child of the user
      namespace.  This modification was needed to allow the container manager
      to disable a namespace's priviliged port restrictions without exposing
      control of the network namespace to processes in the user namespace.
      Signed-off-by: NKrister Johansen <kjlx@templeofstupid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4548b683
  8. 24 1月, 2017 3 次提交
  9. 19 1月, 2017 3 次提交
    • G
      Introduce STATIC_USERMODEHELPER to mediate call_usermodehelper() · 64e90a8a
      Greg Kroah-Hartman 提交于
      Some usermode helper applications are defined at kernel build time, while
      others can be changed at runtime.  To provide a sane way to filter these, add a
      new kernel option "STATIC_USERMODEHELPER".  This option routes all
      call_usermodehelper() calls through this binary, no matter what the caller
      wishes to have called.
      
      The new binary (by default set to /sbin/usermode-helper, but can be changed
      through the STATIC_USERMODEHELPER_PATH option) can properly filter the
      requested programs to be run by the kernel by looking at the first argument
      that is passed to it.  All other options should then be passed onto the proper
      program if so desired.
      
      To disable all call_usermodehelper() calls by the kernel, set
      STATIC_USERMODEHELPER_PATH to an empty string.
      
      Thanks to Neil Brown for the idea of this feature.
      
      Cc: NeilBrown <neilb@suse.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64e90a8a
    • G
      Make static usermode helper binaries constant · 377e7a27
      Greg Kroah-Hartman 提交于
      There are a number of usermode helper binaries that are "hard coded" in
      the kernel today, so mark them as "const" to make it harder for someone
      to change where the variables point to.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Alex Elder <elder@kernel.org>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      377e7a27
    • C
      LSM: Add /sys/kernel/security/lsm · d69dece5
      Casey Schaufler 提交于
      I am still tired of having to find indirect ways to determine
      what security modules are active on a system. I have added
      /sys/kernel/security/lsm, which contains a comma separated
      list of the active security modules. No more groping around
      in /proc/filesystems or other clever hacks.
      
      Unchanged from previous versions except for being updated
      to the latest security next branch.
      Signed-off-by: NCasey Schaufler <casey@schaufler-ca.com>
      Acked-by: NJohn Johansen <john.johansen@canonical.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      d69dece5
  10. 17 1月, 2017 1 次提交
  11. 16 1月, 2017 21 次提交