From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sonic309-27.consmr.mail.ne1.yahoo.com (sonic309-27.consmr.mail.ne1.yahoo.com [66.163.184.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 154751448E6 for ; Mon, 24 Jun 2024 23:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.163.184.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719270997; cv=none; b=HniOy4/+U5Ur3j7tEWwQEYJ/MJyCNN4NpjsXLeNYM0xjVUBnrzflMcwWet0BOFUDklscrc6wYyY3+9k/eW4YG3MlxWldDF5f0iUAA1PJAHNCendbxMxIlbBQKsChw6TPnm4MDpiXo3RKgMXIl0oo8zw7i3A7t9U+tijMEt9No6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719270997; c=relaxed/simple; bh=G2ND1c+Q6ycTaD9U+MzX0R5Od2Up/QHJRFnz9vhzQsk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cyCPOx3In4uTDtlL+j1X4lV4JQ5pZcSbhrJf5G2KlWlrrds5yx25HnMBtVPv2zmC1tOUGGqLn0cXRLTsAijlFajJ3uaLZWfE5y2NXZYUzRTP+KcQsoUxMRIsNnLrDLCDbsKwL0aDkiv1uQIq3hIKrHMgQSguxoKAWYvFBJaAgzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com; spf=none smtp.mailfrom=schaufler-ca.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=D1KkE71A; arc=none smtp.client-ip=66.163.184.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=schaufler-ca.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="D1KkE71A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719270989; bh=xHY4A2Lgmw6D/IlUTOJ1nqgiihzyUuZqVbuoKHMCoGw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=D1KkE71Abh2QV2YQk6SIIXb66XyGlSlOd7G5VpakA/HUsMe2WYpZvxFGSWXrKh4Pp85WKOzsz4T9FrovAN/oLpCiLL4dsQ050Rl+i+VOuSUwrzabh2X6/KjrN7KOlgYeMO0HagbIiPpyas9R5z1EvJ2t/vYMnH8jrlFXIXz1sfUM/BO3k1/GJUB3LNxTzj53+xtzAC2XBZypY7ONUVnJDpbI5K4USGNXfgEVPtSQ5eQUdjD4o94e2h3M8p0vNTonfoJf4y8q/65BHuOOw8YDmKKu8aybnr/2KNUAng+JWIZyK8169UHZrZwR7p4dDpotizcfpT+h7J/GEI3qdxBDqw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719270989; bh=NzqBSkui2qdcsyaQS5pLeMrt26k8YLjs5aFewG7uBy3=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=A5lC3vCm0OdVdCaCYeAeg+DxSyUtSo+HL3Nj65unb+I+f/kG/TqaH26XnJkZVdifqj2vLa3Tb4KS5ntK5lppUpSkqDQk2o6M0JLNhkzUI8toYhjLRzg7jrUlJ9hHSlnODfFs0WQ4ZPdsMmflWEX4eUOl7bNORvAc5bAql8C/TkyFuUad+ijEhtkGLg1iexHQErHVKZQWiNy4MeMVdHkqIZh6lX19+hHT+jZSvyLm5xNcwfwaZrRSuqX9Xu6NKL9erzVotHfQdSdAwua1eeMroI6LdhAOWLmK8mjZV4ojZaItNLVuQdL0NwH+KtOGjDq/3kLeU9deddHl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J0MelUQV YKrhufoYcaxFOT79rVpZSffUl3DC_0XwXXAyFZECYiaHsIqIq3CUeYCu16i4.dMayjIiMxOX4KZj I9rmhNT4Zq5TYm0I9Hx4HUC7Ielr2XbwhRPMyw3seWx3kNBzmmlsxWp0ahl5hLywY7L7UIwhaOQU ZopJJHXK.cop4wo6XWbnlQe5baYxkR3E7dbzOmnxr0zEY0mmK9GYni6GZdHGTb0OUnO09007Iyry Mn6KXyTsPd20y X-Sonic-MF: X-Sonic-ID: 986ec05e-1a64-4b9c-8db0-8417941d955e Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Mon, 24 Jun 2024 23:16:29 +0000 Received: by hermes--production-gq1-5b4c49485c-sbfr9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 20dddb9a63c6f8e5552486f1df88fe13; Mon, 24 Jun 2024 23:16:27 +0000 (UTC) Message-ID: Date: Mon, 24 Jun 2024 16:16:25 -0700 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 v39 01/42] integrity: disassociate ima_filter_rule from security_audit_rule To: Paul Moore Cc: Mimi Zohar , Roberto Sassu , Roberto Sassu , linux-security-module@vger.kernel.org, jmorris@namei.org, serge@hallyn.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org, mic@digikod.net, linux-integrity@vger.kernel.org, Casey Schaufler References: <20231215221636.105680-1-casey@schaufler-ca.com> <20231215221636.105680-2-casey@schaufler-ca.com> <52bffc64dc7db2cc1912544514008eada1e058a7.camel@linux.ibm.com> <40c8ec3f-32fc-4bff-a50c-c1a868fcc776@schaufler-ca.com> Content-Language: en-US From: Casey Schaufler In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.22464 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo On 6/24/2024 4:05 PM, Paul Moore wrote: > On Mon, Jun 24, 2024 at 6:19 PM Casey Schaufler wrote: >> On 6/24/2024 3:03 PM, Paul Moore wrote: >>> On Mon, Jun 24, 2024 at 9:57 AM Mimi Zohar wrote: >>>> On Mon, 2024-06-24 at 10:45 +0200, Roberto Sassu wrote: >>>>> My only comment would be that I would not call the new functions with >>>>> the ima_ prefix, being those in security.c, which is LSM agnostic, but >>>>> I would rather use a name that more resembles the differences, if any. >>>> Commit 4af4662fa4a9 ("integrity: IMA policy") originally referred to these hooks >>>> as security_filter_rule_XXXX, but commit b8867eedcf76 ("ima: Rename internal >>>> filter rule functions") renamed the function to ima_filter_rule_XXX) to avoid >>>> security namespace polution. >>>> >>>> If these were regular security hooks, the hooks would be named: >>>> filter_rule_init, filter_rule_free, filter_rule_match with the matching >>>> "security" prefix functions. Audit and IMA would then register the hooks. >>>> >>>> I agree these functions should probably be renamed again, probably to >>>> security_ima_filter_rule_XXXX. >>> It's funny, my mind saw that the patch was removing those preprocessor >>> macros and was so happy it must have shut off, because we already have >>> security_XXX functions for these :) >>> >>> See security_audit_rule_init(), security_audit_rule_free(), and >>> security_audit_rule_match(). >>> >>> Casey, do you want to respin this patch to use the existing LSM >>> functions? >> If you want to use shared functions they shouldn't be security_audit_blah(). >> I like Mimi's suggestion. Rename security_audit_filter_rule_init() to >> security_filter_rule_init() and use that in both places. > They are currently shared, the preprocessor macros just hide that fact > (which is not a good thing, IMO). Renaming the existing LSM functions > to drop the "audit" in the name doesn't really solve the problem as > you still end up with "Audit_equal", etc. constants (which are awful > for multiple reasons, some having nothing to do with the LSM) in the > callers. > > .. and let me just get ahead of this, please do not do a macro-based > rename of "Audit_equal" to something else to "fix" that problem; > that's just as bad as what we have now. Agreed. > Properly fixing this may be worthwhile, but I think it's an > unnecessary distraction at this point from improving that state of > multiple LSMs. If you aren't comfortable submitting a patch that just > does a "/ima_filter_rule_match/security_audit_rule_match/" style > rename, or if Mimi and Roberto aren't supportive of that, you might as > well just drop this from the patchset. There was a time (long ago by now) when the stacking patches really needed the functions to be different. They don't now. I'd be perfectly happy with dropping this patch from the set. > > -- > paul-moore.com >