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] [day] [month] [year] [list]
Date:   Mon, 12 Jun 2017 11:24:45 +0100
From:   John Garry <john.garry@...wei.com>
To:     Arnd Bergmann <arnd@...db.de>
CC:     kbuild test robot <lkp@...el.com>, <kbuild-all@...org>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        <linuxarm@...wei.com>, <linux-scsi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Christoph Hellwig <hch@...radead.org>,
        "Xiang Chen" <chenxiang66@...ilicon.com>
Subject: Re: [PATCH v5 03/23] scsi: hisi_sas: optimise the usage of
 hisi_hba.lock

On 12/06/2017 10:45, Arnd Bergmann wrote:
> On Mon, Jun 12, 2017 at 10:26 AM, John Garry <john.garry@...wei.com> wrote:
>> On 10/06/2017 21:44, kbuild test robot wrote:
>>
>>
>> I don't think that reusing flags variable is in error, as there would be no
>> nested spinlock at this point within the function.
>>
>> If it is not recommended or not permitted to reuse flags variable for
>> separate spinlocks, then that can be changed - I don't know.
>
> No, look again: coccinelle is right as the locks are nested in
> https://github.com/0day-ci/linux/blob/bf95e9cccde4af4ed2012a6ec44d48b545d5ffed/drivers/scsi/hisi_sas/hisi_sas_main.c#L1208
>
> dq->lock is already held and you acquire task->task_state_lock in
> line 1208, which overwrites the flags.
>
>       Arnd

Hi Arnd,

Ah, now I see. The error message mislead me, as I straight away checked 
hisi_sas_task_prep() which does the same locking and also reuses flags 
for spinlock_irqsave(), but it's safe here.

But, as you pointed out, the problem is in 
hisi_sas_internal_abort_task_exec().

A thought: it would be useful if coccinelle printed explicitly the 
function name which has the warning/error.

Thanks,
John

>
> .
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ