|
Date: Fri, 19 Mar 2021 12:15:36 -0700 From: Kees Cook <keescook@...omium.org> To: Mickaël Salaün <mic@...ikod.net> Cc: James Morris <jmorris@...ei.org>, Jann Horn <jannh@...gle.com>, "Serge E . Hallyn" <serge@...lyn.com>, Al Viro <viro@...iv.linux.org.uk>, Andrew Morton <akpm@...ux-foundation.org>, Andy Lutomirski <luto@...capital.net>, Anton Ivanov <anton.ivanov@...bridgegreys.com>, Arnd Bergmann <arnd@...db.de>, Casey Schaufler <casey@...aufler-ca.com>, David Howells <dhowells@...hat.com>, Jeff Dike <jdike@...toit.com>, Jonathan Corbet <corbet@....net>, Michael Kerrisk <mtk.manpages@...il.com>, Richard Weinberger <richard@....at>, Shuah Khan <shuah@...nel.org>, Vincent Dagonneau <vincent.dagonneau@....gouv.fr>, kernel-hardening@...ts.openwall.com, linux-api@...r.kernel.org, linux-arch@...r.kernel.org, linux-doc@...r.kernel.org, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org, linux-security-module@...r.kernel.org, x86@...nel.org, Mickaël Salaün <mic@...ux.microsoft.com> Subject: Re: [PATCH v30 02/12] landlock: Add ruleset and domain management On Fri, Mar 19, 2021 at 08:03:22PM +0100, Mickaël Salaün wrote: > On 19/03/2021 19:40, Kees Cook wrote: > > On Tue, Mar 16, 2021 at 09:42:42PM +0100, Mickaël Salaün wrote: > >> [...] > >> +static void put_rule(struct landlock_rule *const rule) > >> +{ > >> + might_sleep(); > >> + if (!rule) > >> + return; > >> + landlock_put_object(rule->object); > >> + kfree(rule); > >> +} > > > > I'd expect this to be named "release" rather than "put" since it doesn't > > do any lifetime reference counting. > > It does decrement rule->object->usage . Well, landlock_put_object() decrements rule->object's lifetime. It seems "rule" doesn't have a lifetime. (There is no refcounter on rule.) I just find it strange to see "put" without a matching "get". Not a big deal. -- Kees Cook
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.