Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2528670lqt; Mon, 22 Apr 2024 13:24:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVJLgABfFxuqLaogKL3kn+7IAtTC5+nxuhjyJ/5xmfg6E/1vjfpYyB2aqN5U+kRxoLD3Jy/i+X5L7EXSFqfT5XYmruTR998sn9s8Fr3Q== X-Google-Smtp-Source: AGHT+IF1TNgFnYKlDmB/gsE2Ij0/2tX1drGGreHjqoG6FgkUYyC4Lf98Svm16BszELkvXNZok9GU X-Received: by 2002:a17:903:2292:b0:1e5:3e7:64e with SMTP id b18-20020a170903229200b001e503e7064emr14871706plh.22.1713817453276; Mon, 22 Apr 2024 13:24:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713817453; cv=pass; d=google.com; s=arc-20160816; b=nOMUIEdv+KfVSrwLx7XYAhCHsjME3fLl7j+r9lcA/Rit8OYe3yt/U/nI39VDSdej/4 lIwpFw93OmtlCrXwCOiX01NSgDLub5Gq05AQpukGwjmDjNv24gu8g5oymvtCjEu1TEmb zCNmfK8qNf0QXz0uOPyETfc2F2FI4oRiO3IxxVcdq2U/V1mlpCl20gAhr0UDqtdQo0lv 58s6jVdU/Y2NrS/BMdIHfqnz1Ns96aZZbQmuk6ohgsS9VsmJlIThMKFkFz6zqx+e8oLV e2gJCkG6CaU8HYSn8VorEBAPMloLEyCud50Ob0qTmr6zx5qw9w1P/7UM4lWUj12uRj2R Cn3w== 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=HDviXqLc5+bKGGY93odn/n8dV5Y9Ee3imq7rHYSlhCc=; fh=MtVUqMiLpmisccL4qgHJleREF/e2QqxbM6CkxtZYcRg=; b=H9oHjbV9xDg/EjHE1o5BNG3/Xas/UdFqRE1zFqVr1mcrY4xqAIFtoZySOWQrnIRkH1 kyLiX/6rNhtrXJ/98Khz6O7tiBF1ACEIQs7XDfgU3OcqYT+fYKh/W4rVMU6HvLtBaTsf a6otEvSu9bpm5HwNjZLNU6BS2v/Zo8NPTDD14lFFDXa1+8sXRvY9Y4GL03bq5koeNs7L Uevf2sCnN+ZqAZ7ulsRsaF3Kj8m5uJ2RNVkYk2XIHxc3jFK6TWG0hqK05/5G/LztXEVR CQLNohiDumlfXlBCbKdVUAOHGMiVkMYUpfmRGsoqQB8u7uWi4FyySKbu6WQif0Hv/idX pcXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=aTzO+K0y; 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-153992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n10-20020a170902f60a00b001e47f894beesi8702615plg.251.2024.04.22.13.24.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 13:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=aTzO+K0y; 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-153992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153992-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 744DEB21BB5 for ; Mon, 22 Apr 2024 20:19:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E77C215572D; Mon, 22 Apr 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="aTzO+K0y" 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 ED70315380B; Mon, 22 Apr 2024 20:19:03 +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=1713817147; cv=none; b=E5EsyKikvysvUDOHXeppyHku6oDa+UScs9LnAKCtnDWrIFCqvLRarIVGsEDv4bIjEnzUz6PB3Bfowj8penSjOod5+ntVLU5Xh7hHmHW/v8zD2W/eMXTH9F9HqFR37S4VOvwng8GVUwSzptLMrVRvlIJBeK7YxO3e9NHX+CAinnE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713817147; c=relaxed/simple; bh=F1mNmWXaUViPOcI3rhPMLRbySTqw2L7HBr5ZyZBfc28=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WaJ5Qk29nUboiBTJfJBuIpnqgSalJOONrTOCjrhrzplZRc8BtslUJAC27OKaQ/zpTActlsurptIljmHDRvMIS+WvXslkXpCy/+FAqOXDpZ1camJE7wBy9ZKQUV1yr+1gULrE0prJRoLMz7NMGP9FRkD38F1szfbi1pWQCNGt4MA= 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=aTzO+K0y; 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-59.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1a14:0:640:8120:0]) by forward502c.mail.yandex.net (Yandex) with ESMTPS id C661360FB7; Mon, 22 Apr 2024 23:18:55 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id rIQbX18oBGk0-arB2myDQ; Mon, 22 Apr 2024 23:18:54 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1713817134; bh=HDviXqLc5+bKGGY93odn/n8dV5Y9Ee3imq7rHYSlhCc=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=aTzO+K0yVNw9Br3tyYBmqgSmifd+pO3NGxMZGia1hJr1G7Z9NEJh0F+2TES5Xv47p gIKMyHtU7Y8ZcqLXLJoplv/wGNjHiN//nGOBKLfkXMrbal1FYpywvydwCHLNuTJQEd vTQj9Z740ANV2IhX0CBPcdNcXzYlerYM+x1y408g= Authentication-Results: mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <8cb28ed5-b094-4b80-9373-40f93323250e@yandex.ru> Date: Mon, 22 Apr 2024 23:18:52 +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... Hmm, I thought about that, but was under an impression that with get_current_cred() you only increment a refcount. But I guess the trick here is that due to an RCU machinery, you can actually get your local copy if someone else changes it? I'll try what you say, thanks.