Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1280393

Re: user controllable usermodehelper in br_stp_if.c

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: user controllable usermodehelper in br_stp_if.c
Date 2015-12-01 00:10 +0100
Message-ID <qAFK1-1An-11@gated-at.bofh.it> (permalink)
References <qAiX7-3AN-9@gated-at.bofh.it> <qAD5v-8hq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am 30.11.2015 um 21:14 schrieb Kees Cook:
> On Sun, Nov 29, 2015 at 2:43 PM, Richard Weinberger <richard@nod.at> wrote:
>> Hi!
>>
>> By spawning new network and user namesapces an unprivileged user
>> is able to execute /sbin/bridge-stp within the initial mount namespace
>> with global root rights.
>> While this cannot directly be used to break out of a container or gain
>> global root rights it could be used by exploit writers as valuable building block.
>>
>> e.g.
>> $ unshare -U -r -n /bin/sh
>> $ brctl addbr br0
>> $ brctl stp br0 on # this will execute /sbin/bridge-stp
>>
>> As this mechanism clearly cannot work with containers and seems to be legacy code
>> I suggest not calling call_usermodehelper() at all if we're not in the initial user namespace.
>> What do you think?
> 
> I'm not familiar with how bridge-stp is expected to operate with a
> network namespace, but if it's meaningless, then yeah, that seems like
> a reasonable change. Can you send a patch? (Also, if it's legacy code,
> maybe it could be turned off entirely, not just for containers?)

Eric was faster than me. :-)

BTW: kernel.core_pattern is also worth a look.
If the pipe mode is used, "|/bin/core_tool", it will be executed in the
initial namespace and any user/container can trigger it.
Shayan reported that some weeks ago: https://lkml.org/lkml/2015/10/24/134

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

user controllable usermodehelper in br_stp_if.c Richard Weinberger <richard@nod.at> - 2015-11-29 23:50 +0100
  Re: user controllable usermodehelper in br_stp_if.c Kees Cook <keescook@chromium.org> - 2015-11-30 21:20 +0100
    [PATCH net] bridge: Only call /sbin/bridge-stp for the initial network namespace ebiederm@xmission.com (Eric W. Biederman) - 2015-11-30 23:00 +0100
      Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial  network namespace Stephen Hemminger <stephen@networkplumber.org> - 2015-11-30 23:20 +0100
        Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial network namespace ebiederm@xmission.com (Eric W. Biederman) - 2015-11-30 23:30 +0100
      Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial  network namespace Richard Weinberger <richard@nod.at> - 2015-12-01 00:00 +0100
      Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial  network namespace Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-12-01 15:20 +0100
      Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial  network namespace David Miller <davem@davemloft.net> - 2015-12-03 06:00 +0100
        Re: [PATCH net] bridge: Only call /sbin/bridge-stp for the initial  network namespace Kees Cook <keescook@chromium.org> - 2015-12-08 22:00 +0100
    Re: user controllable usermodehelper in br_stp_if.c Richard Weinberger <richard@nod.at> - 2015-12-01 00:10 +0100

csiph-web