Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp385215lqh; Tue, 7 May 2024 02:03:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrCoTUcR5U8xOvrlmraja3L99wQlASXbiAbMzub0heHUWLga/b/jxYLaW0EzV+N3xh7OX2zn3yGSM7ygc7/DW1kNegpxExC1yiP74C0w== X-Google-Smtp-Source: AGHT+IG6gZC8R9PxsJt3ZZHZADxYQoVX4ne8ap12UvALw6RIHzLNEPPaHLL5KWtryfifLp1uWC0O X-Received: by 2002:a50:d783:0:b0:568:aa14:37a9 with SMTP id w3-20020a50d783000000b00568aa1437a9mr10732742edi.24.1715072607171; Tue, 07 May 2024 02:03:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715072607; cv=pass; d=google.com; s=arc-20160816; b=m2CVOYSTYK1XNF7xs2RxSGpEJvutnWvNEcuyDkpC4LXbBdVx7jiMMS3/7SREqsaB23 JQAyDIoGFFGCF45wxZiYHrJv8ADDNmJ0xIPs2GDD6oAO8sxLUwtev2ZX32nuuDTZ6vnT nkQ2ol6Q3VLkbpdLAzs928uWTSjUJKZOF1HNBjK4bO+Xq9INfTWG7KAQTDgZSB62y0en uxGJKmtwMgrGEMfblMH4+RvRl6Ir1umHJ6RqSGSY8DqUeQ7ADCyrtW3De5+5xWjzpopr 4WxBRiS7yltx+rpVeNmyPUmf5jktJPaBhPG66JXqW6BoCWzXwBSoxFANwJ+ypjTC+ly6 9CHw== 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=6uh8ifxHE5uS7W3QOLk171FF199PCmZvPR8VQGKwOU4=; fh=7Vvk1pvbmg6WtnRHTav15Ml8nBxHSEDLqZqxOLdRnFs=; b=wSrHi/EnEIx7k0FUa9H1gqaKv1wKtX3VIu4BcbveF8cg6c5ddiTgiOAwjPWtG+1YSl XNEtX0a5AQ1O5tOsyBf6y3G7qWkYSzVJxmZSVtOLNFgfq2F2U+Wyo4lL/5S75hxBlPbs nHSs8KbX7hyY+G/D05fzsMkjIAg2EipyN2+mKO9tocafrG6cxhfhzvjCafcE6Jr055po LGOKfF4Gv0cQUin1MpvSbB2p5Il2tdZuZ628Uyw2ywv7RgR++X+3ZQm+oONHkGQtQZjY zn9g2Qi6UywKl3iWE7nyoOAJ80DEf6WIzpQrcHfTmaUqexW/E71+7AMzPrV89/p/hem3 KDHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=URRyXl5p; 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-170908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id be16-20020a0564021a3000b00572a1f05e39si4578391edb.544.2024.05.07.02.03.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 02:03:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=URRyXl5p; 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-170908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170908-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DF9E51F22227 for ; Tue, 7 May 2024 09:03:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0098D14D710; Tue, 7 May 2024 09:02:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="URRyXl5p" Received: from forward501c.mail.yandex.net (forward501c.mail.yandex.net [178.154.239.209]) (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 16A9E14D6EE; Tue, 7 May 2024 09:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.209 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715072546; cv=none; b=TWAXUz8zqNAhZHgp95M8kxHabFFCbZgjsVKDYFKleYwShkRpvyVPLkdzqgwht05FavkT57C8ReOBJsbkmY7MpUT2rpR9795iCmaoT2jbV5PYWTy32JSGXRYVEooE1puRGHeU4fcEfQ4D2ylEB9SkeI34zmlKsz7AFYyPd++NEJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715072546; c=relaxed/simple; bh=6uh8ifxHE5uS7W3QOLk171FF199PCmZvPR8VQGKwOU4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HgnI+o7nQfDE1WHgbLX3EoAtBu7vLtStwjew/sjFLVVFzUKHkt0KMkrmqxzZM8mCdMYT5S25hmU5ts/NVN/ZFjlc47fc49vzWiytdChCh7hE/rPrYRe50rQrrH7IPH6H0A5sFdAgMbiQ9NHJJnI7GWigpBeMwXuMWYJWU7doeMI= 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=URRyXl5p; arc=none smtp.client-ip=178.154.239.209 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-45.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:4a21:0:640:2a87:0]) by forward501c.mail.yandex.net (Yandex) with ESMTPS id 5043C60AEF; Tue, 7 May 2024 12:02:13 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id A2UoZZEXmiE0-lvz16yjz; Tue, 07 May 2024 12:02:11 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1715072532; bh=6uh8ifxHE5uS7W3QOLk171FF199PCmZvPR8VQGKwOU4=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=URRyXl5p7TM+JG7sJGaDL948M/XhkeO3pZaPL1fgL8Bjms4MwfqOR33DW3NL9b/Jp e2vlVjEPAZr4maOPUGUd+3ZvUIX8cJnmKCvHcJg/AjkBn1gKHfkA6pxOgfJCP3zesw xiFfOVxdUlgsNzfjNv8lr3SbJkq0+lYJg1x/DmeQ= Authentication-Results: mail-nwsmtp-smtp-production-main-45.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <5b5cc31f-a5be-4f64-a97b-7708466ace82@yandex.ru> Date: Tue, 7 May 2024 12:02:10 +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 v6 0/3] implement OA2_CRED_INHERIT flag for openat2() Content-Language: en-US To: Aleksa Sarai Cc: linux-kernel@vger.kernel.org, Stefan Metzmacher , Eric Biederman , Alexander Viro , Andy Lutomirski , Christian Brauner , Jan Kara , Jeff Layton , Chuck Lever , Alexander Aring , David Laight , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, Paolo Bonzini , =?UTF-8?Q?Christian_G=C3=B6ttsche?= References: <20240427112451.1609471-1-stsp2@yandex.ru> <20240506.071502-teak.lily.alpine.girls-aiKJgErDohK@cyphar.com> From: stsp In-Reply-To: <20240506.071502-teak.lily.alpine.girls-aiKJgErDohK@cyphar.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 07.05.2024 10:50, Aleksa Sarai пишет: > If you are a privileged process which plans to change users, Not privileged at all. But I think what you say is still possible with userns? > A new attack I just thought of while writing this mail is that because > there is no RESOLVE_NO_XDEV requirement, it should be possible for the > process to get an arbitrary write primitive by creating a new > userns+mountns and then bind-mounting / underneath the directory. Doesn't this need a write perm to a directory? In his case this is not a threat, because you are not supposed to have a write perm to that dir. OA2_CRED_INHERIT is the only way to write.