From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=-9.4 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 37525C433E1 for ; Fri, 21 Aug 2020 03:16:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 03F3920732 for ; Fri, 21 Aug 2020 03:16:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vLR8M9Ak"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PzhO9ncA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03F3920732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6B/VHBvc8uFaeObmvxHsMX/MO91/NTSyImvILCcJo7w=; b=vLR8M9AkpykiS5BBA+YkwRkOF mW15gB05YzryI65NOu3ve8BSOiIWwP4438slsN88bTiAO0FpoznVWViEaNWM4FBbXKJYKkaVGprlj dS2bFxn2IrgJ7rPsQRlVQ3xi2Y+rgb9DdeuwKxJvR7/GQcuakWU5Af83gzUShjBJ9hb/d3yL2PxjB KmQY7YdirT6XqWL1NgdBxFo8nc4SL50wp8xN+BFtrgo37RM3iFJAvTgCISvg8nJuTd9YjdC+XOT2P jaa+SigA28IkEgqmqKiL9kBGdTCVU930prGLdYMw0XCnJa7Q4yYjubogEfE+a/BIhM50kFUMGbcKX m8vyeRnrg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8xWK-0002Nv-Nh; Fri, 21 Aug 2020 03:15:12 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8xWH-0002NH-Ro for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 03:15:10 +0000 Received: by mail-pf1-x444.google.com with SMTP id r11so363518pfl.11 for ; Thu, 20 Aug 2020 20:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NPD3616XB57t/FVPSE1MIPb/6y5Q2Omn2vwPwfWflGw=; b=PzhO9ncA3sVmo/DQCK1yFnnYfDC7EbLbawG+X1QPtp2igY86iA2PCijq7b6hg24fQU X4UshXapNgU3Y0hn5qREYZiSrjYT1DpCMJfN3c2TKC0Kl5fqle8Nq20IWQtWvefmjZcL GXLVBL2HZ/unl/Bvp3mJ1d99c2I7hTRS4Ugnpa31FfYUGSiCQVf3lRVMIHii8Gu1y1H9 jhMpv66AVsR6txh2IuGwhBG3Oj2N0oxdwWb8kBj1RCefly/HpcW065uT3Tcm+z6nnSe+ Qhe71oaoH7VKo0AQLpeKPAuN204RFCv2L7dMFufyGApdd4OuiiLgMDaYcIeCc89qqGul 79Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NPD3616XB57t/FVPSE1MIPb/6y5Q2Omn2vwPwfWflGw=; b=q78jClEj5o53OMK4Y3OyEWBQ5rNmdovWSqTIaKJPQ/DTVpnwVkIP3quQmYcig4go3x xmOLmY0x1bpgH3Kt1J8bT2zHS9SbILCFtF9psIZm4KJWCGzZK+ceVZKQWI+AXO1LHKfe mFhkXhvaZH+kKWJiDqk1JNX1lUhyX1QcqmChg8iTebWk2iS5p8yybw7iTOTCMnwSgxeA Csa0GiHIK7sEVk9BCr+PCpgFf56rRmTQdIu5B107ZWWoEdi0QUg2CuRnr2fbKtL/RG3p VYeKPhjRCPM0zerv80VmnXyceUUM88pPUxn91/beXgNqvrl9aVh5jgVunf+oqnTt+cjb 3tkw== X-Gm-Message-State: AOAM533lqslRPHeMTKugU0J550c/TadDAU/IfFtl1YdwZBIbNbgYTT07 mujsjlJmBvtWM7Unp3osLKw9rse2YaA= X-Google-Smtp-Source: ABdhPJzwxoK8aECaFkebpyovlwtH8h65ggA6AIq6kt36C8WFi4Wrgwhxa0TksOa+8GzYY7IbpFb1ng== X-Received: by 2002:a62:8c89:: with SMTP id m131mr784317pfd.288.1597979706054; Thu, 20 Aug 2020 20:15:06 -0700 (PDT) Received: from [192.168.1.3] (ip68-111-84-250.oc.oc.cox.net. [68.111.84.250]) by smtp.gmail.com with ESMTPSA id r186sm579432pfr.162.2020.08.20.20.15.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Aug 2020 20:15:05 -0700 (PDT) Subject: Re: [PATCH] memory: brcmstb_dpfe: fix array index out of bounds To: Markus Mayer , Colin Ian King , Krzysztof Kozlowski References: <20200821010333.20436-1-mmayer@broadcom.com> From: Florian Fainelli Message-ID: <66ec2e07-fbdb-fd8b-9c1e-5f7dc343c9fd@gmail.com> Date: Thu, 20 Aug 2020 20:15:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.1.1 MIME-Version: 1.0 In-Reply-To: <20200821010333.20436-1-mmayer@broadcom.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200820_231509_940822_837844BA X-CRM114-Status: GOOD ( 15.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: BCM Kernel Feedback , Linux Kernel , Linux ARM Kernel Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/20/2020 6:03 PM, 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. > > Signed-off-by: Markus Mayer Acked-by: Florian Fainelli Fixes: 2f330caff577 ("memory: brcmstb: Add driver for DPFE") Reported-by: Colin Ian King (Colin, was there a specific coverity ID you wanted to use?) -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel