From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58608440A06 for ; Thu, 30 Jul 2026 15:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785425268; cv=none; b=dk93IM0mTfW5vR1PcdsxpPJ30x6TD+7DyqMjY7hrS27pOB3Fvx06NGoInC3CVPdIRO6BNBjFhSJZySjNe+c+30X4ZqALKdFM8yBtb9XfsS9l72eCCXwdnU3u6aMfr9oGGVE2peFhBatc3e5A1hBT4gLzWM4453469yZaBWkVGSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785425268; c=relaxed/simple; bh=d5RXFfVRX5p3oscQXB9FNGQJzjxxqOI0ZyUQ/yhbbX0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=chjVj3TmY4BWaUrzUFJn/HEJJRUfPeJdn6ICadA3bq1jszkCUFagZYU1XcnATBvlDrf92eYGPFLu+K3YJ1sz4iWNeyOOmRFAVgD1VLjJuzDhqImD2WtjoTR5L+hAdOzZHYTxqqyr8adM/WhxgMl0foMLCDqlvCYnwxSebCt200A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org; spf=none smtp.mailfrom=blackwall.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b=MvUYPrTR; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=blackwall.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b="MvUYPrTR" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-49548e01d02so10578665e9.0 for ; Thu, 30 Jul 2026 08:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall.org; s=google; t=1785425264; x=1786030064; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=nzJUatZRCgVEofo3LM1zenQhlJFklBY9WtRFTuod4dQ=; b=MvUYPrTRlUzfqhGO2lvbt+DzpOn3ZZ9R4BWLe3W386eVczuQ5jyFZYWflnlgJjiOcR SMbwCzv6Ap6noHsptRWREdy0iDN5UjtZ+Jv5Au2VasahB3UTot8Dwu1JAagLBlPjTR9m DX4OZThyja3k403hIVqCCjLHcE2dkAh65yLbCFZsxLI4A139S6MnFzpsrOT5rY2yOhQl K5bgvN03sIPLtSMygse2btmEwDDyZSY9LOkmXFUowJyHkI32+Ng5pvcyNcnTugCCPHo6 LgXVymOwrinsKiUoKw8QNSvafvSU7V9c/uAcpRCSQ/ArLuhNewhUjHQ/jOYn6fRWlOv0 reew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785425264; x=1786030064; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nzJUatZRCgVEofo3LM1zenQhlJFklBY9WtRFTuod4dQ=; b=CIuBOP/nRuu1/woPA/kWdgesUKtfW/asdY1x+2lPGWz3IWPUcY42Mdw/cEG4v9PqJ7 D9RtvThRUG32thk1lr8MBYht54XXtFiLizZAhapH7urlF39peDTSSFydSaKqyx+WP2dd JMEWRIDVwdpcNa0R6jz0RMa6kQVuTtiLhkRvT+TkYZJohnnao7TVoR7XaeigN0lCmSBQ myaTFTJYgJjc5EcVQVOJZe3V2Wp1DX68XH5fAEmO2xRLRCktoPtFjEzQb5Swq2tt3UDe aKa5eO8AGHhLZKGsKqxnuxgHmGSCa/xDu9TA9FBPvuYSwL4jrfmDL5CE9+dgEpnqMaKS 983A== X-Forwarded-Encrypted: i=1; AHgh+RpBujxqN5PleO7mZba1LIhNzpX3L6CgL9Ei8vZ0nlVUUUmynybCPtAIU6onF+MmN9u7v+O//1otPSEQo9U=@vger.kernel.org X-Gm-Message-State: AOJu0Yym9kLX60SHlJDa1QVAKX0e/fN7ll3sUPfAuL2iEj7CIB6J0wHT VSpWj0HwS2piTfb5mXRMHMfesaHFTl5iGlhxdIzpPpYcCo14Se18BlIDcsX3W+cR9Xo= X-Gm-Gg: AR+sD10bDKClXxRVjtW2dQjTiHXqiZGd12Rp+B4MnBTW5KPLWM4IxirLJDHgxpRLyIC TN8b6wtUknJ11Jf/idKePxU8TRl1JNyqSH+rh5VzzTV8cscVqyFuBomw0fWvJ7wz/u139PZ85al uQdUYQja4prEZU8mCspRGXe5YOibr6vgPPPkIk5ycPgunrvQH3tYjYfqSKPgf4dY1iUkpocceo8 5QW2p/gk4upGyTFJY9Y0yiEmsgec4nl1rC0L16Re3iMedzK+/YHwdTpBYy62aLtmnVmGSKaoT3L 4pKRhXfdRD1OEOTEpn3hp1k/EU2U0QS8MGIyTiQCRMzuF5eEtdaavVQXp1znBVmmU2UOn7QbqQl BCnax8O2QRIXu5ctcHpSz8hVsy+90rRhbnAAian+XqeOpzrF30BGZaARmyvBgJHEINYeo5v2n+f oitUY84zWgU60G1JxysBMMYfUdwAgNjD8JUJWxoA40rSLYezlzbwIOW00= X-Received: by 2002:a7b:cc89:0:b0:495:6f6b:fb75 with SMTP id 5b1f17b1804b1-49800ebba08mr29432035e9.38.1785425264161; Thu, 30 Jul 2026 08:27:44 -0700 (PDT) Received: from localhost ([109.160.74.77]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-498011fd5fesm62954505e9.7.2026.07.30.08.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 08:27:43 -0700 (PDT) Date: Thu, 30 Jul 2026 18:27:41 +0300 From: Nikolay Aleksandrov To: Baul Lee Cc: netdev@vger.kernel.org, bridge@lists.linux.dev, linux-kernel@vger.kernel.org, Ido Schimmel , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , stable@vger.kernel.org Subject: Re: [PATCH net v2] net: bridge: mrp: fix uninitialised bytes on the wire Message-ID: References: <20260726062518.43774-1-baul.lee@xbow.com> <20260729131941.10254-1-baul.lee@xbow.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260729131941.10254-1-baul.lee@xbow.com> On Wed, Jul 29, 2026 at 10:19:41PM +0900, Baul Lee wrote: > br_mrp_alloc_test_skb() builds MRP test frames on an skb from > dev_alloc_skb(), which does not clear the linear data area. On the MRA > ring-role branch the sub-option TLV header is appended with > > sub_tlv = skb_put(skb, sizeof(*sub_tlv)); > sub_tlv->type = BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR; > > so sub_tlv->length is never written, and the two trailing alignment bytes > are appended with a bare skb_put() that does not clear them either. The > neighbouring oui and sub_opt regions are explicitly zeroed, so three > uninitialised bytes are left in every MRA MRP_Test frame that goes out. > > Put the sub-option TLV header and the alignment padding in a single > skb_put_zero(), which clears both. The AUTO_MGR sub-TLV carries no > payload, so the zeroed length field is already the value it should have. > > Fixes: f7458934b079 ("net: bridge: mrp: Update the Test frames for MRA") > Suggested-by: Nikolay Aleksandrov > Cc: stable@vger.kernel.org > Signed-off-by: Baul Lee > --- > v2: > - fold the alignment padding into a single skb_put_zero() for the > sub-option TLV header, dropping the explicit length assignment and the > second skb_put() (Nikolay Aleksandrov) > - drop the paragraph about observing the leak, and the Reported-by tags > > Link to v1: https://lore.kernel.org/netdev/20260726062518.43774-1-baul.lee@xbow.com/ > > net/bridge/br_mrp.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c > index 179d2470b..ef16d0703 100644 > --- a/net/bridge/br_mrp.c > +++ b/net/bridge/br_mrp.c > @@ -224,11 +224,9 @@ static struct sk_buff *br_mrp_alloc_test_skb(struct br_mrp *mrp, > sub_opt = skb_put(skb, sizeof(*sub_opt)); > memset(sub_opt, 0x0, sizeof(*sub_opt)); > > - sub_tlv = skb_put(skb, sizeof(*sub_tlv)); > - sub_tlv->type = BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR; > - > /* 32 bit alligment shall be ensured therefore add 2 bytes */ > - skb_put(skb, MRP_OPT_PADDING); > + sub_tlv = skb_put_zero(skb, sizeof(*sub_tlv) + MRP_OPT_PADDING); > + sub_tlv->type = BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR; > } > > br_mrp_skb_tlv(skb, BR_MRP_TLV_HEADER_END, 0x0); > -- > 2.53.0 > You should not send patches as replies, they should be sent on their own. Aside from that the patch looks good to me: Acked-by: Nikolay Aleksandrov