Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4214424pxf; Tue, 30 Mar 2021 02:07:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBk4kl7510oJCPM4ShMV1Ykn19bMqh5fp/xcv9MKsZYSzSepH0Ctb360kQa02BX4tG6vm/ X-Received: by 2002:aa7:cf14:: with SMTP id a20mr32422378edy.49.1617095237300; Tue, 30 Mar 2021 02:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617095237; cv=none; d=google.com; s=arc-20160816; b=W3r8ZuqnXd2KlzZq81VS6wBtmLL1KM9jhxLGBQS8qEA0/hpDjUMlz++2Xfc9EeaBH/ fIH5iWYqXgXUiX2cjMzPWfXKWOhWv9drZDTMPeMv6GyslqWxZ4nKZaY5oNDp48+S9SWU 1vhPB6zTvb3zxvGl3mszSq8C+/oUeR+rX2ESskq65eNhpE0547xFFsAV22XRlIDEphbm aeDSbdFESq6j7Dm+34JisLkeoWqACHwF2KvEeAXYMgOpMZLPAt2PZwCumUuDMKb7dbr2 MaVxm59z0jlwikbERGyJsuyR2DKgYOE6TTKSPt4ZwqXhmwoyH8CujJvmoE+yggMKRQGU uNLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bhMwS+KZWoNSuCH0L/B/6kxRevZq3yjRIpEofoQe3h4=; b=yhnFZTHsuhEKoEIN4DsbVlcc723ssTySeJJ/Chg6xsYfp/cFrx6gcilGQPAfFcLx5e cpu1BSQ0xgzCDloQDyAAv88kraQ6CzPjMToXMkdHW42C421QbFE58fheZAtUWN72JtLC I3t2CCiwWS/fKMBQ6SMvIFd3ee60VMWSpnfNd19Euv/sTvF/raxAlzLjYtjOXoTxgvyK KZfFi7HgIUs+w7q2K145zPxt1J3TufewAUqLvnAmmEV/y2VEXF8lItYAAi1q1l8h0ZrS xK5FOsozO+ZIDHOriLVjFfikMnd1QPYIHJNfGf4H5wxWswCjWAvBVFuiTZqswJXVsEO1 jIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0rdgisK; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si15965044edr.396.2021.03.30.02.06.53; Tue, 30 Mar 2021 02:07:17 -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; dkim=pass header.i=@linaro.org header.s=google header.b=s0rdgisK; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbhC3JFe (ORCPT + 99 others); Tue, 30 Mar 2021 05:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbhC3JFE (ORCPT ); Tue, 30 Mar 2021 05:05:04 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3796C061764 for ; Tue, 30 Mar 2021 02:05:03 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id d12so1595569lfv.11 for ; Tue, 30 Mar 2021 02:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bhMwS+KZWoNSuCH0L/B/6kxRevZq3yjRIpEofoQe3h4=; b=s0rdgisKhyiiIQzZ2gTtOTAZR6nj/1KZy8XQdmRB0M2uDqRzLTDtpe3EJZAUnzknfT 3yqi+zZddfkwUlPdrETqfL+D371di91JdWPTxT+xkW003tAr3DQthoaJGl9rNniY3m6o i4Pw4h1JPWaPkTclVI3MjnF2D+rf0ZK0VSzD4lPpNAg7SRCWPWrmToDZ1E/Eo/YGF/4T GAM+6gDQZRlWAbiM/cszUg6zLObsCEaI1zziCuv830RyQc1jsvXtzT4yNfyVx5QbwsN2 1CbkAUM3AoHNEv+mnCgneiA/WuYAeBudhggpD32st0xhvCkES4FhYfb8+mIhdhdoSAmb aQ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bhMwS+KZWoNSuCH0L/B/6kxRevZq3yjRIpEofoQe3h4=; b=JCwbavXsiiE7/gF3A4x+iioUJCygcwLHlW0GsMuImphxRRg6hc0y+ojuJ5fKvqsrRf ihAdNpN6hQdGpMCvkEtSYr+Z1ojZPRDY78sIruLTHCbwWsv+nLB5Bkb/2zlZQXMz6WRE tLJTLebs/UmAm5zeuJHX0kqx6ClNxk3N7TsP7GAg124yBT+tUTFsQGGwRk0zgjiJwGho DBPbvuHXaKOorRGe28sm1Ba4Yv6nEBB9E3aeoZBq58TGrnDNnYNqlSR0DWo7m9z1hzNS bmlom+GOIL4VtVFTzfQsSKjX6fzW9UNabUiGXj46jXr0Zx+r4GNzI2hIUClp5G8XwZmg ECmQ== X-Gm-Message-State: AOAM533Cv6vdJ6JrM6P0DrxOTv4eFCCmUuEFwIj4i8yucMTRHwA7KdmQ TERZEo9KAtd9lSCAUBJa+ifgd4RoU26/v4rkP87JUQ== X-Received: by 2002:a19:4c08:: with SMTP id z8mr18246243lfa.157.1617095102073; Tue, 30 Mar 2021 02:05:02 -0700 (PDT) MIME-Version: 1.0 References: <20210323131002.2418896-1-arnd@kernel.org> <87h7kv5h9b.fsf@microchip.com> In-Reply-To: <87h7kv5h9b.fsf@microchip.com> From: Linus Walleij Date: Tue, 30 Mar 2021 11:04:50 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: microchip: fix array overflow To: Lars Povlsen Cc: Arnd Bergmann , Steen Hegelund , Microchip Linux Driver Support , Arnd Bergmann , Zou Wei , Linux ARM , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , "Gustavo A . R . Silva" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 28, 2021 at 7:18 PM Lars Povlsen wrote: > Linus Walleij writes: > > > On Tue, Mar 23, 2021 at 2:10 PM Arnd Bergmann wrote: > > > >> From: Arnd Bergmann > >> > >> Building with 'make W=1' shows an array overflow: > >> > >> drivers/pinctrl/pinctrl-microchip-sgpio.c: In function 'microchip_sgpio_irq_settype': > >> drivers/pinctrl/pinctrl-microchip-sgpio.c:154:39: error: array subscript 10 is above array bounds of 'const u8[10]' {aka 'const unsigned char[10]'} [-Werror=array-bounds] > >> 154 | u32 regoff = priv->properties->regoff[rno] + off; > >> | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ > >> drivers/pinctrl/pinctrl-microchip-sgpio.c:55:5: note: while referencing 'regoff' > >> 55 | u8 regoff[MAXREG]; > >> | ^~~~~~ > >> > >> It's not clear to me what was meant here, my best guess is that the > >> offset should have been applied to the third argument instead of the > >> second. > >> > >> Fixes: be2dc859abd4 ("pinctrl: pinctrl-microchip-sgpio: Add irq support (for sparx5)") > >> Signed-off-by: Arnd Bergmann > > > > Patch applied. > > > > Yours, > > Linus Walleij > > I don't understand - I submitted a fix for this already in February > (reported by Gustavo). It took some time for you to get it ack'ed - but > you did (Feb 1st). > > Did it end up getting dropped? No I ended up with your fix in fixes, then forgot about it and applied Arnds fix to devel (for-next) and ended up getting a conflict in my face. Last night I rebased devel, dropped Arnds patch and thus solved the conflict. Yours, Linus Walleij