Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1638505ybs; Mon, 25 May 2020 23:11:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf3QPY6kndknW0hOSfgt5PwT7k4am3wCpaM9PfrLaDqVcN+UUgTWFvhPtH5AYNXXWF7R6z X-Received: by 2002:a17:907:9495:: with SMTP id dm21mr458930ejc.357.1590473518469; Mon, 25 May 2020 23:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590473518; cv=none; d=google.com; s=arc-20160816; b=csfVh5LazEuLG3bxibf5PLJm1A02XjLs4jSyFR1w2dh+pXW7OXs09WPecmx6f0Rsth 2Ua+Dh05tUwzq7vsy/kM7OVpXw4sJymRelL4zTdUhTrvVqQXgWHVkTYKXcxxsFLUxcHv QFFPZmwLIAT5RaIjA3YDAnV6pr65JGEfMS6ScnJUMZjhNg0yJq88olBvAd2aQD2vc8Ic 7YmueifhDxKOCrsWix3hQT2zx1kpkGeQKGNRIdbgnk8kB/9mPSKsI5rB+slFZjtfcmpj xxBKlf07KMZVrEhSFACa/z6GSauSiPUNWFMMJB9f2CkD2XhTZNQ5v8t+bl7I5E/74BlB 7Bfw== 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=V5YTh51mOSkEuxU21BvSuS/w+t0LyTN4bdZGeF4brQo=; b=Rnb4wybmB0/vVH7nOK0B58NrMJlCXc3HpJwcgajBZIZWKIJfHniRrfNqbKWH2ab+qH OekHYJmjpxRD1tTBfcHyBvWeiKxK/dHpXqviDUZbjFReFA9u6GvAiAdsybHgLgpFAx8I bC78nVHPGJZri6+bPaJwv60K7rlnYPzoOva9uZPshI2NzVDj1pUaYnrdrEFQ2rJaGvnu maYPMgh1RRFwtAxANg+yiWlHpkHjsJUpfQKNkYldcd+DstYO/m5P1ePpuzFeWwFay2oi ndfFa3CoC0ASOSe3PEDUWTlZVfEULDwDBGoaNDZ+VJEvsU/+jF5EE/pIwzLjFJ9o/nrV 8wlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b="fWV/9lzt"; 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 h24si10591841ejb.719.2020.05.25.23.11.35; Mon, 25 May 2020 23:11:58 -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=@sargun.me header.s=google header.b="fWV/9lzt"; 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 S1726363AbgEZGI5 (ORCPT + 99 others); Tue, 26 May 2020 02:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbgEZGI5 (ORCPT ); Tue, 26 May 2020 02:08:57 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10EA2C061A0E for ; Mon, 25 May 2020 23:08:57 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id bs4so16634843edb.6 for ; Mon, 25 May 2020 23:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V5YTh51mOSkEuxU21BvSuS/w+t0LyTN4bdZGeF4brQo=; b=fWV/9lztW7nmFrKNP0PJ4RtoJAO6nrDX3GUlHhH4zIRcu804CcMll+BcR/TH+zTrIi VbimfFrLLAZRbnIDe4AovAH/2WLLd6lnUM9Mmhm0hZjDtq/EUCKd36hg6LZq+np9n/oj PIaajG/lFoLSUHfjAO5tASEwXekSEHmOnEB94= 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=V5YTh51mOSkEuxU21BvSuS/w+t0LyTN4bdZGeF4brQo=; b=UwiDd00w4nwt1OtWOlwiRqmR8g+n2+bGEji4+I9fjkEr5isJ/jJoPdUOz59GNgWwNJ tVMVfWAZO70ZbFqLrHe4MZ1hQuzh87e/yZ7fEtxDuMBOiT0W/7b4T3mrfP8ywogzSFZZ nXkirvQ0qhIC1pQihKfKUJV3cac2bmmUzcVh86QOJ6fWV224BNZ/4TqwdMMsLJssCNEv gtYK9JL5vEo430pbJbtoP8ifikfch0mnr906Z2pId/zXPd75xikf93tlW2xd4YgdzUG+ 09smnPcs+ECdQGF3DzeMZEPKVd9Hs6Dv7RDXUDVpBAbAd0o2OVjA/hZoOgaTCuSyGarF VMtQ== X-Gm-Message-State: AOAM532oxC2T6mJ8GCZySbcoT1Ab9NaGYQElW/0SQfix9JHnPzdk47Y0 z5qKA1+q6eQD1mcTXgRcrbpaArM1eEmLIy/2FVqDLg== X-Received: by 2002:a05:6402:b38:: with SMTP id bo24mr18800566edb.24.1590473335434; Mon, 25 May 2020 23:08:55 -0700 (PDT) MIME-Version: 1.0 References: <20200524233942.8702-1-sargun@sargun.me> <20200524233942.8702-5-sargun@sargun.me> <20200525142043.jkdsfabntqusizxz@wittgenstein> In-Reply-To: <20200525142043.jkdsfabntqusizxz@wittgenstein> From: Sargun Dhillon Date: Mon, 25 May 2020 23:08:19 -0700 Message-ID: Subject: Re: [PATCH 4/5] seccomp: Add SECCOMP_ADDFD_FLAG_MOVE flag to add fd ioctl To: Christian Brauner Cc: LKML , Linux Containers , Linux API , Tycho Andersen , Kees Cook , Aleksa Sarai , Jeffrey Vander Stoep , Jann Horn , Robert Sesek , Chris Palmer , Matt Denton , Kees Cook 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 > > + * they are created in. Specifcally, sockets, and their interactions with the > > + * net_cls and net_prio cgroup v1 controllers. This "moves" the file descriptor > > + * so that it takes on the cgroup controller's configuration in the process > > + * that the file descriptor is being added to. > > + */ > > +#define SECCOMP_ADDFD_FLAG_MOVE (1UL << 1) > > I'm not happy about the name because "moving" has much more to do with > transferring ownership than what we are doing here. After a "move" the > fd shouldn't be valid anymore. But that might just be my thinking. > > But why make this opt-in and not do it exactly like when you send around > fds and make this mandatory? Based upon Tycho's comments in an offline thread, I'm going to make this the default (setting the cgroup metadata) to mirror what SCM_RIGHTS does, and then if we come up with a good use case where we need to preserve *cgroup v1* metadata, then we can add an opt-out flag in the future.