From nobody Thu Nov 28 09:47:38 2024 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 493BA1D0E1F; Wed, 2 Oct 2024 16:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727885903; cv=none; b=sCIab+ZnqfsbhYEPhua2NC/PI6xcj3hVFcU+4JU5w38PzayVy8YuDabifcMCNWVLXdyDH5QQso8fkfTFNzpBzjXElvb3aZ+NaknGYsrmnQv8xqbiX5mGShe/f54P1REs+Qy9WL9YaEnuOBqH8APOABw2wiGrY3tOzJL7nQKz/Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727885903; c=relaxed/simple; bh=9I57oPSi7svJIBtGf3fPTvYUFRRSaBE2k8SgDCMj+VY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=D0jnffFaYbcOWyfgwLIctZoss021sqf57MB7OzXhseyt3aaoJHFrbFT+dSPAVWJ4wzEHRMbhEb14AjlaW6LkY6PXhKs5AluqtAZN1DaX2VUMfWgZVa1lSUMPcOoYt6+6IIdOV3LBHaoibDwSAJhl9rgUdQcFbh0Gjs4jnkrNiOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=inguin@gmx.de header.b=CsFq2+SN; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=inguin@gmx.de header.b="CsFq2+SN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1727885892; x=1728490692; i=inguin@gmx.de; bh=AoDJvqdHO0Sz527L7ct5upwSZR5UcvLfylsatrSj+lI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=CsFq2+SNreYL+GC02v5DoK6pin5mBCwRd1F8DyajIUoCOiDb88NsnTmB47vKiwDE CTVcliLv0RRsvVQHot/TgBJYh4qucQsQWn0FXPpKBQoYDTiaeN5olZOwFDlCK7hJf besuIKoy4kgg4O7JoxsNhsswVHI1zW99JqUJ1eFW4rRSFxAnfJIsL9lBjGDAT6Mi4 COCgN2wY4gIHGFS9YCP6jrfd4LQJP0CCJEP6rUA/RcIE0iQclPc05YjApcsP371HI qWd3+ohUDjEyanHbSSparcH6cHS5qaG1O1hWINJVLdrjEUK3WaZY5/x5sUo+8kRIb vTOm93kXC4Mz1h2PbA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from zaphod.peppercon.de ([212.80.250.50]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5mKP-1rq8XH1INf-015G31; Wed, 02 Oct 2024 18:18:12 +0200 From: Ingo van Lil To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Dan Murphy , Alexander Sverdlin , Andrew Lunn , Ingo van Lil Subject: [PATCH net] net: phy: dp83869: fix memory corruption when enabling fiber Date: Wed, 2 Oct 2024 18:18:07 +0200 Message-ID: <20241002161807.440378-1-inguin@gmx.de> X-Mailer: git-send-email 2.46.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:RJPQasVZn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mLsbV99Bo G3zeAuCgkADgndWpD60ohW2g== Content-Type: text/plain; charset="utf-8" When configuring the fiber port, the DP83869 PHY driver incorrectly calls linkmode_set_bit() with a bit mask (1 << 10) rather than a bit number (10). This corrupts some other memory location -- in case of arm64 the priv pointer in the same structure. Since the advertising flags are updated from supported at the end of the function the incorrect line isn't needed at all and can be removed. Fixes: a29de52ba2a1 ("net: dp83869: Add ability to advertise Fiber connecti= on") Signed-off-by: Ingo van Lil Reviewed-by: Alexander Sverdlin Reviewed-by: Andrew Lunn --- drivers/net/phy/dp83869.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index d7aaefb5226b..5f056d7db83e 100644 --- a/drivers/net/phy/dp83869.c +++ b/drivers/net/phy/dp83869.c @@ -645,7 +645,6 @@ static int dp83869_configure_fiber(struct phy_device *p= hydev, phydev->supported); linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported); - linkmode_set_bit(ADVERTISED_FIBRE, phydev->advertising); if (dp83869->mode =3D=3D DP83869_RGMII_1000_BASE) { linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, -- 2.46.2