Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1401433pxj; Fri, 21 May 2021 13:21:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7EzCDxnOBZdOss2txnwR7EKsnSBrWXu/0R9k6Z9Am+/Fc1BfZ+tFM/FqMKKTxbkWCCq6Y X-Received: by 2002:a92:6b05:: with SMTP id g5mr671889ilc.40.1621628483706; Fri, 21 May 2021 13:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628483; cv=none; d=google.com; s=arc-20160816; b=ZBrX9vNR4baL3QaxqQkru4lBM6bZ1FxRXlunfEy3GQPA1hPdUIpqSc9B3dA668/3OR +Cp1AoLPusjLyfCXcjzLAy0f0KyISbqqoUAVLu2fV2R/9xSywL1clQPdLs4LSx9y1rC+ XwPkXjajZ1t8kQZe+skC8SYHxHEDNuw0X/eZjXJ7MFkGLjBJ4FkGChgrq8mvPOLcMcTU QrfWLrEadlS7QVxf61hi3REuQdkEZWIkJY46G07NvySaRZZo/DbNcNdF7GlljOeHOhWl 2vFF/D4RIaphKE1KcR1KW9/eLxmpXeMvEV5LNhTcjhA8sSYE+dxszdleIM1dXa+xxnG5 XjpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=F+semhQe3EX6yo8zHrsGrDyv+zQcSOw3h4RJrpO65RA=; b=oZ47lp4AHJa1NqNVSsLUzc/xZoCLUHAVTYWsKzIHned+CNsKv3VFux+XKZT7JihLTL YALL+b2JsoWksPaG91OmJ6nH8/ec5zDuOMZpgXYojU5M1YmBArgYr3GJtTZSd6cucimF mPm9+jmrhApGMnpm/F6asHcUbFR7WxGXzjpLWdzqaRmIqCMkFpmffePZoWIrtrPVlVzB nWaI93S1rRVMbKatOeb4Xqe5ObLZFArzDgNqaR4inAHOebsouwbTLad8lZjLA9aCQRmC 3XFT4zp2Huc0IfWz6UriXISOcLgBcTLFRyE4wch5/GA1Wy0C37EOEMZWOTDgKliLDHQE T93w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si6347133ilq.89.2021.05.21.13.21.11; Fri, 21 May 2021 13:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237369AbhEUPS2 (ORCPT + 99 others); Fri, 21 May 2021 11:18:28 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:40018 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234282AbhEUPS0 (ORCPT ); Fri, 21 May 2021 11:18:26 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lk6tY-009KEL-Ry; Fri, 21 May 2021 09:17:01 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lk6tX-00ATj1-Is; Fri, 21 May 2021 09:17:00 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Giuseppe Scrivano Cc: linux-kernel@vger.kernel.org, serge@hallyn.com, dwalsh@redhat.com, christian.brauner@ubuntu.com References: <20210510130011.1441834-1-gscrivan@redhat.com> Date: Fri, 21 May 2021 10:16:43 -0500 In-Reply-To: <20210510130011.1441834-1-gscrivan@redhat.com> (Giuseppe Scrivano's message of "Mon, 10 May 2021 15:00:08 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lk6tX-00ATj1-Is;;;mid=;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19X8ggA/aTj4cVjjFgZ0y+UV091oOEgFb0= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,XMNoVowels, XMSubLong,XM_B_SpammyWords autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4900] * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 XM_B_SpammyWords One or more commonly used spammy words * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Giuseppe Scrivano X-Spam-Relay-Country: X-Spam-Timing: total 695 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 10 (1.5%), b_tie_ro: 9 (1.2%), parse: 0.98 (0.1%), extract_message_metadata: 3.8 (0.5%), get_uri_detail_list: 1.50 (0.2%), tests_pri_-1000: 6 (0.8%), tests_pri_-950: 1.27 (0.2%), tests_pri_-900: 1.10 (0.2%), tests_pri_-90: 102 (14.7%), check_bayes: 99 (14.3%), b_tokenize: 11 (1.6%), b_tok_get_all: 8 (1.2%), b_comp_prob: 4.1 (0.6%), b_tok_touch_all: 60 (8.7%), b_finish: 12 (1.8%), tests_pri_0: 530 (76.3%), check_dkim_signature: 0.61 (0.1%), check_dkim_adsp: 3.7 (0.5%), poll_dns_idle: 1.09 (0.2%), tests_pri_10: 4.3 (0.6%), tests_pri_500: 27 (3.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC PATCH 0/3] new mode 'shadow' for /proc/PID/setgroups X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Giuseppe Scrivano writes: > This series is based on some old patches I've been playing with some > years ago, but they were never sent to lkml as I was not sure about > their complexity/usefulness ratio. It was recently reported by > another user that these patches are still useful[1] so I am submitting > the last version and see what other folks think about this feature. > > Since the fix for CVE-2014-8989 in order to set a gids mapping for a > user namespace when the user namespace owner doesn't have CAP_SETGID > in its parent, it is necessary to first disable setgroups(2) through > /proc/PID/setgroups. > > Setting up a user namespace with multiple IDs mapped into is usually > done through the privileged helpers newuidmap/newgidmap. > Since these helpers run either as setuid or with CAP_SET[U,G]ID file > capabilities, it is not necessary to disable setgroups(2) in the > created user namespace. The user running in the user namespace can > use setgroups(2) and drop the additional groups that it had initially. > > This is still an issue on systems where negative groups ACLs, i.e. the > group permissions are more restrictive than the entry for the other > categories, are used. With such configuration, allowing setgroups(2) > would cause the same security vulnerability described by > CVE-2014-8989. Do you have any experience or any documentation about systems that are using groups to deny access? There are some deployments somewhere, but last I looked they were rare enough that the intersection between systems using groups to deny access and systems deploying containers could reasonably be assumed to be the empty set? Before we seriously consider merging a change like this I believe we need some references to actual deployed systems. As adding a feature that is designed around a premise of a security model that people are not using will likely lead to poor testing, poor review and not enough feedback to get the rough edges off. I suspect systems need to preserve some set of groups released from the restriction of needing to preserve negative groups could result in a very different result. Eric