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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 EFFFAC65C20 for ; Mon, 8 Oct 2018 22:20:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE990205C9 for ; Mon, 8 Oct 2018 22:20:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE990205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbeJIFe0 (ORCPT ); Tue, 9 Oct 2018 01:34:26 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.182]:19679 "EHLO gateway32.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbeJIFe0 (ORCPT ); Tue, 9 Oct 2018 01:34:26 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 36E511A5BB for ; Mon, 8 Oct 2018 17:20:32 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 9dt9gFcuUBcCX9dt9gYk3O; Mon, 08 Oct 2018 17:20:31 -0500 X-Authority-Reason: nr=8 Received: from 174.206.93.92.rev.sfr.net ([92.93.206.174]:53268 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1g9dt8-00260C-JV; Mon, 08 Oct 2018 17:20:30 -0500 Date: Tue, 9 Oct 2018 00:20:28 +0200 From: "Gustavo A. R. Silva" To: Rob Herring , Mark Rutland , Kishon Vijay Abraham I , "David S. Miller" Cc: linux-kernel@vger.kernel.org, Quentin Schulz , "Gustavo A. R. Silva" Subject: [PATCH 0/2] phy: ocelot-serdes: fix out-of-bounds bug Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 92.93.206.174 X-Source-L: No X-Exim-ID: 1g9dt8-00260C-JV X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174.206.93.92.rev.sfr.net (embeddedor) [92.93.206.174]:53268 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset aims to fix an out-of-bounds bug in the phy-ocelot-serdes driver. Currently, there is an out-of-bounds read on array ctrl->phys, once variable i reaches the maximum array size of SERDES_MAX in the for loop. Quentin Schulz pointed out that SERDES_MAX is a valid value to index ctrl->phys. So, I updated SERDES_MAX to be SERDES6G_MAX + 1 in include/dt-bindings/phy/phy-ocelot-serdes.h. Then I changed the condition in the for loop from i <= SERDES_MAX to i < SERDES_MAX in order to complete the fix. The reason I'm sending this fix as series is because checkpatch reported an error when I first tried to integrate the whole solution into a singe patch. So, changes to dt-bindings should be sent as a separate patch. Thanks Gustavo A. R. Silva (2): dt-bindings: phy: Update SERDES_MAX to be SERDES_MAX + 1 phy: ocelot-serdes: fix out-of-bounds read drivers/phy/mscc/phy-ocelot-serdes.c | 4 ++-- include/dt-bindings/phy/phy-ocelot-serdes.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.7.4