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]
Message-ID: <83c5d23982cd8eb481a6ff2848925331.squirrel@www.codeaurora.org>
Date:	Tue, 10 Mar 2015 10:20:54 -0000
From:	"Gilad Broner" <gbroner@...eaurora.org>
To:	"Akinobu Mita" <akinobu.mita@...il.com>
Cc:	"Gilad Broner" <gbroner@...eaurora.org>,
	"Jej B" <james.bottomley@...senpartnership.com>,
	"LKML" <linux-kernel@...r.kernel.org>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	linux-arm-msm@...r.kernel.org, "Santosh Y" <santoshsy@...il.com>,
	linux-scsi-owner@...r.kernel.org,
	"Subhash Jadavani" <subhashj@...eaurora.org>,
	"Yaniv Gardi" <ygardi@...eaurora.org>,
	"Dolev Raviv" <draviv@...eaurora.org>,
	"Sujit Reddy Thumma" <sthumma@...eaurora.org>,
	"Vinayak Holikatti" <vinholikatti@...il.com>,
	"James E.J. Bottomley" <jbottomley@...allels.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	"Ingo Molnar" <mingo@...nel.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	"Davidlohr Bueso" <davidlohr@...com>,
	"Andi Kleen" <ak@...ux.intel.com>,
	"Alexei Starovoitov" <ast@...mgrid.com>,
	"Joonsoo Kim" <iamjoonsoo.kim@....com>,
	"Al Viro" <viro@...iv.linux.org.uk>,
	"Dan Streetman" <ddstreet@...e.org>
Subject: Re: [PATCH v4 4/4] scsi: ufs: inject errors to verify error
 handling

>> +static bool inject_cmd_hang_tr(struct ufs_hba *hba)
>> +{
>> +       int tag;
>> +
>> +       tag = find_first_bit(&hba->outstanding_reqs, hba->nutrs);
>> +       if (tag == hba->nutrs)
>> +               return 0;
>> +
>> +       __clear_bit(tag, &hba->outstanding_reqs);
>> +       hba->lrb[tag].cmd = NULL;
>> +       __clear_bit(tag, &hba->lrb_in_use);
>
> hba->lrb_in_use is a bitmap set by test_and_set_bit_lock().  So
> this should be cleared by clear_bit_unlock().

You are correct. Thanks.

>
> And as soon as the bit corresponds to this slot in hba->lrb_in_use is
> cleared, this slot could be reused.  But if the request corresponds
> to the slot is not completed yet, it could sacrifice the new request,
> too.  So should we only inject into the commands which have been
> completed like this?

Please note that we only clear the bit in hba->lrb_in_use. scsi_done is
not called for this request. Therefore, the tag is not yet free in the
block layer and next calls for queuecommand will not pass down this tag to
be used in the UFS driver. So there is no danger of a new request being
sacrificed.

On a different note, we are debating internally on a few other changes so
until we consolidate those I will drop this patch with error injection.

Gilad.

-- 
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ