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-next>] [day] [month] [year] [list]
Message-ID: <ca06b94aa48a484d965744e64e17a4ef@hyperstone.com>
Date:   Tue, 19 Jul 2022 15:34:07 +0000
From:   Christian Loehle <CLoehle@...erstone.com>
To:     "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        Avri Altman <Avri.Altman@....com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        Linux MMC List <linux-mmc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] mmc: block: Dont report successful writes with errors

Be as conservative about successful write reporting to the
block layer for SPI as with normal SD and MMC.
That means on any errors bytes_xfered is ignored and the
whole write must be repeated.

Signed-off-by: Christian Loehle <cloehle@...erstone.com>
---
 drivers/mmc/core/block.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index f4a1281658db..63d1c05582a9 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1765,8 +1765,12 @@ static bool mmc_blk_status_error(struct request *req, u32 status)
 	struct mmc_queue *mq = req->q->queuedata;
 	u32 stop_err_bits;
 
+	/*
+	 * Either write timed out during busy and data->error is set
+	 * or we actually received a valid R2 and check for error bits.
+	 */
 	if (mmc_host_is_spi(mq->card->host))
-		return false;
+		return brq->data.error || !!status;
 
 	stop_err_bits = mmc_blk_stop_err_bits(brq);
 
-- 
2.36.1

Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ