[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250314203044.GA9537@breakpoint.cc>
Date: Fri, 14 Mar 2025 21:30:44 +0100
From: Florian Westphal <fw@...len.de>
To: Casey Schaufler <casey@...aufler-ca.com>
Cc: Florian Westphal <fw@...len.de>, Chenyuan Yang <chenyuan0y@...il.com>,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Initialize ctx to avoid memory allocation error
Casey Schaufler <casey@...aufler-ca.com> wrote:
> >>> seclen needs to be > 0 or no secinfo is passed to userland,
> >>> yet the secctx release function is called anyway.
> >> That is correct. The security module is responsible for handling
> >> the release of secctx correctly.
> >>
> >>> Should seclen be initialised to -1? Or we need the change below too?
> >> No. The security modules handle secctx their own way.
> > Well, as-is security_release_secctx() can be called with garbage ctx;
> > seclen is inited to 0, but ctx is not initialized unconditionally.
>
> Which isn't an issue for any existing security module.
The splat quoted in
35fcac7a7c25 ("audit: Initialize lsmctx to avoid memory allocation error")
seems to disagree. I see no difference to what nfnetlink_queue is
doing.
Powered by blists - more mailing lists