From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AMRE/iI4" 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.