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]
Date:	Wed, 25 Nov 2015 10:35:35 -0800
From:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	davem@...emloft.net
Cc:	Shannon Nelson <shannon.nelson@...el.com>, netdev@...r.kernel.org,
	nhorman@...hat.com, sassmann@...hat.com, jogreene@...hat.com,
	John Ronciak <john.ronciak@...el.com>,
	Carolyn Wyborny <carolyn.wyborny@...el.com>
Subject: Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string
 building

On Wed, 2015-11-25 at 21:26 +0300, Sergei Shtylyov wrote:
> On 11/25/2015 09:21 PM, Jeff Kirsher wrote:
> 
> > From: Shannon Nelson <shannon.nelson@...el.com>
> >
> > There's really no reason to kill the kernel thread just because of
> a
> > little info string. This reworks the code to use snprintf's
> limiting to
> > assure that the string is never too long, and WARN_ON to still put
> out
> > a warning that we might want to look at the feature list length.
> >
> > Prompted by a recent Linus diatribe.
> >
> > Change-ID: If52ba5ca1c2344d8bf454a31bbb805eb5d2c5802
> > Signed-off-by: Shannon Nelson <shannon.nelson@...el.com>
> > Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> > ---
> >   drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++++++++++++-
> -------------
> >   1 file changed, 18 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > index 7715c54..7a4595a 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> [...]
> > @@ -10124,42 +10126,42 @@ static void i40e_print_features(struct
> i40e_pf *pf)
> >
> >       buf = string;
> >
> > -     buf += sprintf(string, "Features: PF-id[%d] ", hw->pf_id);
> > +     i += snprintf(&buf[i], REMAIN(i), "Features: PF-id[%d] ", hw-
> >pf_id);
> >   #ifdef CONFIG_PCI_IOV
> > -     buf += sprintf(buf, "VFs: %d ", pf->num_req_vfs);
> > +     i += snprintf(&buf[i], REMAIN(i), "VFs: %d ", pf-
> >num_req_vfs);
> >   #endif
> > -     buf += sprintf(buf, "VSIs: %d QP: %d RX: %s ",
> > -                    pf->hw.func_caps.num_vsis,
> > -                    pf->vsi[pf->lan_vsi]->num_queue_pairs,
> > -                    pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" :
> "1BUF");
> > +     i += snprintf(&buf[i], REMAIN(i), "VSIs: %d QP: %d RX: %s ",
> > +                   pf->hw.func_caps.num_vsis,
> > +                   pf->vsi[pf->lan_vsi]->num_queue_pairs,
> > +                   pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" :
> "1BUF");
> >
> >       if (pf->flags & I40E_FLAG_RSS_ENABLED)
> > -             buf += sprintf(buf, "RSS ");
> > +             i += snprintf(&buf[i], REMAIN(i), "RSS ");
> >       if (pf->flags & I40E_FLAG_FD_ATR_ENABLED)
> > -             buf += sprintf(buf, "FD_ATR ");
> > +             i += snprintf(&buf[i], REMAIN(i), "FD_ATR ");
> >       if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
> > -             buf += sprintf(buf, "FD_SB ");
> > -             buf += sprintf(buf, "NTUPLE ");
> > +             i += snprintf(&buf[i], REMAIN(i), "FD_SB ");
> > +             i += snprintf(&buf[i], REMAIN(i), "NTUPLE ");
> >       }
> >       if (pf->flags & I40E_FLAG_DCB_CAPABLE)
> > -             buf += sprintf(buf, "DCB ");
> > +             i += snprintf(&buf[i], REMAIN(i), "DCB ");
> >   #if IS_ENABLED(CONFIG_VXLAN)
> > -     buf += sprintf(buf, "VxLAN ");
> > +     i += snprintf(&buf[i], REMAIN(i), "VxLAN ");
> >   #endif
> >       if (pf->flags & I40E_FLAG_PTP)
> > -             buf += sprintf(buf, "PTP ");
> > +             i += snprintf(&buf[i], REMAIN(i), "PTP ");
> >   #ifdef I40E_FCOE
> >       if (pf->flags & I40E_FLAG_FCOE_ENABLED)
> > -             buf += sprintf(buf, "FCOE ");
> > +             i += snprintf(&buf[i], REMAIN(i), "FCOE ");
> >   #endif
> >       if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
> > -             buf += sprintf(buf, "VEB ");
> > +             i += snprintf(&buf[i], REMAIN(i), "VEPA ");
> 
>     Not "VEB "?

Nice catch Sergei, I will wait a till this afternoon to respin the
patch series, just in case there are other changes needed that our
validation did not catch. :-)
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ