From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org, bhelgaas@google.com,
lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: mt7621: Fix possible string truncation in snprintf
Date: Sat, 13 Apr 2024 12:10:51 +0200 [thread overview]
Message-ID: <CAMhs-H-OWe3WRQb1iBj2oSy1s5wzazSo4ce9Hd+wxKUivy+3aQ@mail.gmail.com> (raw)
In-Reply-To: <20240412213328.GA19361@bhelgaas>
On Fri, Apr 12, 2024 at 11:33 PM Bjorn Helgaas <helgaas@kernel.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@kernel.org>
> > Closes: https://lore.kernel.org/linux-pci/20240110212302.GA2123146@bhelgaas/T/#t
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.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
next prev parent reply other threads:[~2024-04-13 10:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 8:27 [PATCH] PCI: mt7621: Fix possible string truncation in snprintf Sergio Paracuellos
2024-02-23 11:24 ` Sergio Paracuellos
2024-04-11 9:12 ` Sergio Paracuellos
2024-04-12 21:33 ` Bjorn Helgaas
2024-04-13 10:10 ` Sergio Paracuellos [this message]
2024-05-17 11:29 ` Krzysztof Wilczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMhs-H-OWe3WRQb1iBj2oSy1s5wzazSo4ce9Hd+wxKUivy+3aQ@mail.gmail.com \
--to=sergio.paracuellos@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).