New Defects reported by Coverity Scan for ubuntu-xenial-kernel

Colin Ian King colin.king at canonical.com
Thu Jan 25 09:54:40 UTC 2018


On 25/01/18 09:50, Daniel Axtens wrote:
> Hi,
> 
> This is probably dead code: the (!prog || !prog->len) check was dropped
> in 93a73d442d37 ("bpf, x86/arm64: remove useless checks on prog")
> 
> """
>     There is never such a situation, where bpf_int_jit_compile() is
>     called with either prog as NULL or len as 0, so the tests are
>     unnecessary and confusing as people would just copy them.
> """
> 
> So it probably doesn't matter, but for consistence and in case it's not
> actually dead on Xenial, we should probably do a fixup to return prog.
> I'm happy to do that if you want - do you want a standard launchpad bug
> for it?

Yes please, it will have to be a SRU too for Xenial. Thanks for picking
this up Daniel.

Colin

> 
> Regards,
> Daniel
> 
> 
> On Wed, Jan 24, 2018 at 5:13 AM, Colin Ian King
> <colin.king at canonical.com <mailto:colin.king at canonical.com>> wrote:
> 
>     CoverityScan picked this bpf issue in Xenial, anyone care to see if this
>     needs fixing?
> 
>     Colin
> 
>     -------- Forwarded Message --------
>     Subject: New Defects reported by Coverity Scan for ubuntu-xenial-kernel
>     Date: Tue, 23 Jan 2018 18:10:19 +0000 (UTC)
>     From: scan-admin at coverity.com <mailto:scan-admin at coverity.com>
>     To: colin.king at canonical.com <mailto:colin.king at canonical.com>
> 
> 
>     Hi,
> 
>     Please find the latest report on new defect(s) introduced to
>     ubuntu-xenial-kernel found with Coverity Scan.
> 
>     1 new defect(s) introduced to ubuntu-xenial-kernel found with
>     Coverity Scan.
> 
> 
>     New defect(s) Reported-by: Coverity Scan
>     Showing 1 of 1 defect(s)
> 
> 
>     ** CID 1464330:  Uninitialized variables  (MISSING_RETURN)
>     /arch/x86/net/bpf_jit_comp.c: 1088 in bpf_int_jit_compile()
> 
> 
>     ________________________________________________________________________________________________________
>     *** CID 1464330:  Uninitialized variables  (MISSING_RETURN)
>     /arch/x86/net/bpf_jit_comp.c: 1088 in bpf_int_jit_compile()
>     1082            int i;
>     1083     1084           if (!bpf_jit_enable)
>     1085                    return prog;
>     1086     1087           if (!prog || !prog->len)
>     >>>     CID 1464330:  Uninitialized variables  (MISSING_RETURN)
>     >>>     Arriving at the end of a function without returning a value.
>     1088                    return;
>     1089     1090           addrs = kmalloc(prog->len * sizeof(*addrs),
>     GFP_KERNEL);
>     1091            if (!addrs)
>     1092                    return prog;
>     1093
> 
> 
> 
>     --
>     kernel-team mailing list
>     kernel-team at lists.ubuntu.com <mailto:kernel-team at lists.ubuntu.com>
>     https://lists.ubuntu.com/mailman/listinfo/kernel-team
>     <https://lists.ubuntu.com/mailman/listinfo/kernel-team>
> 
> 





More information about the kernel-team mailing list