Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp87343lqd; Tue, 23 Apr 2024 15:59:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTh0V73y2oohRfItiLp1w6S1wH17gB8/5a5CiVvbt5fVOmHRR6WkFOWZ8NfLSJxh0ji3AaXQd1eOeNfyi+zLJeyNhgCNeUuqOgvY8vaw== X-Google-Smtp-Source: AGHT+IFG/EQJzBYB6bTq18f5kkIYuNWZADbCggygaiOPC5bhlA3mmSTjSjuqIXspwDx4ajg2VsPi X-Received: by 2002:a05:620a:4508:b0:78d:7368:4152 with SMTP id t8-20020a05620a450800b0078d73684152mr7303295qkp.38.1713913172925; Tue, 23 Apr 2024 15:59:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713913172; cv=pass; d=google.com; s=arc-20160816; b=C1Bc2QxK25aXsG2PwdYuIiLVrn8wW9ZIxskKKuLcnmINWZ4IT3d5n/XVyz3y+DOwBv Ml5+O27tn/wk9rIIlmO5NJOe5utV09xZq/gh1K/5DDeAiBW/mQ5eUCUOA5KDb4r/cBOy ZBfo4HcU5k9ARG3/6I6JolNuF9HxgDlLdA0o3BM51d9uzTgYHsqfiK6aEVN6+gclQtit kXshOUTaVeBeNszBQEiWqHKbzys327Lt+gEy+Jk6L+oWCLQEcCMbF8wjJ76jxw6RrkT8 I1B5LCAvwTV5BU1xKDFC0Fp9ccFuqMARrRIK5d0UZHwILaP9n/WLKhKjEZeJUB88Okv6 ci9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=dSFGkrbMp3MN5zZhL4zbEW6tvfQBxICR8WWedgCEtgA=; fh=MtVUqMiLpmisccL4qgHJleREF/e2QqxbM6CkxtZYcRg=; b=mQDaHBCE4EdJ1xqLbTdidxQ/sJwuaOibKoJiYv3DzkS5HBTRpMhKaR2IB/MpPaOwR0 2aMUohv0KkWse+1hXFNFNkoy8XMQSCT5Zdg85gFHcIuc39/OAC6q8NIstj13tDon8W8C gJgNNrBCh7UZxjLC94mzjClxKoNyZcoCEdUiKwkyrkUv1ZH7p2s4IXz6vN3BlJIwKZE4 QkuxHcm7zrdv8f2Z+KOgd5VHyTcQS8JxIExDPmoyxrhrcSro6nUk0CRmKI6sP93X2Iu7 9OcNUqzQ3mDoD/OPp1xk3uSTIYGloTJDIZgrBJl7cMIHIJdHuHaNpADVh4C9kelvYy+H lixA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=HgKLZ9dd; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-kernel+bounces-155982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qs22-20020a05620a395600b0078d4a6553a7si11419789qkn.268.2024.04.23.15.59.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 15:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=HgKLZ9dd; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-kernel+bounces-155982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9FF3A1C22CC4 for ; Tue, 23 Apr 2024 22:59:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D648E36134; Tue, 23 Apr 2024 22:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="HgKLZ9dd" Received: from forward502c.mail.yandex.net (forward502c.mail.yandex.net [178.154.239.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 956602E62F; Tue, 23 Apr 2024 22:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.210 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713913164; cv=none; b=X3uomWWYYWu86B1cNCHSPm7FDJodMtebJJQzYPfz0N1aeGbVO3A6atxU/0r7LeprEmYqG0ww/JhlFUdDQAggvQmZpU1a1bIT/+k/tpZ3VumISsrDd1P5KBmjD8axFrZ5qlyAEXe+mGD2ZqIcZF5RbaHKAhH+Kqbtk0YC62GSSZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713913164; c=relaxed/simple; bh=DhW+flUhzLchgxh0ybt4z6c9Y5DfRjQUnP8fxX0ABo8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bW+m1IebjsUnmaoyWkC4/+NgxatO7sCmPj3e5hXdFu/rA9aX9tJpqAUlTyMkfX0fkICntehoH+udU0Mfhseu6hoLhr52qzoh/nL4okLJYR7NLYIcD5rcznUbxv7FLuKeoukWEjYT1YnACxIMBeQxWEBLNGkD21xTVKKgv4vDQUE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru; spf=pass smtp.mailfrom=yandex.ru; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b=HgKLZ9dd; arc=none smtp.client-ip=178.154.239.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yandex.ru Received: from mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5b8b:0:640:df05:0]) by forward502c.mail.yandex.net (Yandex) with ESMTPS id 39B6861308; Wed, 24 Apr 2024 01:59:14 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id CxTYgsOoBiE0-MoiKJb1W; Wed, 24 Apr 2024 01:59:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1713913153; bh=dSFGkrbMp3MN5zZhL4zbEW6tvfQBxICR8WWedgCEtgA=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=HgKLZ9ddzAkgMSxnE1R7ILGyuE/XJ1feN2MgTxwdHNarRlzYcmd/EmsxZzZoXa+LM CpCmTu/+hRkolEr8wus/8kFsC2IxcYrftouh8N6MlePYLLGaZyk155SFk0HE7k9imF ydYfNu0S8T6B+lr0PTMGsrodc+jMYM0P84uEIZSA= Authentication-Results: mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <8b3777bc-4cd5-4bf9-b8f2-f7ba1d596769@yandex.ru> Date: Wed, 24 Apr 2024 01:59:12 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] openat2: add OA2_INHERIT_CRED flag Content-Language: en-US To: Stefan Metzmacher , linux-kernel@vger.kernel.org Cc: Eric Biederman , Alexander Viro , Andy Lutomirski , Christian Brauner , Jan Kara , Jeff Layton , Chuck Lever , Alexander Aring , linux-fsdevel@vger.kernel.org, Paolo Bonzini , =?UTF-8?Q?Christian_G=C3=B6ttsche?= , Jens Axboe References: <20240422084505.3465238-1-stsp2@yandex.ru> <20240422084505.3465238-2-stsp2@yandex.ru> <81ab6c6a-0a9e-4f2f-b455-7585283acf53@samba.org> From: stsp In-Reply-To: <81ab6c6a-0a9e-4f2f-b455-7585283acf53@samba.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 22.04.2024 22:53, Stefan Metzmacher пишет: > I'm wondering if it would be better to capture the whole cred structure. > > Similar to io_register_personality(), which uses get_current_cred(). > > Only using uid and gid, won't reflect any group memberships or > capabilities... I ended up posting v3 where the group memberships are added but the rest, including capabilities, is omitted to avoid security risks. Does adding just a groupinfo to the set of overridden members (which is now: fsuid, fsgid and group_info) address your concern? I really think that raising caps is far out of the scope for my approach, which aims to be safe and simple. Someone else can do that later, if need be.