lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3S8/K40fBP05fAT@corigine.com>
Date:   Wed, 16 Nov 2022 11:35:40 +0100
From:   Simon Horman <simon.horman@...igine.com>
To:     Denis Arefev <arefev@...mel.ru>
Cc:     Simon Horman <simon.horman@...ronome.com>,
        Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>, oss-drivers@...ronome.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        lvc-patchest@...uxtesting.org, trufanov@...mel.ru, vfh@...mel.ru,
        Yinjun Zhang <yinjun.zhang@...igine.com>
Subject: Re: [PATCH v2] lag_conf: Added pointer check and continue

On Wed, Nov 16, 2022 at 10:40:00AM +0100, Simon Horman wrote:
> On Wed, Nov 16, 2022 at 11:13:36AM +0300, Denis Arefev wrote:
> > Return value of a function 'kmalloc_array' is dereferenced at
> > lag_conf.c:347 without checking for null,
> > but it is usually checked for this function.
> > 
> > Found by Linux Verification Center (linuxtesting.org) with SVACE.
> > 
> > Signed-off-by: Denis Arefev <arefev@...mel.ru>
> 
> Thanks Denis,
> 
> I'll let me colleague Yinjun review the functional change,
> although, based on his earlier feedback, it does look good to me.

I confirmed with Yinjun that he is happy with the patch,
other than the comments that I made.

> From my side I have two nits:
> 
> 1. I think the patch prefix should be 'nfp: flower:'
>    i.e., the patch subject should be more like
>    [PATCH v2] nfp: flower: handle allocation failure in LAG delayed work
> 
> 2. Inline, below.
> 
> Kind regards,
> Simon
> 
> > diff --git a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> > index 63907aeb3884..1aaec4cb9f55 100644
> > --- a/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> > +++ b/drivers/net/ethernet/netronome/nfp/flower/lag_conf.c
> > @@ -276,7 +276,7 @@ static void nfp_fl_lag_do_work(struct work_struct *work)
> > 
> >         mutex_lock(&lag->lock);
> >         list_for_each_entry_safe(entry, storage, &lag->group_list, list) {
> > -               struct net_device *iter_netdev, **acti_netdevs;
> > +               struct net_device *iter_netdev, **acti_netdevs = NULL;
> 
> 2. I don't think it is necessary (or therefore desirable)
>    to initialise acti_netdevs to NULL.
>    As far as I can tell the variable is already always
>    set before being used.
> 
> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ