Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3836174ybt; Sun, 5 Jul 2020 08:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRIyKiZ3f4GjW0L+Y7xw/n2i1R+zvZSx0xm9S5Oz05YylSwA1zwL0ma/XLQwBgjPHVo2+r X-Received: by 2002:a17:907:395:: with SMTP id ss21mr39636771ejb.181.1593962001510; Sun, 05 Jul 2020 08:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593962001; cv=none; d=google.com; s=arc-20160816; b=e5jdUcwtakmKe7KbOufWnXAAOQ+yNbWtsjlhYbUTq/jo09DmkaVqrHRpL+gNbqLqKe IDLyrDk+TkPTyTwPadxhb/68EyGbWdfiHcVLaUkyQX/FYa+lKqxqoo2f42OsST867FWQ NODFsjKpUQQ0i9VkO+84b6mIKknT0kSPpFOrMSSQFIGUkzBSoQ5DeMazPSoUi8F+1pgv hjpXtoiyXpHJhT7SLp3GPOgjrWYmicNQCfYItr56WNQ3jMhqSJWNkq+5k78e9wTeCMrm cVXXXsD3zGkpXUb9BQo0EizRS1UiG7akybSAurCk8qO/3B/C5iuEnCsfG8qfWwTSIxx3 pvtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BI1aAShmO7FXnwtN8B6Od+9nVsaMtVkeWnOGj2Zvm4Y=; b=hQOgl2BO1VwIethDX37vrcP8dqNFUFQbFRL6y1BOW+m7bzZkuAju5kBC4HOINciaZU k7VRA00bEwQ5XKj2iEc9kQmEIrFcSGR9zequywTLTXp2NBE0fTcDEOIgTq1AepQxxhgA rpWW+jVlJtX35x4S4/mmLbOSxnygR3Z4TkDy7oAXbqy0B8v0CcOJImsTYtypRaAFXBlh G8DQ0ov0wKLCedUehOlZ2a0a/RegHxCXaPk75lTVfAGfsrAi+rLoINutQQwp6CgabLZ5 tGF9wDB8rBonFgcq19XGkTcEiI/O8OW2RNLp6sUjgfv/ZEf43vxuk0KuX24Bg3kKJGF0 kfLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="1/6AOOiC"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si8561286ejg.253.2020.07.05.08.12.58; Sun, 05 Jul 2020 08:13:21 -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; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="1/6AOOiC"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbgGEPMC (ORCPT + 99 others); Sun, 5 Jul 2020 11:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727091AbgGEPMA (ORCPT ); Sun, 5 Jul 2020 11:12:00 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49580C061794 for ; Sun, 5 Jul 2020 08:12:00 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id ga4so39706821ejb.11 for ; Sun, 05 Jul 2020 08:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BI1aAShmO7FXnwtN8B6Od+9nVsaMtVkeWnOGj2Zvm4Y=; b=1/6AOOiCg9ot1+F9UhkykucC0qMYgzK2GA9zYzKmMovooAnH48coFkCRo57BXWCcAp 7CF9ClAVqv7j/oaBJkTGbl26Rszr/MUIfDjdNl7f5JnJxKj2yn0TKisOxrCwtEbFgNGQ /PqTAREqKfODffSK5H0TJGvTykPpy5976yQ7kuXJRMMseZOA5Ew/izF5q5DOEnUEoRD4 ESr2tMdE8VI3TJe1XP8JUoKk5p9bUKtecSGxZUYV+q3k6YAqd72YHNOSHy2+GpdRqEFx dcvTHlVfR+822lyGWe9L3viPVcELzcQa2U96GrkmRWDqUDYx+kBFP2kg/4CFOsa4vnMk aSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BI1aAShmO7FXnwtN8B6Od+9nVsaMtVkeWnOGj2Zvm4Y=; b=SulPc8eKxkLg4OCTl9P/ZFY0Ds+ttvPXXHUur5Kv78jsog6RZ5COiO9XglZzNFb7H6 5ISCcV7srVoMXtR2rk0LMzN52OvXBZiDQfOEZBlhUAhmjFs+KUaaBgKefz64mPlx7yeL OnclJdHf/juNiNOZbPXcN/DpUAir3j7eCRyK6qAlW6YkGpmujmSM6DQjLEHOf9nQFV/h 4395uMQUMg5lIM8Lgtmz+zoPpK83OpnMeKZMMWig2HFhJbrxAoIuBYPLXwpoPS24fTZ2 bddYP7V2iW7rmZtJMHzBaymvStc5xW0BXty5UnDFfECE8/po4aYjOrvIhJ2XgpDUhVlK 8Zjw== X-Gm-Message-State: AOAM530Hz9/h74oR0AcLiz1VBmVcz5wvoNmFQiyd8rvydAD1nNhWtk5n DuMOWcAiuKxnGOzS7+dor04FXeHgjvPgRLlCXCKn X-Received: by 2002:a17:906:1a59:: with SMTP id j25mr37962178ejf.398.1593961918982; Sun, 05 Jul 2020 08:11:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Sun, 5 Jul 2020 11:11:47 -0400 Message-ID: Subject: Re: [PATCH ghak90 V9 13/13] audit: add capcontid to set contid outside init_user_ns To: Richard Guy Briggs Cc: containers@lists.linux-foundation.org, linux-api@vger.kernel.org, Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, LKML , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, sgrubb@redhat.com, Ondrej Mosnacek , dhowells@redhat.com, simo@redhat.com, Eric Paris , Serge Hallyn , ebiederm@xmission.com, nhorman@tuxdriver.com, Dan Walsh , mpatel@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 27, 2020 at 9:24 AM Richard Guy Briggs wrote: > > Provide a mechanism similar to CAP_AUDIT_CONTROL to explicitly give a > process in a non-init user namespace the capability to set audit > container identifiers of individual children. > > Provide the /proc/$PID/audit_capcontid interface to capcontid. > Valid values are: 1==enabled, 0==disabled > > Writing a "1" to this special file for the target process $PID will > enable the target process to set audit container identifiers of its > descendants. > > A process must already have CAP_AUDIT_CONTROL in the initial user > namespace or have had audit_capcontid enabled by a previous use of this > feature by its parent on this process in order to be able to enable it > for another process. The target process must be a descendant of the > calling process. > > Report this action in new message type AUDIT_SET_CAPCONTID 1022 with > fields opid= capcontid= old-capcontid= > > Signed-off-by: Richard Guy Briggs > --- > fs/proc/base.c | 57 +++++++++++++++++++++++++++++++++++++++++++++- > include/linux/audit.h | 14 ++++++++++++ > include/uapi/linux/audit.h | 1 + > kernel/audit.c | 38 ++++++++++++++++++++++++++++++- > 4 files changed, 108 insertions(+), 2 deletions(-) This seems very similar to the capable/ns_capable combination I mentioned in patch 11/13; any reasons why you feel that this might be a better approach? My current thinking is that the capable/ns_capable approach is preferable as it leverages existing kernel mechanisms and doesn't require us to reinvent the wheel in the audit subsystem. -- paul moore www.paul-moore.com