Public bug reported:

Below code is failing while compiling with clang: 
static inline int ctnetlink_secctx_size(const struct nf_conn *ct)
{
#ifdef CONFIG_NF_CONNTRACK_SECMARK
        int len, ret;
            ^^^ <-- len is not initialized before use

        ret = security_secid_to_secctx(ct->secmark, NULL);
        if (ret < 0)
                return 0;

        return nla_total_size(0) /* CTA_SECCTX */
               + nla_total_size(sizeof(char) * len); /* CTA_SECCTX_NAME */
                                               ^^^ <-- len has not been 
initialized
#else
        return 0;
#endif
}

Looking into git history I realized that there an incomplete commit of
2d470c778120d3cdb8d8ab250329ca85f49f12b1 (lsm: replace context+len with
lsm_context) causing it:

commit c45f92d3c95e9a242c0b22e2f7f24e4f319391dd
Author: Casey Schaufler <[email protected]>
Date:   Tue Dec 12 14:21:57 2023 -0800

    UBUNTU: SAUCE: apparmor4.0.0 [17/90]: LSM stacking v39: LSM: Use
lsmcontext in security_secid_to_secctx

    BugLink: http://bugs.launchpad.net/bugs/2028253

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2120561

Title:
  Fix compilation failure because of incomplete backport

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2120561/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to