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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS 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 8C5A2C433B4 for ; Sat, 15 May 2021 22:46:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F27161278 for ; Sat, 15 May 2021 22:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbhEOWrK (ORCPT ); Sat, 15 May 2021 18:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbhEOWq7 (ORCPT ); Sat, 15 May 2021 18:46:59 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D57C06174A for ; Sat, 15 May 2021 15:45:45 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1034) id 4FjL8P3l5fz9sX1; Sun, 16 May 2021 08:45:41 +1000 (AEST) From: Michael Ellerman To: pmenzel@molgen.mpg.de, Benjamin Herrenschmidt , Christophe Leroy , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org In-Reply-To: References: Subject: Re: [PATCH] powerpc/legacy_serial: Fix UBSAN: array-index-out-of-bounds Message-Id: <162111863369.1890426.15615918327643788763.b4-ty@ellerman.id.au> Date: Sun, 16 May 2021 08:43:53 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 8 May 2021 06:36:21 +0000 (UTC), Christophe Leroy wrote: > UBSAN complains when a pointer is calculated with invalid > 'legacy_serial_console' index, allthough the index is verified > before dereferencing the pointer. > > Fix it by checking 'legacy_serial_console' validity before > calculating pointers. Applied to powerpc/fixes. [1/1] powerpc/legacy_serial: Fix UBSAN: array-index-out-of-bounds https://git.kernel.org/powerpc/c/63970f3c37e75997ed86dbdfdc83df35f2152bb1 cheers