Re: [PATCH] pci: fix overflow in snprintf string formatting

2022-05-31 Thread Michael S. Tsirkin
On Tue, May 31, 2022 at 01:47:07PM +0200, Claudio Fontana wrote: > the code in pcibus_get_fw_dev_path contained the potential for a > stack buffer overflow of 1 byte, potentially writing to the stack an > extra NUL byte. > > This overflow could happen if the PCI slot is >= 0x1000, > and the PC

Re: [PATCH] pci: fix overflow in snprintf string formatting

2022-05-31 Thread Ani Sinha
On Tue, May 31, 2022 at 6:15 PM Claudio Fontana wrote: > > On 5/31/22 14:26, Ani Sinha wrote: > > On Tue, May 31, 2022 at 5:20 PM Claudio Fontana wrote: > >> > >> the code in pcibus_get_fw_dev_path contained the potential for a > >> stack buffer overflow of 1 byte, potentially writing to the stac

Re: [PATCH] pci: fix overflow in snprintf string formatting

2022-05-31 Thread Claudio Fontana
On 5/31/22 14:26, Ani Sinha wrote: > On Tue, May 31, 2022 at 5:20 PM Claudio Fontana wrote: >> >> the code in pcibus_get_fw_dev_path contained the potential for a >> stack buffer overflow of 1 byte, potentially writing to the stack an >> extra NUL byte. >> >> This overflow could happen if the PCI

Re: [PATCH] pci: fix overflow in snprintf string formatting

2022-05-31 Thread Ani Sinha
On Tue, May 31, 2022 at 5:20 PM Claudio Fontana wrote: > > the code in pcibus_get_fw_dev_path contained the potential for a > stack buffer overflow of 1 byte, potentially writing to the stack an > extra NUL byte. > > This overflow could happen if the PCI slot is >= 0x1000, > and the PCI functi

[PATCH] pci: fix overflow in snprintf string formatting

2022-05-31 Thread Claudio Fontana
the code in pcibus_get_fw_dev_path contained the potential for a stack buffer overflow of 1 byte, potentially writing to the stack an extra NUL byte. This overflow could happen if the PCI slot is >= 0x1000, and the PCI function is >= 0x1000, due to the size parameter of snprintf being inco