Skip to content

Commit fe81536

Browse files
committed
landlock: Remove incorrect warning
landlock_put_hierarchy() can be called when an error occurs in landlock_merge_ruleset() due to insufficient memory. In this case, the domain's audit details might not have been allocated yet, which would cause landlock_free_hierarchy_details() to print a warning (but still safely handle this case). We could keep the WARN_ON_ONCE(!hierarchy) but it's not worth it for this kind of function, so let's remove it entirely. Cc: Paul Moore <[email protected]> Reported-by: [email protected] Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Günther Noack <[email protected]> Signed-off-by: Mickaël Salaün <[email protected]>
1 parent 0af2f6b commit fe81536

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/landlock/domain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int landlock_init_hierarchy_log(struct landlock_hierarchy *const hierarchy);
130130
static inline void
131131
landlock_free_hierarchy_details(struct landlock_hierarchy *const hierarchy)
132132
{
133-
if (WARN_ON_ONCE(!hierarchy || !hierarchy->details))
133+
if (!hierarchy || !hierarchy->details)
134134
return;
135135

136136
put_pid(hierarchy->details->pid);

0 commit comments

Comments
 (0)