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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Nov 2023 14:27:00 +0900
From:   "hoyoung seo" <hy50.seo@...sung.com>
To:     "'Bart Van Assche'" <bvanassche@....org>,
        <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <alim.akhtar@...sung.com>, <avri.altman@....com>,
        <jejb@...ux.ibm.com>, <martin.petersen@...cle.com>,
        <beanhuo@...ron.com>, <kwangwon.min@...sung.com>,
        <kwmad.kim@...sung.com>, <sh425.lee@...sung.com>,
        <sc.suh@...sung.com>, <quic_nguyenb@...cinc.com>,
        <cpgs@...sung.com>, <grant.jung@...sung.com>,
        <junwoo80.lee@...sung.com>
Subject: RE: [PATCH v2] scsi: ufs: core: fix racing issue during
 ufshcd_mcq_abort

> -----Original Message-----
> From: Bart Van Assche <bvanassche@....org>
> Sent: Wednesday, November 15, 2023 2:55 AM
> To: SEO HOYOUNG <hy50.seo@...sung.com>; linux-scsi@...r.kernel.org; linux-
> kernel@...r.kernel.org; alim.akhtar@...sung.com; avri.altman@....com;
> jejb@...ux.ibm.com; martin.petersen@...cle.com; beanhuo@...ron.com;
> kwangwon.min@...sung.com; kwmad.kim@...sung.com; sh425.lee@...sung.com;
> sc.suh@...sung.com; quic_nguyenb@...cinc.com; cpgs@...sung.com;
> grant.jung@...sung.com; junwoo80.lee@...sung.com
> Subject: Re: [PATCH v2] scsi: ufs: core: fix racing issue during
> ufshcd_mcq_abort
> 
> On 11/13/23 20:37, SEO HOYOUNG wrote:
> > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > index 9a730a794b66..55f4c0eeda7b 100644
> > --- a/drivers/ufs/core/ufshcd.c
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -7574,6 +7574,10 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba,
> int tag)
> >   		goto out;
> >   	}
> >
> > +	if (!ufshcd_cmd_inflight(lrbp->cmd) ||
> > +	    test_bit(SCMD_STATE_COMPLETE, &lrbp->cmd->state))
> > +		goto out;
> > +
> >   	err = ufshcd_clear_cmd(hba, tag);
> >   	if (err)
> >   		dev_err(hba->dev, "%s: Failed clearing cmd at tag %d,
> err %d\n",
> 
> The UFS driver must not set SCMD_STATE_COMPLETE itself. Only the SCSI core
> is allowed to set that bit.
> 
> Thanks,
> 
> Bart.

Hi,

The test_bit() function just check SCMD_STATE_COMPLETE bit state.
Do not set SCMD_STATE_COMPLETE field. 
This function is also used in ufshcd_mcq_compl_pending_transfer() 
to check the status of cmd.

Thanks.
BRs SEO.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ