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: <CAMhs-H-OWe3WRQb1iBj2oSy1s5wzazSo4ce9Hd+wxKUivy+3aQ@mail.gmail.com>
Date: Sat, 13 Apr 2024 12:10:51 +0200
From: Sergio Paracuellos <sergio.paracuellos@...il.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: linux-pci@...r.kernel.org, bhelgaas@...gle.com, lpieralisi@...nel.org, 
	kw@...ux.com, robh@...nel.org, matthias.bgg@...il.com, 
	angelogioacchino.delregno@...labora.com, linux-mediatek@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: mt7621: Fix possible string truncation in snprintf

On Fri, Apr 12, 2024 at 11:33 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
>
> On Thu, Jan 11, 2024 at 09:27:04AM +0100, Sergio Paracuellos wrote:
> > The following warning appears when driver is compiled with W=1.
> >
> > CC      drivers/pci/controller/pcie-mt7621.o
> > drivers/pci/controller/pcie-mt7621.c: In function ‘mt7621_pcie_probe’:
> > drivers/pci/controller/pcie-mt7621.c:228:49: error: ‘snprintf’ output may
> > be truncated before the last format character [-Werror=format-truncation=]
> > 228 |         snprintf(name, sizeof(name), "pcie-phy%d", slot);
> >     |                                                 ^
> > drivers/pci/controller/pcie-mt7621.c:228:9: note: ‘snprintf’ output between
> > 10 and 11 bytes into a destination of size 10
> > 228 |         snprintf(name, sizeof(name), "pcie-phy%d", slot);
> >     |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Clean this up increasing destination buffer one byte.
> >
> > Reported-by: Bjorn Helgaas <helgaas@...nel.org>
> > Closes: https://lore.kernel.org/linux-pci/20240110212302.GA2123146@bhelgaas/T/#t
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@...il.com>
>
> Krzysztof applied this to pci/controller/mt7621 for v6.10, thanks!  I
> just pulled that branch into "next", so it should appear in the next
> linux-next.

Awesome. Thanks for letting me know.

Best regards,
    Sergio Paracuellos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ