APPLIED: [SRU][N][PATCH 0/1] Fix -Wuninitialized in ctnetlink_secctx_size()
Stefan Bader
stefan.bader at canonical.com
Wed Aug 20 12:47:55 UTC 2025
On 16.08.25 00:18, Magali Lemes wrote:
> BugLink: https://bugs.launchpad.net/bugs/2120561
>
> [Impact]
> In ctnetlink_secctx_size() from net/netfilter/nf_conntrack_netlink.c,
> `len` is used uninitialized, triggering the following warning when
> compiling with Clang:
>
> net/netfilter/nf_conntrack_netlink.c:674:41: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
> 674 | + nla_total_size(sizeof(char) * len); /* CTA_SECCTX_NAME */
> | ^~~
> net/netfilter/nf_conntrack_netlink.c:667:9: note: initialize the variable 'len' to silence this warning
> 667 | int len, ret;
> | ^
> | = 0
>
> [Fix]
> Match mainline commit 2d470c778120 ("lsm: replace context+len with lsm_context").
>
> [Test Plan]
> Compile with Clang, check the warning is gone and no other warning has been
> triggered.
>
> [Where problems could occur]
> This patch touches bits of the netlink interface for nf_conntrack. However,
> it addresses a clear mistake in the current implementation, so no issues
> should be introduced.
>
> Magali Lemes (1):
> UBUNTU: SAUCE: netfilter: ctnetlink: Fix -Wuninitialized in
> ctnetlink_secctx_size()
>
> net/netfilter/nf_conntrack_netlink.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Applied to noble:linux/master-next. Thanks.
-Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xE8675DEECBEECEA3.asc
Type: application/pgp-keys
Size: 48643 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20250820/fd0e11e0/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20250820/fd0e11e0/attachment-0001.sig>
More information about the kernel-team
mailing list