Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp345842pxu; Thu, 7 Jan 2021 06:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQPdMk+gP1Ib5a0z+CCw21ya1jWDRGcbbXluTLDdWbibjs2tpga0s31jIGRcDl+puZr5K1 X-Received: by 2002:a05:6402:b42:: with SMTP id bx2mr1871485edb.117.1610030189092; Thu, 07 Jan 2021 06:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030189; cv=none; d=google.com; s=arc-20160816; b=vHn9VEdClnDlD0x8Svlv8oTXZd/OjoeFzgUfmt0VeQnAnBCQNRMzRDMYVmfK5yOAeW BPzDr2PSeoycu+1AHGkrTLpeXyNCj6KilhTik9pBWWvMJpuexfYylnqpC9niMScLTn/k aSEC5dRifWus+EQtOwcdkp5io1cdQivxRY5KcDbH38KUKbX5zoalGww3sZZwvc0l+9Lp kKNfVTIroN5MpHxaf5UaHu2V8t+Hj8/EteGpVmtuQcbiBzPd0W0DfbIYxb898oaUWIH1 cPe+D1fQFnqzXe42bKIleIlU/5nOiZLc0AStiKFa35pVMPoZmHnZ/sfNYg/U8U8a+TVz Xlaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MLzEcXtRK6bRva0YAZ6kvMzLMc6UfKjgcmHNYvIAOnY=; b=x/OdsqYAW75RuBrOTRfNUz+jg1xJA8uIb7aTHcOES11Sxtm4ZTQ16TAdInTElrN34N hhQiGvSF97hzgv6Ae28Mm2OzzdfkYWIvacv7FtTZaZA9VHFFk7faXcpIFvUl4FMnJU8v mukzfEKQ5Hkycbyk/Qv55OZ+pM0DxOdFBEG2GqxVoUbDOYnFgZYZu0LN5CWm9I+TrqUc 6Tvsixpk5QCc/Wg9Arxk/gmQIPRBZz7Q1ZxuN4qt0DddGEAFdDNnQXMa+VBYZ5AlyT2Y RvREWMq4DpzGvtd7BuRoFeibVjebE1F0U5Cdm8+0j9f+G9CFbhYvLnuuFFTJCwll+CQ2 R3AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e4lvW9Dl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si2613939edu.567.2021.01.07.06.36.05; Thu, 07 Jan 2021 06:36:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e4lvW9Dl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729363AbhAGOce (ORCPT + 99 others); Thu, 7 Jan 2021 09:32:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:46546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728900AbhAGOca (ORCPT ); Thu, 7 Jan 2021 09:32:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD8A222EBF; Thu, 7 Jan 2021 14:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029898; bh=rPRQ3pzV7T0PxSA5dDEwdAlRxQPSEzsjJqwqO/lPBT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e4lvW9DlSynzFTSXBcArGdzD2T4kgd9AWZ440SUp5jyU5PNHotT8IrOU71zuu9vGp pdTO8BES6MEzFn8zag+y6qjs7nNUY7HfAn38ivTbQMpmPmfALSkERq9ye0H25lhJP8 vx2Ury7z2frK3nk/LI3+vhyRbmqLdQ+afkVp9eMs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Miquel Raynal , Felix Fietkau Subject: [PATCH 4.19 1/8] Revert "mtd: spinand: Fix OOB read" Date: Thu, 7 Jan 2021 15:32:01 +0100 Message-Id: <20210107143047.732584985@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143047.586006010@linuxfoundation.org> References: <20210107143047.586006010@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau This reverts stable commit baad618d078c857f99cc286ea249e9629159901f. This commit is adding lines to spinand_write_to_cache_op, wheras the upstream commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 that this was supposed to backport was touching spinand_read_from_cache_op. It causes a crash on writing OOB data by attempting to write to read-only kernel memory. Cc: Miquel Raynal Signed-off-by: Felix Fietkau Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/spi/core.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -378,10 +378,6 @@ static int spinand_write_to_cache_op(str } } - if (req->ooblen) - memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs, - req->ooblen); - return 0; }