Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp945908pxb; Wed, 3 Mar 2021 22:04:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRo4bhNd63Dw0+vXcKOKjcdpHB1fGB6rgC9PNNYtiKVcjpG99Q4Tjv2irwP9fHXgIeDWLg X-Received: by 2002:a17:906:1c13:: with SMTP id k19mr2433425ejg.457.1614837867366; Wed, 03 Mar 2021 22:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837867; cv=none; d=google.com; s=arc-20160816; b=ZRJe+ux1yvAyJmvtZKu/3c0ujhEcr/Oqt5LMV6pqfNxS1LWwxoyLt7WbB16VII7DNx B70VsQjqKYBEsC9Kb6ftZRo/H1mYiayKyYqd2n8xblQrhWn71xbv6rJAoqKZarynvLm2 8BXSks7K75GDU8GS/g8pt0I/lWGnLfw80ASrw2MwzEDExf5HkuB6Ro2C2bZ5Yi0X6yu7 vWD9+6/Q1MRheckTKuauEUg7KIkBCDNTGaPbiCpFxvXudUmTD/PgxxA7AogREgf2Xdp+ Sm0/8NkIo/QVm3AGP6ygEvT12y3aZsxC25IiikOAbQRfqU6GG7TfEN4BKWmI741xywnY rIkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4kvnUb+w9Et3ZvtkEoWaDS6+RlUDDMU6J+AJxmEVPi8=; b=Yw+8m3C5EJ1vIYQwZ+jP+9JOHrcNLIqTxvrs19RDXAfXSYHTR6dwNxxEDbsmIQ+Gmh G+ixL0qGpAi8y7kP8YKxfS3kisa8xYQdDgnImQEF70ESUFebbDkM6JsVri6rQHhr94tc NnGGx1x4jB+S0+GbfetrrUckRF7cwP1YtVIVAqR08cQZXSGUBFyVC+nRrLaeDKTy/+XF D9tCKHzj/GvrWQ9etPSILKHqeJaVgakiAicXHrKJNEZB3uIiJDUUAeorb2BLqu4dfbuu 5w0C14WUf0m/Ijc08akIIVtgkIC2UdoElYbpsoYcvtIBJ60GFlieLYqTj9rcME86jg7B mZfg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si3428820edr.103.2021.03.03.22.04.04; Wed, 03 Mar 2021 22:04:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382290AbhCBJIp (ORCPT + 99 others); Tue, 2 Mar 2021 04:08:45 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:45419 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382093AbhCBIza (ORCPT ); Tue, 2 Mar 2021 03:55:30 -0500 Received: from cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net ([80.193.200.194] helo=[192.168.0.210]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lH0nC-0004i8-Bt; Tue, 02 Mar 2021 08:54:10 +0000 Subject: Re: [PATCH] memory: gpmc: fix out of bounds read and dereference on gpmc_cs[] To: Krzysztof Kozlowski Cc: Roger Quadros , Tony Lindgren , linux-omap@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210223193821.17232-1-colin.king@canonical.com> <20210302084402.4qw7ltj4ivcoxs4t@kozik-lap> From: Colin Ian King Message-ID: <0dc9ab31-85ce-5e66-f18b-f15436784ae9@canonical.com> Date: Tue, 2 Mar 2021 08:54:09 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210302084402.4qw7ltj4ivcoxs4t@kozik-lap> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/2021 08:44, Krzysztof Kozlowski wrote: > On Tue, Feb 23, 2021 at 07:38:21PM +0000, Colin King wrote: >> From: Colin Ian King >> >> Currently the array gpmc_cs is indexed by cs before it cs is range checked >> and the pointer read from this out-of-index read is dereferenced. Fix this >> by performing the range check on cs before the read and the following >> pointer dereference. >> >> Addresses-Coverity: ("Negative array index read") >> Fixes: 186401937927 ("memory: gpmc: Move omap gpmc code to live under drivers") >> Signed-off-by: Colin Ian King >> --- >> drivers/memory/omap-gpmc.c | 7 +++++-- > > Thanks, applied with Tony's ack and changed Fixes to 9ed7a776eb50 ("ARM: > OMAP2+: Fix support for multiple devices on a GPMC chip select"). Thanks for correcting the Fixes line > > Best regards, > Krzysztof >