[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250425030951.2504900-1-zilin@seu.edu.cn>
Date: Fri, 25 Apr 2025 03:09:51 +0000
From: Zilin Guan <zilin@....edu.cn>
To: zilin@....edu.cn
Cc: jianhao.xu@....edu.cn,
jmorris@...ei.org,
john.johansen@...onical.com,
linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
paul@...l-moore.com,
serge@...lyn.com
Subject: Re: [RFC PATCH] security/apparmor: use kfree_sensitive() in unpack_secmark()
On Fri, Apr 18, 2025 at 04:52:50AM+0000, Zilin Guan wrote:
> To mitigate this, replace kfree() with kfree_sensitive() for freeing
> secmark structures and their labels, aligning with the approach used
> in free_ruleset().
To clarify, we propose using kfree_sensitive() for secmark structures and
their labels because they are already freed with kfree_sensitive() in
another error path, specifically in aa_free_profile() -> free_ruleset().
This change aligns both cleanup pathways, whether aborting early in
unpack_secmark() or cleaning up later via aa_free_profile() ->
free_ruleset(). It ensures that all secmark-related allocations are
scrubbed before deallocation, mitigating any potential security risks.
Best Regards,
Zilin Guan
Powered by blists - more mailing lists