Thread (44 messages) 44 messages, 4 authors, 2021-03-25

Re: [PATCH v30 02/12] landlock: Add ruleset and domain management

From: Kees Cook <hidden>
Date: 2021-03-19 19:16:23
Also in: linux-api, linux-arch, linux-fsdevel, linux-kselftest, linux-security-module, lkml

On Fri, Mar 19, 2021 at 08:03:22PM +0100, Mickaël Salaün wrote:
On 19/03/2021 19:40, Kees Cook wrote:
quoted
On Tue, Mar 16, 2021 at 09:42:42PM +0100, Mickaël Salaün wrote:
quoted
[...]
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help