[PULL 01/22] hw/net/spapr: prevent potential NULL dereference

2024-07-01 Thread Philippe Mathieu-Daudé
From: Oleg Sviridov Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov Message-ID: <20240531073636.3779559-1-oleg.sviri...@red-soft.ru>

Re: [PATCH v2] hw/net: prevent potential NULL dereference

2024-07-01 Thread Philippe Mathieu-Daudé
On 31/5/24 09:36, Oleg Sviridov wrote: Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- v2: Debug message added hw/net/spapr_llan.c

[PATCH v2] hw/net: prevent potential NULL dereference

2024-05-31 Thread Oleg Sviridov
Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- v2: Debug message added hw/net/spapr_llan.c | 6 ++ 1 file changed, 6

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-30 Thread David Gibson
On Thu, May 30, 2024 at 10:03:51AM +0100, Peter Maydell wrote: > On Thu, 30 May 2024 at 01:52, David Gibson > wrote: > > > > On Wed, May 29, 2024 at 02:07:18PM +0300, Oleg Sviridov wrote: > > > Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and > > > is dereferenced

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-30 Thread Олег Свиридов
Thanks for review. Would it be correct to use hcall_dprintf() as in other functions of the module? For example, in h_add_logical_lan_buffer(). Best regards, Oleg. 29.05.2024 16:52, Philippe Mathieu-Daudé пишет: On 29/5/24 13:07, Oleg Sviridov wrote: Pointer, returned from function

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-30 Thread Peter Maydell
On Thu, 30 May 2024 at 01:52, David Gibson wrote: > > On Wed, May 29, 2024 at 02:07:18PM +0300, Oleg Sviridov wrote: > > Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is > > dereferenced immediately after. > > > > Found by Linux Verification Center (linuxtesting.org)

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-29 Thread David Gibson
On Wed, May 29, 2024 at 02:07:18PM +0300, Oleg Sviridov wrote: > Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is > dereferenced immediately after. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Oleg Sviridov > --- >

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-29 Thread Philippe Mathieu-Daudé
On 29/5/24 13:07, Oleg Sviridov wrote: Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- hw/net/spapr_llan.c | 4 1 file

Re: [PATCH] hw/s390x: prevent potential NULL dereference

2024-05-29 Thread Philippe Mathieu-Daudé
Hi Oleg, On 29/5/24 13:36, Oleg Sviridov wrote: Pointer, returned from function 's390_ipl_get_iplb_pv', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- hw/s390x/ipl.c | 11 ++- 1

[PATCH] hw/net: prevent potential NULL dereference

2024-05-29 Thread Oleg Sviridov
Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- hw/net/spapr_llan.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH] hw/s390x: prevent potential NULL dereference

2024-05-29 Thread Oleg Sviridov
Pointer, returned from function 's390_ipl_get_iplb_pv', may be NULL and is dereferenced immediately after. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov --- hw/s390x/ipl.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff

Re: Potential Null dereference

2020-03-24 Thread Kevin Wolf
Am 24.03.2020 um 13:37 hat Vladimir Sementsov-Ogievskiy geschrieben: > 24.03.2020 14:59, Vladimir Sementsov-Ogievskiy wrote: > > Aha, new crashes! Let's look at them. > > > > 41 and 155 failed with crash, 141 without but I see "+{"error": {"class": > > "GenericError", "desc": "Block device drv0

Re: Potential Null dereference

2020-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2020 14:59, Vladimir Sementsov-Ogievskiy wrote: 24.03.2020 12:50, Kevin Wolf wrote: Am 24.03.2020 um 08:14 hat Philippe Mathieu-Daudé geschrieben: On 3/24/20 4:05 AM, Mansour Ahmadi wrote: Hi, Nullness of  needs to be checked here:

Re: Potential Null dereference

2020-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2020 12:50, Kevin Wolf wrote: Am 24.03.2020 um 08:14 hat Philippe Mathieu-Daudé geschrieben: On 3/24/20 4:05 AM, Mansour Ahmadi wrote: Hi, Nullness of  needs to be checked here: https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/block/commit.c#L221

Re: Potential Null dereference

2020-03-24 Thread Kevin Wolf
Am 24.03.2020 um 08:14 hat Philippe Mathieu-Daudé geschrieben: > On 3/24/20 4:05 AM, Mansour Ahmadi wrote: > > Hi, > > > > Nullness of  needs to be checked here: > > https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/block/commit.c#L221 > > > > pstrcpy(bs->exact_filename,

Re: Potential Null dereference

2020-03-24 Thread Philippe Mathieu-Daudé
On 3/24/20 4:05 AM, Mansour Ahmadi wrote: Hi, Nullness of  needs to be checked here: https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/block/commit.c#L221 pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),... While it is done at 2 other locations:

Potential Null dereference

2020-03-23 Thread Mansour Ahmadi
Hi, Nullness of needs to be checked here: https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/block/commit.c#L221 pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),... While it is done at 2 other locations:

[Qemu-devel] [PULL 01/11] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-18 Thread Cornelia Huck
From: Li Qiang When getting the 'pbdev', the if...else has no default branch. >From Coverity, the 'pbdev' maybe null when the 'dev' is not the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. This patch adds a default branch for device plug and unplug. Spotted by Coverity: CID 1398593

Re: [Qemu-devel] [PATCH v3] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-10 Thread Cornelia Huck
On Tue, 8 Jan 2019 07:11:14 -0800 Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > This patch adds a default branch for device plug and

Re: [Qemu-devel] [PATCH v3] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-09 Thread Collin Walling
On 1/8/19 10:11 AM, Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > This patch adds a default branch for device plug and unplug. > > Spotted

Re: [Qemu-devel] [PATCH v3] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-08 Thread Halil Pasic
On Tue, 8 Jan 2019 07:11:14 -0800 Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > This patch adds a default branch for device plug and

Re: [Qemu-devel] [PATCH v3] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-08 Thread David Hildenbrand
On 08.01.19 16:11, Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > This patch adds a default branch for device plug and unplug. > > Spotted

[Qemu-devel] [PATCH v3] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-08 Thread Li Qiang
When getting the 'pbdev', the if...else has no default branch. >From Coverity, the 'pbdev' maybe null when the 'dev' is not the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. This patch adds a default branch for device plug and unplug. Spotted by Coverity: CID 1398593 Signed-off-by: Li

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread 李强
At 2019-01-08 00:10:29, "Cornelia Huck" wrote: >On Mon, 7 Jan 2019 16:04:35 + >Peter Maydell wrote: > >> On Mon, 7 Jan 2019 at 15:57, Cornelia Huck wrote: >> > On Mon, 7 Jan 2019 15:54:21 + >> > Peter Maydell wrote: >> > > On Mon, 7 Jan 2019 at 15:48, Cornelia Huck wrote: >> > >

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread Cornelia Huck
On Mon, 7 Jan 2019 16:04:35 + Peter Maydell wrote: > On Mon, 7 Jan 2019 at 15:57, Cornelia Huck wrote: > > On Mon, 7 Jan 2019 15:54:21 + > > Peter Maydell wrote: > > > On Mon, 7 Jan 2019 at 15:48, Cornelia Huck wrote: > > > > Sounds good. But please return anyway in the unplug

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread Peter Maydell
On Mon, 7 Jan 2019 at 15:57, Cornelia Huck wrote: > On Mon, 7 Jan 2019 15:54:21 + > Peter Maydell wrote: > > On Mon, 7 Jan 2019 at 15:48, Cornelia Huck wrote: > > > Sounds good. But please return anyway in the unplug case, so that the > > > code is fine if asserts have been configured out.

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread Cornelia Huck
On Mon, 7 Jan 2019 15:54:21 + Peter Maydell wrote: > On Mon, 7 Jan 2019 at 15:48, Cornelia Huck wrote: > > > > On Fri, 4 Jan 2019 22:33:51 +0800 > > Li Qiang wrote: > > > > > What do you think of ‘g_assert_not_reached();’. For example: > > > > > > else { > > >

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread Peter Maydell
On Mon, 7 Jan 2019 at 15:48, Cornelia Huck wrote: > > On Fri, 4 Jan 2019 22:33:51 +0800 > Li Qiang wrote: > > > What do you think of ‘g_assert_not_reached();’. For example: > > > > else { > > g_assert_not_reached(); > > } > > Sounds good. But please return anyway in the unplug case, so that

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread Cornelia Huck
On Fri, 4 Jan 2019 22:33:51 +0800 Li Qiang wrote: > What do you think of ‘g_assert_not_reached();’. For example: > > else { > g_assert_not_reached(); > } Sounds good. But please return anyway in the unplug case, so that the code is fine if asserts have been configured out.

Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-07 Thread Cornelia Huck
On Fri, 4 Jan 2019 16:05:15 +0100 Halil Pasic wrote: > On Fri, 4 Jan 2019 15:10:05 +0100 > Cornelia Huck wrote: > > > On Thu, 3 Jan 2019 07:16:12 -0800 > > Li Qiang wrote: > > > > > When getting the 'pbdev', the if...else has no default branch. > > > From Coverity, the 'pbdev' maybe null

Re: [Qemu-devel] [qemu-s390x] 答复: [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-07 Thread David Hildenbrand
On 04.01.19 15:33, Li Qiang wrote: > What do you think of ‘g_assert_not_reached();’. For example: > >   > > else { > > g_assert_not_reached(); > > } > I agree, if thisever happens, it is a serious programming error, not an error to report to the user. (after all, he did nothing wrong)

Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-04 Thread Halil Pasic
On Fri, 4 Jan 2019 15:10:05 +0100 Cornelia Huck wrote: > On Thu, 3 Jan 2019 07:16:12 -0800 > Li Qiang wrote: > > > When getting the 'pbdev', the if...else has no default branch. > > From Coverity, the 'pbdev' maybe null when the 'dev' is not > > the

[Qemu-devel] 答复: [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-04 Thread Li Qiang
...@nongnu.org; qemu-devel@nongnu.org; peter.mayd...@linaro.org 主题: Re: [PATCH v2] s390: avoid potential null dereference ins390_pcihost_unplug() On Thu, 3 Jan 2019 07:16:12 -0800 Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' mayb

Re: [Qemu-devel] [PATCH v2] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-04 Thread Cornelia Huck
On Thu, 3 Jan 2019 07:16:12 -0800 Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > This patch adds a default branch for device plug and

Re: [Qemu-devel] [qemu-s390x] [PATCH] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-03 Thread Halil Pasic
On Thu, 3 Jan 2019 15:54:38 +0100 Cornelia Huck wrote: > On Thu, 3 Jan 2019 06:02:46 -0800 > Li Qiang wrote: > > > When getting the 'pbdev', the if...else has no default branch. > > From Coverity, the 'pbdev' maybe null when the 'dev' is not > > the

[Qemu-devel] 答复: [PATCH] s390: avoid potential null dereference ins390_pcihost_unplug()

2019-01-03 Thread Li Qiang
all...@linux.ibm.com; r...@twiddle.net; da...@redhat.com; pa...@linux.ibm.com; borntrae...@de.ibm.com; qemu-s3...@nongnu.org; qemu-devel@nongnu.org; peter.mayd...@linaro.org; Pierre Morel 主题: Re: [PATCH] s390: avoid potential null dereference ins390_pcihost_unplug() On Thu, 3 Jan 2019 06:02:46 -0800

[Qemu-devel] [PATCH v2] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-03 Thread Li Qiang
When getting the 'pbdev', the if...else has no default branch. >From Coverity, the 'pbdev' maybe null when the 'dev' is not the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. This patch adds a default branch for device plug and unplug. Spotted by Coverity: CID 1398593 Signed-off-by: Li

Re: [Qemu-devel] [PATCH] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-03 Thread Cornelia Huck
On Thu, 3 Jan 2019 06:02:46 -0800 Li Qiang wrote: > When getting the 'pbdev', the if...else has no default branch. > From Coverity, the 'pbdev' maybe null when the 'dev' is not > the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. > > Spotted by Coverity: CID 1398593 > > Signed-off-by:

[Qemu-devel] [PATCH] s390: avoid potential null dereference in s390_pcihost_unplug()

2019-01-03 Thread Li Qiang
When getting the 'pbdev', the if...else has no default branch. >From Coverity, the 'pbdev' maybe null when the 'dev' is not the TYPE_PCI_BRIDGE/TYPE_PCI_DEVICE/TYPE_S390_PCI_DEVICE. Spotted by Coverity: CID 1398593 Signed-off-by: Li Qiang --- hw/s390x/s390-pci-bus.c | 4 1 file changed, 4