Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1958795rwl; Fri, 24 Mar 2023 19:19:04 -0700 (PDT) X-Google-Smtp-Source: AKy350YwjJn3wXN/rYyNA/ih6+5d7afcF3E1DZcFRstNPPasSVFxJeeichGUZeq4QhHNbX5BDzyz X-Received: by 2002:a17:906:fc1e:b0:92b:f3c3:7c5f with SMTP id ov30-20020a170906fc1e00b0092bf3c37c5fmr4806329ejb.53.1679710743775; Fri, 24 Mar 2023 19:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679710743; cv=none; d=google.com; s=arc-20160816; b=kes20cJgRvRYHYKjxJB1eXh2Zry6BaZph3Zra7PjIQoS02C3UTuu47xdpwHl/ABPV6 lQ3eQRZiBuQTKOCTADdK7dPY53FpuW3j5Vhy8G/fSuP+ZrLTzCUwCnEyDoqBLsaJGI0z WRPmMbUwxb5QOpWVqrlbkvoU+oSznRoDkAokrj+2yFubBgQBT/w1D9TRbEHawH4eEq9a 9pbnDCes0Z7Dq6PNMj1GJIxvlVYcp70MzsjLBTqqEJO2+jgII0urZtf06hn4ckhyWj22 WIm1jf5NMNoBUlEGE5i7XUTfu5FNsqYNjVKh7SxowjNM+1zJCRXRNpmYwid5hkt+/spz x9YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:date:message-id :from:subject:content-transfer-encoding:mime-version:dkim-signature; bh=v0lIO/6G0yZhu5V7v7I5lzczywyPZa6Sx0Vxezq+nrY=; b=Bbtm4Kh9QY6Rmiqv2U7d+RPj/3evLr+XLTE77JKle/cYVBhToTCBwof002qS4Azlu/ BWstePxSMnLdQeFeS1816tRnDqlovQ3CzaJ1OhwMgYDlzKK6blW1/orH+au8hayylL9k gHtFyuwJ4wgCbnM6tJjRwtDZdOCcduZQM6ZoAoSidlLHYddNT+SovAeFLnM7yRdb8liI fXKUoBGJJoQHWaQDL/PSAxmESyZV2F+cStLTLHXDIuf9ZkuUdJSjNNr9ZKkNe3J67Xjd mbPGmh0f9xb4Rm4V4Xq/YTq/ER7A5L6Y1aqmCkKK9WTbqOyDt59fxZG4Xjd5lMRRM+iD 1H8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X0WRsZBQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa6-20020a170907868600b009333d508e9asi21328377ejc.82.2023.03.24.19.18.38; Fri, 24 Mar 2023 19:19:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X0WRsZBQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232073AbjCYCKZ (ORCPT + 99 others); Fri, 24 Mar 2023 22:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbjCYCKX (ORCPT ); Fri, 24 Mar 2023 22:10:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E80E15577; Fri, 24 Mar 2023 19:10:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 09089B82661; Sat, 25 Mar 2023 02:10:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id C0F2DC433EF; Sat, 25 Mar 2023 02:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679710217; bh=LuNYj1EqVPg7MtM0L5VBp1l9g/DSZFniixqdUVZdXbg=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=X0WRsZBQfomA8fsx2D+pKRb+ubhfiBE1Z2bwMbQ7s9QeGsd/NfrjQhbHkjZeEkCB1 yv4Tb1Ne5PT7CNNkEkzX7q7StIISlp5slhwlQJCvF0VqmNwsiTb1wY+qMhEDK+URiw o+RImi5mfLg2enEnlvIhqi/PCz5m1U4+cd1Oj4KZ7MQ3QCsb6DnOD0wpywGByQaM0W iB/CZBsZ/P5oG6i9LF4gCvzQQCVAyQicMns7rzFLs/6UIdpQ6p2Cr50xdDzmNowFtj U1mcz2l8NyU+DKAjv01lBSwMqrH+JqkrbB0vH2c35Ge4bEayj0yyBZRiMXI2j4bHrp 0m4GjiTVxRrsg== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id A23B0C41612; Sat, 25 Mar 2023 02:10:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH net v2] net: dsa: realtek: fix out-of-bounds access From: patchwork-bot+netdevbpf@kernel.org Message-Id: <167971021766.17146.5805572858718496946.git-patchwork-notify@kernel.org> Date: Sat, 25 Mar 2023 02:10:17 +0000 References: <20230323103735.2331786-1-a.fatoum@pengutronix.de> In-Reply-To: <20230323103735.2331786-1-a.fatoum@pengutronix.de> To: Ahmad Fatoum Cc: linus.walleij@linaro.org, alsi@bang-olufsen.dk, andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, luizluca@gmail.com, davem@davemloft.net, kernel@pengutronix.de, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Thu, 23 Mar 2023 11:37:35 +0100 you wrote: > The probe function sets priv->chip_data to (void *)priv + sizeof(*priv) > with the expectation that priv has enough trailing space. > > However, only realtek-smi actually allocated this chip_data space. > Do likewise in realtek-mdio to fix out-of-bounds accesses. > > These accesses likely went unnoticed so far, because of an (unused) > buf[4096] member in struct realtek_priv, which caused kmalloc to > round up the allocated buffer to a big enough size, so nothing of > value was overwritten. With a different allocator (like in the barebox > bootloader port of the driver) or with KASAN, the memory corruption > becomes quickly apparent. > > [...] Here is the summary with links: - [net,v2] net: dsa: realtek: fix out-of-bounds access https://git.kernel.org/netdev/net/c/b93eb5648693 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html