Commit 2b270e2f authored by Zilin Guan's avatar Zilin Guan Committed by John Johansen
Browse files

security/apparmor: use kfree_sensitive() in unpack_secmark()



The unpack_secmark() function currently uses kfree() to release memory
allocated for secmark structures and their labels. However, if a failure
occurs after partially parsing secmark, sensitive data may remain in
memory, posing a security risk.

To mitigate this, replace kfree() with kfree_sensitive() for freeing
secmark structures and their labels, aligning with the approach used
in free_ruleset().

I am submitting this as an RFC to seek freedback on whether this change
is appropriate and aligns with the subsystem's expectations. If
confirmed to be helpful, I will send a formal patch.

Signed-off-by: default avatarZilin Guan <zilin@seu.edu.cn>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 3e45553a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment