LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] ipvs: fix UB due to uninitialized stack access in ip_vs_prot

To: Jinghao Jia <jinghao7@xxxxxxxxxxxx>
Subject: Re: [PATCH] ipvs: fix UB due to uninitialized stack access in ip_vs_protocol_init()
Cc: Simon Horman <horms@xxxxxxxxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxx>, Nathan Chancellor <nathan@xxxxxxxxxx>, Nick Desaulniers <ndesaulniers@xxxxxxxxxx>, Bill Wendling <morbo@xxxxxxxxxx>, Justin Stitt <justinstitt@xxxxxxxxxx>, Kees Cook <kees@xxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, coreteam@xxxxxxxxxxxxx, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, llvm@xxxxxxxxxxxxxxx, kernel test robot <lkp@xxxxxxxxx>, Ruowen Qin <ruqin@xxxxxxxxxx>
From: Julian Anastasov <ja@xxxxxx>
Date: Thu, 21 Nov 2024 17:23:56 +0200 (EET)
        Hello,

On Tue, 19 Nov 2024, Jinghao Jia wrote:

> On 11/18/24 6:41 AM, Julian Anastasov wrote:
> > 
> > On Mon, 11 Nov 2024, Jinghao Jia wrote:
> > 
> >> Under certain kernel configurations when building with Clang/LLVM, the
> >> compiler does not generate a return or jump as the terminator
> >> instruction for ip_vs_protocol_init(), triggering the following objtool
> >> warning during build time:
> >>
> >>   vmlinux.o: warning: objtool: ip_vs_protocol_init() falls through to next 
> >> function __initstub__kmod_ip_vs_rr__935_123_ip_vs_rr_init6()
> >>
...
> >> This gives later passes (SCCP, in particular) to more DCE opportunities
> 
> One small request: if you could help us remove the extra "to" in the above
> sentence when committing this patch, it would be great.
> 
...
> >     Looks good to me, thanks! I assume it is for
> > net-next/nf-next, right?
> 
> I am actually not familiar with the netfilter trees. IMHO this should also be
> back-ported to the stable kernels -- I wonder if net-next/nf-next is a good
> tree for this?

        Then may be it is better to send [PATCHv2 net] after fixing
the above "to" and selecting proper commit for a Fixes line (probably
the initial commit 1da177e4c3f4 ?).

> >> -  char protocols[64];
> >> +  char protocols[64] = { 0 };
> >>  #define REGISTER_PROTOCOL(p)                      \
> >>    do {                                    \
> >>            register_ip_vs_protocol(p);     \
> >> @@ -348,8 +348,6 @@ int __init ip_vs_protocol_init(void)
> >>            strcat(protocols, (p)->name);   \
> >>    } while (0)
> >>  
> >> -  protocols[0] = '\0';
> >> -  protocols[2] = '\0';
> >>  #ifdef CONFIG_IP_VS_PROTO_TCP
> >>    REGISTER_PROTOCOL(&ip_vs_protocol_tcp);
> >>  #endif

Regards

--
Julian Anastasov <ja@xxxxxx>



<Prev in Thread] Current Thread [Next in Thread>