Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3263263lqp; Tue, 26 Mar 2024 04:40:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWl1gMfNX8OrbMrrdMO7vL8rgJJ9vvKro2QiLe+wzgaww5P5nwxodm7DzHtsW4SWZSgLA3cz5ImRYKCX9mi7oP1tN+o1dhwVeQ/CUGbDA== X-Google-Smtp-Source: AGHT+IFYgA4xhqiKMWUreVZLUpcmR6Fx1rF8VKLWlrMUQBrNbGOxHi6aYga26taLgznmsAFvyh+x X-Received: by 2002:a50:8d17:0:b0:568:1a8:58b with SMTP id s23-20020a508d17000000b0056801a8058bmr736760eds.14.1711453238301; Tue, 26 Mar 2024 04:40:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711453238; cv=pass; d=google.com; s=arc-20160816; b=uO62m9am373n3Yo8ipJmuNypej6sdDkdGmpE3DpR68NGoh3GG1evYzIiox8XvCjzEi gUeBTTZ9yonqgzYVXCMqgAehFxglRcWhPNc3J31F2arjcJEsxI3rJjBHWUZpXeJIxkBm vn3ve+1HKPie/J5a34R8QfB/ARA1FLHDzDRWW+apkC7i1vRQLQ2MqNeyikHTcWxOAniW gr1ToBgav4/NCd4iXF46hhKAMLKiLXqfxDXP1ZUZlTM4Nh/qJDcabtXzfSllo0DYITaG n/oTCDYQuBCIP2lu/jejLiTrwO2FrmhFAeN5Zp2+fsDAKsqI+A7mWMqBaRUBoiYimnV3 Y83A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LamHup0dGZLclxF5hDMENi9cqj4fae/k4ItBnLEbvXk=; fh=uESXUw8PMOIq0xV+a80yUO+MV03+HItmnv2Yul/PHAc=; b=fhuwdBVq30RPvwEyFUybM9iqn4origy+5wNgIY37PlFKVTUaBNtOs1xCvUgzEvqgwq 9GTK5Qswztawo9XuhD40vw/RPJFGONJWLhph62m+KNWGRvEC/gpEsG9Fl/++b3MkS/Wa RH+SAuDzwgbFwzF26dg6c403duFQp4Jf2TcxWEvTqXG0Ze+YL2aDOB1Ou9zUeG8KxUCn hegEb6jhLJ3lWoXCAs3O7THEPO1hoom8czsHbxEAD3RsoPeHMTb0QnmhLLFJ2JJE/gQb p2/gDHlAfVPi6vQrjoedCab24Qh2MIei41Vw91/qwuJuMr3fLP05MLNidxriTlEY7+S1 mWFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="AMRE/iI4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118906-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d28-20020a50f69c000000b0056bf2d148aesi3431489edn.653.2024.03.26.04.40.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118906-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=@kernel.org header.s=k20201202 header.b="AMRE/iI4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118906-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 000511F3DB95 for ; Tue, 26 Mar 2024 11:40:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF8725C8FE; Tue, 26 Mar 2024 11:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AMRE/iI4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 10A215475D; Tue, 26 Mar 2024 11:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711453227; cv=none; b=jCaQvjVx3Drdo88I/UTrvHaSCV3WwMsMTJXnutikBm4Gi+noH5fgV0tW03T5q7ZTKLW3+hiZ/YaSfkM0jWwwvGrddEBrR/14Iawp4MIb0hDGrW1D8MeR50boi63daiARFQkdeTKRq4Yk7i/S2xI/F227Uc3ggIchKfLJnHn8FcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711453227; c=relaxed/simple; bh=LamHup0dGZLclxF5hDMENi9cqj4fae/k4ItBnLEbvXk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SvaCcxB+eDowncwy7b+2Bo8t4pXlD4Wuo0cPzxSCvPESE8iDd8wPWjugrs3hNwZFaHXZUK3ZReAoA8JqR1g2e5VMFyjXzgdOdfLebW8NCgpVszgOlSqOXXoZwQNu60G3u1bf/UhyybZU1e2apSri8l6wWCnvvtUUxaqq/s9r3kE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AMRE/iI4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D913C433C7; Tue, 26 Mar 2024 11:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711453226; bh=LamHup0dGZLclxF5hDMENi9cqj4fae/k4ItBnLEbvXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AMRE/iI4RJ6vd0APpjPRk1YQHf4J9dTuv4WrqGL8+E1hr7+otCP/sB5gPa7Rf2wgb IiPE38SuABXhybKzI5dQ/4abJDjcdtLMFsAW68JM0PSqEWKRuomzcmmWP0/lGUolbm rArt7kRg23507Zdd3jlu/crFMF3b5yXeuWkyQvYQiQNIUWoDz6ERDiNJqumC0KnAgY X8pOF+Uqvu+K8HbbMcaKcvHgjpoznL00qAuP4DGdCfgsa98ihYMr7lSYXEeaFsaPXu i0FW42e42lLutB+Qb3CqlrbfFBUjaqAdZS/nSNx+Em/M+fuwezqwvOuUM+8ViviusI 1GMEGdZV2mTHw== Date: Tue, 26 Mar 2024 12:40:20 +0100 From: Christian Brauner To: Roberto Sassu Cc: Al Viro , Steve French , LKML , linux-fsdevel , CIFS , Paulo Alcantara , Christian Brauner , Mimi Zohar , Paul Moore , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" Subject: Re: kernel crash in mknod Message-ID: <20240326-halbkreis-wegstecken-8d5886e54d28@brauner> References: <20240324054636.GT538574@ZenIV> <3441a4a1140944f5b418b70f557bca72@huawei.com> <20240325-beugen-kraftvoll-1390fd52d59c@brauner> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: > we can change the parameter of security_path_post_mknod() from > dentry to inode? If all current callers only operate on the inode then it seems the best to only pass the inode. If there's some reason someone later needs a dentry the hook can always be changed. For bigger changes it's also worthwhile if the object that's passed down into the hook-based LSM layer is as specific as possible. If someone does a change that affects lifetime rules of mounts then any hook that takes a struct path argument that's unused means going through each LSM that implements the hook only to find out it's not actually used. Similar for dentry vs inode imho.