Message ID | 20210416142047.6349-4-quanyang.wang@windriver.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=60Ah=JN=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A10EEC433B4 for <linux-arm-kernel@archiver.kernel.org>; Fri, 16 Apr 2021 14:25:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B0CF610CD for <linux-arm-kernel@archiver.kernel.org>; Fri, 16 Apr 2021 14:25:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B0CF610CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QvzgboIs9lTHXACz001BvbynEU+U0NZhbfKr7dSFq64=; b=dlQxB2Gi6ZMTc2qG1PsGRQ03Z 0NV1oeOym/3TXdI+45GCqEj6X4Ci4fwpR5BTTrqdQgtOJ1GkdhnbdGH6ht1PmVTP8xEwSzEG1FGpU ndJePYCEGNZ0bPGKro1rjc4PBa/GH9BK5MKmPTIkiFc27oc1r0pyh5pnwAb+gRCPP2/uslAKG2Sxm vA4AdIP5xzF9Mik1p/b0nj8UYSInV9bpBNorHh21Pqzj/REAe0Vjg8OiDfS8ehWzO3lbXw29CPiH6 LnWj8yLvq1QTs5Qzs+VN12WbEOUHKhJ/AufNCaxtKDxvK6Aq9TJKQM/k53P2+KeUHc1qssmPrUxri HLSKKAayQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXPN9-002Nf8-Ew; Fri, 16 Apr 2021 14:23:03 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXPMf-002Na3-HX for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 14:22:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=ZK2JV/4Ry5rEqiLLTPLjTpFF5XMXFyKUYVE7Bkdk8HU=; b=IKsor7YfSC6E0GXe3Ry4ucNvIK A8DaotuCmxwZVcRg+dA7so+5+6muuyEhDsNoBFIdpN5yL9hHIfxaQ1HPc5nkwXtq1hRPvutZna5/M aU+pT3dZR4JB9EUkq2Q5RTqZtoHTRp2lYX4PIRW+U41weeiJIiqCLcvTKf+VbITLT6qIXRkozChdI LMSU/38+b6Jv6fQOT054/JRcuusAohA1B9+z2dO7KsjvR7e03liX20GX5AVzZhPMt6X9ZOKEYWDSG otHIsvDiK4PshE+ibL3T83+xh7nzhiW2/vk0GiILxYTCMyYpLf16fSCBe3/coca7X1wt7x/F5WgNA p8cRmYfA==; Received: from mail-dm6nam12on2080.outbound.protection.outlook.com ([40.107.243.80] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXPMd-009RBJ-2F for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 14:22:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ah6ebubNZczza3DSQN+BwGBAgh8PkNIxzmLV1YZqTNT4mBzNwxDTB2KJFNbSYH7Y2JuA8sGTnfahj6FHuIl7OqiB3f0gX66axSGWcxU6MRGpDfdR7b2w+cCIn5pd+xb6lC73bka1mW0R5jr8kzGSCa+S2GvXRwGSo5SDF3zrJx7bVZSxgjsQqYKGh4u0d9fFfnjq608htggG87B7ZBwALbjoYQsGaPeRNemLZwUy2cLfOWK4bgE2ExiVg0JD4sURqU5DtgEfHMSGcHdRLBnxGdIYMCtQ0v7czCKJGW32I8xfmk+mAOXBMPnyzBIysHVS63ZKfgQF5mO7yrDHMB2fTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZK2JV/4Ry5rEqiLLTPLjTpFF5XMXFyKUYVE7Bkdk8HU=; b=Tl0WL9sHZ+fhBSejaVutU/GUAYf/Y+ZFwPrsr0gELInu5+xEa0u5OYo52A0GKg6fWRjt8Qb4mlDxt5SCvMgiu/8rWtGK/atVY+kQUtKetMK/Zl2nVywaP8Z2N8q1XvL+sdwC2IoNEyjUnCTpF0hrjrD/gFhaOXFO01nzQC8GdMNLGBb/wwizTd4n4P43AV5WWvukz/WMDWE5eAZ4qeiyFmZnda0SuL7svAypSZ1QyrFppkY+XcaTeaOtm8uRG/iyPU9ZspzzpIBeMaWqiAwge3jpOYKNsg6SaFTM87HNPKUk796LXqN+o/p+W55TqHBri9tOiCYNY2g3QTE2ikdx8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZK2JV/4Ry5rEqiLLTPLjTpFF5XMXFyKUYVE7Bkdk8HU=; b=EFqkaeNYzFImGl7DxTqQwr6SODrYehJM16umSmprLq2srVuLNHLrsIjMZWDJAA8cNWJTx95wW3HDE+pT/gESAXhJHzcx9/x8Psp+7ZJ77qHSlF5Xjstl4Jqf8yeVCjkysfTqKMO008WUajd9HwMBmtj4Hct+zROJKGJo1WSBhVc= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=windriver.com; Received: from CY4PR11MB0071.namprd11.prod.outlook.com (2603:10b6:910:7a::30) by CY4PR1101MB2264.namprd11.prod.outlook.com (2603:10b6:910:24::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.21; Fri, 16 Apr 2021 14:22:20 +0000 Received: from CY4PR11MB0071.namprd11.prod.outlook.com ([fe80::f45f:e820:49f5:3725]) by CY4PR11MB0071.namprd11.prod.outlook.com ([fe80::f45f:e820:49f5:3725%6]) with mapi id 15.20.3999.037; Fri, 16 Apr 2021 14:22:20 +0000 From: quanyang.wang@windriver.com To: Mark Brown <broonie@kernel.org>, Michal Simek <michal.simek@xilinx.com>, Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com> Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Quanyang Wang <quanyang.wang@windriver.com> Subject: [V2][PATCH 3/5] spi: spi-zynqmp-gqspi: Resolved slab-out-of-bounds bug Date: Fri, 16 Apr 2021 22:20:45 +0800 Message-Id: <20210416142047.6349-4-quanyang.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416142047.6349-1-quanyang.wang@windriver.com> References: <20210416142047.6349-1-quanyang.wang@windriver.com> X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HK2PR02CA0147.apcprd02.prod.outlook.com (2603:1096:202:16::31) To CY4PR11MB0071.namprd11.prod.outlook.com (2603:10b6:910:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-qwang2-d1.wrs.com (60.247.85.82) by HK2PR02CA0147.apcprd02.prod.outlook.com (2603:1096:202:16::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16 via Frontend Transport; Fri, 16 Apr 2021 14:22:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 721bc683-cad2-45fa-bd02-08d900e30bc3 X-MS-TrafficTypeDiagnostic: CY4PR1101MB2264: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <CY4PR1101MB226417629CBDB03BD0EFA467F04C9@CY4PR1101MB2264.namprd11.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vv0Tr0WWDONrHwBBWFE3oP1iuF3InHwwcYpN6LeJCGPsazWmffyoFUwoJZ1p229lZyIh/D9+xGfePnnr3Tr/xxlehtx4y1MBSPoqrTsKzoMG9FWY2Nz9g/dC0LkASlAj/lmfifbUymSQ+2f1/fzYd4+537GpWAMTS2I3l4GAaFS8QpCEp0wiPaDf2lC8v4JdQPRaJpHeanw9PIiMbG+XfoUiFy+L1M6HKPoadcI19EuPUajWp6QCLZ3HMkdfZ6NBcvMg2t5b148kihDPf9VUWSzGQ2UThTTNYhYFj1hvxjDRf6opMdkWKlipK5Qm0Nlh1g6qvrDETFlAjNdb7ck0LQLHh/u31OxLi5l3hJJrBXeUfLg6JofZvq6KZmzhDmNagCOtxBlax64Ob8abHNKZ7jsgPBJAp3SB5VjI+zyrpuK1JT9iil4zB3v2F1Snz1KuZ9zuPDkjRrNJv7Mp7B5acEMYPC5DBSXMRxAGUQ4/f7A0WXM6BQBNh4BbzssVvh4GiQKbhed3q57sERjkfacs1GfCvlKjUvtGQrxAzXSB5qAtXXgYlpqAX1Gao/G+4QGuEhSCIb4xGvEPKwFkr3oBFeM5HjmjAW8newjO+e1gf1EA9oU/pXQ2d3QwaRQVxvA9lzPJs3CkshyxvgwcfwJAhh3CP/ku9dcTmaf9gl+tUNI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB0071.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(366004)(396003)(39850400004)(346002)(86362001)(186003)(2906002)(38350700002)(38100700002)(316002)(6506007)(9686003)(6486002)(83380400001)(66946007)(8676002)(66556008)(66476007)(478600001)(16526019)(5660300002)(4326008)(26005)(6512007)(1076003)(52116002)(110136005)(956004)(6666004)(8936002)(107886003)(2616005)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: t+QXsiscE4XcfvIp0rDiFuV/xfegs7BPijmhszyNhFox+BPj4HZ/heJPBku2IUj7TG0Ghd15b91M5LyQUqkJI5Hu8YHZK5N9bySaoctZJU3oTXDZ2miQhdCmCpttZXNFD5hFzPE1XcdkoM2zv+y46RdTRv0pvQ5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HrNvAuZ5U5h9InFVoIkUfw+aust8P59gbZwJ4F/zf+z8UgPeAbYQNWIWJf4dEj6sw90l6mjz4jxVmlZPjcjFA+WV11ywWttf6XV1dnIC7Jj2EyQ X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 721bc683-cad2-45fa-bd02-08d900e30bc3 X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB0071.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2021 14:22:20.7337 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: awl/vHQ/0HQcKgIuhY7xzevHvtVcA1qINFlQiipOm06d7xpR4n6VYkH4h7aPTcpBUAkjFRAM9+k/zb3cpji5++sFoPwi5Qn0X0734K9ahI8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2264 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_072231_132966_06EEB8B4 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
spi: spi-zynqmp-gqspi: fix spi issues
|
expand
|
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 1146359528b9..2e2607b5dee9 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -509,17 +509,19 @@ static void zynqmp_qspi_filltxfifo(struct zynqmp_qspi *xqspi, int size) u32 count = 0, intermediate; while ((xqspi->bytes_to_transfer > 0) && (count < size) && (xqspi->txbuf)) { - memcpy(&intermediate, xqspi->txbuf, 4); - zynqmp_gqspi_write(xqspi, GQSPI_TXD_OFST, intermediate); - if (xqspi->bytes_to_transfer >= 4) { + memcpy(&intermediate, xqspi->txbuf, 4); xqspi->txbuf += 4; xqspi->bytes_to_transfer -= 4; + count += 4; } else { + memcpy(&intermediate, xqspi->txbuf, + xqspi->bytes_to_transfer); xqspi->txbuf += xqspi->bytes_to_transfer; xqspi->bytes_to_transfer = 0; + count += xqspi->bytes_to_transfer; } - count++; + zynqmp_gqspi_write(xqspi, GQSPI_TXD_OFST, intermediate); } }