Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp923912pxa; Sat, 22 Aug 2020 04:58:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSgllZtwdsrdYsYRfOuN8Cs4erXB7QkCAH6lbn6Gr9Dyw2sk+dtX451co/VMhF/C4CALSP X-Received: by 2002:a17:906:3f91:: with SMTP id b17mr6755121ejj.165.1598097525718; Sat, 22 Aug 2020 04:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598097525; cv=none; d=google.com; s=arc-20160816; b=PCOfB32tidOxhStibbqpssQhs/qQOCOYOM0R1NitcBccjXIMfWz8K5xuV4uU6Syhii NOTj3jQSDVsDdYVDuNWQfi5dLPbE6tuNBWCj9SUJFrDu9DZJwumNAw6eYjrqAd1q8cdr sTQ5+0QlqONkJvZM5aqIo8IdveSVYSkb9KsSx5u/DDOPHIYbxZjYQtkSAnE/BwSAuvYA c3HrzZ+0WN9j1eBKBXmTPOwbffgg/fj8wzRGeBWEEN8uD18t/7eZJqpKCRm1t42bZr+m IXk97/+zY1DrWf4C2QpKqfazrbGNZ4gmrXXchkWGapzdov+52GOgIrPCps+vn0pREA/R wk5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hvbjMBf8wiATslO6Ak2k4c/lPw2aiLp5EPMz+Nzt5l0=; b=VxfqNf+XgKrccMtNL5bU/NZgQycaAiyrITSgJlPwPMrDp9QfphUdcYcjZHbp25nfck 7e2RFFB7J/yj07ABUS695tRv6aLB0somCSTf8GRIfimQXVmj10z/6TL1isrglLe9F7aI pUbvk9R2aqK4uawuwcuRY+6JiovNr0f3GC9XEhdmCsCDPjH1vJklB5yOqaSkjBtIdmoe LqzKqVjYxiBt5wUyjw/HDyrXoFhitduCZW3wuw0DWJSKgMvS2nLG5ZfGvYNTvVWI8W5E x4X55wTuyJNoifChQv0RuhEzqolt0wTri9y3KZSjonDuOK0TTAy9D8B4ExOG+G3YQzSw RHUQ== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si2931088eja.241.2020.08.22.04.58.03; Sat, 22 Aug 2020 04:58:45 -0700 (PDT) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgHVL4o (ORCPT + 99 others); Sat, 22 Aug 2020 07:56:44 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37588 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbgHVL4k (ORCPT ); Sat, 22 Aug 2020 07:56:40 -0400 Received: by mail-wm1-f65.google.com with SMTP id x9so233806wmi.2 for ; Sat, 22 Aug 2020 04:56:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hvbjMBf8wiATslO6Ak2k4c/lPw2aiLp5EPMz+Nzt5l0=; b=C7GXAC3zSsCooawrM6IFNpgo8gqtYuqmRXf3hHwAO3mHFxLQ0TDHdEmHcsv9DTvADj tRDdSD88nqxOUDSeexVPGPTAY2lrEu+ldNwetcBG573URhrklI4rOgFQ+T06fnABF3HF 7CPlpo0gFNDbI8G7L6zcV4TV31RjodpgA48bSdPNZy7LFi+6Ffr1VkXdrmbGSRAbnC2/ Esci67f1tVynmE4kQnNVBn1VIL+5IlGRgChyQg30N2Vbn8I4HEyf/yht0YJfbREs2h4o w5JRGHs0Vj/YUVWNvkocsHI6abHDZ6kLv1NiBh8ecBaHNSfISEOhaFA5IGmhHvVswhNR l9tQ== X-Gm-Message-State: AOAM531w2/acLzASENFSpm6M0Xr8mAnXXo864v4YBZmjgm5VBigocGEy Jd6OPK+WMrcVUPEA6+95yGg= X-Received: by 2002:a1c:ed15:: with SMTP id l21mr7483728wmh.56.1598097398629; Sat, 22 Aug 2020 04:56:38 -0700 (PDT) Received: from kozik-lap ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id 145sm13188159wma.20.2020.08.22.04.56.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Aug 2020 04:56:38 -0700 (PDT) Date: Sat, 22 Aug 2020 13:56:36 +0200 From: Krzysztof Kozlowski To: Markus Mayer Cc: Florian Fainelli , Colin Ian King , BCM Kernel Feedback , Linux ARM Kernel , Linux Kernel Subject: Re: [PATCH v2] memory: brcmstb_dpfe: fix array index out of bounds Message-ID: <20200822115636.GA19975@kozik-lap> References: <20200821165221.32267-1-mmayer@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200821165221.32267-1-mmayer@broadcom.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 09:52:21AM -0700, Markus Mayer wrote: > We would overrun the error_text array if we hit a TIMEOUT condition, > because we were using the error code "ETIMEDOUT" (which is 110) as an > array index. > > We fix the problem by correcting the array index and by providing a > function to retrieve error messages rather than accessing the array > directly. The function includes a bounds check that prevents the array > from being overrun. > > This patch was prepared in response to > https://lkml.org/lkml/2020/8/18/505. > > Signed-off-by: Markus Mayer Your Signed-off-by does not match From field. Please run scripts/checkpatch on every patch you send. I fixed it up, assuming markus.mayer@broadcom.com is the valid email address. > Acked-by: Florian Fainelli > --- > > Changes since v1: > - Added link of the coverity report to the commit message. > - Added Florian's ack. > - Removed second "const" from get_error_text() return type Florian was so kind to provide you with necessary tags - Fixes and Reported-by. Always include them on resubmit of patches. Thanks, applied. Best regards, Krzysztof