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: <AM9PR04MB83970688661428BB1327A03B96959@AM9PR04MB8397.eurprd04.prod.outlook.com>
Date:   Mon, 25 Jul 2022 12:26:40 +0000
From:   Claudiu Manoil <claudiu.manoil@....com>
To:     Jules Maselbas <jmaselbas@...ray.eu>,
        Jakub Kicinski <kuba@...nel.org>
CC:     "David S. Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: ethtool generate a buffer overflow in strlen



> -----Original Message-----
> From: Jules Maselbas <jmaselbas@...ray.eu>
> Sent: Monday, July 25, 2022 3:20 PM
> To: Jakub Kicinski <kuba@...nel.org>
> Cc: Claudiu Manoil <claudiu.manoil@....com>; David S. Miller
> <davem@...emloft.net>; netdev@...r.kernel.org
> Subject: Re: ethtool generate a buffer overflow in strlen
> 
> On Fri, Jul 22, 2022 at 02:29:42PM -0700, Jakub Kicinski wrote:
> > On Fri, 22 Jul 2022 19:37:46 +0200 Jules Maselbas wrote:
> > > There is suspicious lines in the file
> drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:
> > >    { ENETC_PM0_R1523X, "MAC rx 1523 to max-octet packets" },
> > > and:
> > >    { ENETC_PM0_T1523X, "MAC tx 1523 to max-octet packets" },
> > >
> > > Where the string length is actually greater than 32 bytes which is more
> > > than the reserved space for the name. This structure is defined as
> > > follow:
> > >     static const struct {
> > >         int reg;
> > >         char name[ETH_GSTRING_LEN];
> > >     } enetc_port_counters[] = { ...
> > >
> > > In the function enetc_get_strings(), there is a strlcpy call on the
> > > counters names which in turns calls strlen on the src string, causing
> > > an out-of-bound read, at least out-of the string.
> > >
> > > I am not sure that's what caused the BUG, as I don't really know how
> > > fortify works but I thinks this might only be visible when fortify is
> > > enabled.
> > >
> > > I am not sure on how to fix this issue, maybe use `char *` instead of
> > > an byte array.
> >
> > Thanks for the report!
> Thanks for the replie :)
> 
> > I'd suggest to just delete the RMON stats in the unstructured API
> > in this driver and report them via
> >
> > 	ethtool -S eth0 --groups rmon
> I am not familiar with ethtool: I don't understand what you're
> suggesting. Would you mind giving some hints/links to what RMON stats
> are?
> 

I can do it if you're patient.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ