Re: [PATCH-for-5.0 10/12] hw/block/pflash: Check return value of blk_pwrite()

2020-04-14 Thread Mansour Ahmadi
Thank you for fixing the patch, Philippe! On Tue, Apr 14, 2020 at 9:31 AM Philippe Mathieu-Daudé wrote: > From: Mansour Ahmadi > > When updating the PFLASH file contents, we should check for a > possible failure of blk_pwrite(). Similar to commit 3a688294e. > > Signed-off-

[PATCH] When updating the PFLASH file contents, we should check for a possible failure of blk_pwrite(). Similar to 3a68829 commit

2020-04-07 Thread Mansour Ahmadi
Signed-off-by: Mansour Ahmadi --- hw/block/pflash_cfi01.c | 6 +- hw/block/pflash_cfi02.c | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 24f3bce7ef..31319cfd07 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw

Re: Potential missing checks

2020-03-24 Thread Mansour Ahmadi
Thanks for the explanation. On Tue, Mar 24, 2020 at 5:17 PM Peter Maydell wrote: > On Tue, 24 Mar 2020 at 20:39, Mansour Ahmadi wrote: > > > > Thank you for looking into this, Peter. I agree that static analysis has > false positives; that's why I called them potenti

Re: Potential missing checks

2020-03-24 Thread Mansour Ahmadi
/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/disas/arm.c#L2731-L2733 So I wonder whether a check on offset is really missed. Thank you! Mansour On Tue, Mar 24, 2020 at 5:24 AM Peter Maydell wrote: > On Mon, 23 Mar 2020 at 22:04, Mansour Ahmadi wrote: > > > > Hi QEMU developers, > > > > I not

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: https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f

Potential missing checks

2020-03-23 Thread Mansour Ahmadi
Hi QEMU developers, I noticed the following two potential missing checks by static analysis and detecting inconsistencies on the source code of QEMU. here is the result: 1) Missing check on offset: https://github.com/qemu/qemu/blob/c532b954d96f96d361ca31308f75f1b95bd4df76/disas/arm.c#L2728-L2733

Missing Frame initialization

2020-03-19 Thread Mansour Ahmadi
I originally reported this: In the case of badframe, user struct is not unlocked here and may lead to deadlock: https://github.com/qemu/qemu /blob/d4f7d56759f7c75270c13d5f3f5f736a9558929c/linux-user/m68k/signal.c#L380 In similar case, it in unlocked correctly: https://github.com/qemu/qemu /blob/

Re: Missing Null check

2020-03-18 Thread Mansour Ahmadi
Thanks for the fix! Best, Mansour On Wed, Mar 18, 2020 at 4:14 AM Philippe Mathieu-Daudé wrote: > On 3/17/20 9:40 PM, Mansour Ahmadi wrote: > > Is a NULL check on 'drv1->format_name' missing here? > > > https://github.com/qemu/qemu/blob/cc818a2148c5f321bdeb8e

Missing Null check

2020-03-17 Thread Mansour Ahmadi
Is a NULL check on 'drv1->format_name' missing here? https://github.com/qemu/qemu/blob/cc818a2148c5f321bdeb8e5564bdb2914e824600/block.c#L400-L403 if (!strcmp(drv1->format_name, format_name)) { While it is checked in similar case: https://github.com/qemu/qemu/blob/cc818a2148c5f321bdeb8e5564bdb2914