From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 AF3A6330B14; Sat, 12 Sep 2026 14:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221717; cv=none; b=RcJOfjWsKW1y2ysZUihv+Zagj3Qb1SP6tOwPzEOS3kMT3Zo9qvhZPZkXK8qtzIm2PiQt0bEgaDCncduTTEW8oJ92QgRuOuk5OGfVWKZxiIE+dH1yWh/uPauKIUiQoiArzw2PllWqX40a9BSG3tnQahH39oK2sfKkHMGjTk91mu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221717; c=relaxed/simple; bh=jh2EQuxNsmDGMmpCpZI0gGeDeU6pkqbyFXrgGsvhlaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aZvBcr4tvLbOdLmuZo+yRqP8+Qi03F1IrzgRqlwdbO6oEh65Lh25rQyo9yK4hp8aALfbAUvuaVK8cPip0O4yy5Dh6bgDSXandKs/yKonf4CNIdCdD1Rn73eR2mEx4lGQAf5ZZiljAupexqe4q/aWy1XX/j+3azeOgO+qE2LW3XY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CE+4Lr0M; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CE+4Lr0M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 358B11F000FF; Sat, 12 Sep 2026 14:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221714; bh=+JECa7oSluCYZfA11Qw1CKa0Be+y5GV/5rl+ngsa/jQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CE+4Lr0Mg8xJvyZ/0iNeoDnApV11gV0N4zQ+25srdRuJR6AdBayq4q45/PIMn1AzV JycLif/xuiuE4rdoeB3TfPBE4ZR5nBsVWx6hqtD2QA5KVQ85OHPVY1QUsDcJy97Bjj RGDGuSkWo5mZz3bkjN6buSUgA+uGm0G75aaAeSFo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Sven Eckelmann Subject: [PATCH 6.6 0396/1424] batman-adv: dat: avoid unaligned fault in IP extraction Date: Sat, 12 Sep 2026 08:47:08 +0200 Message-ID: <20260912065616.155948245@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit 0121afa52cdb88cfb4d5d7bd126a23a9100121d8 upstream. Independent of the alignment of the ARP packet in the SKB, either the batadv_arp_ip_src or the batadv_arp_ip_dst will have an unaligned access (on HW without native unaligned read support). Use get_unaligned() to handle this properly on all architectures. Cc: stable@vger.kernel.org Reported-by: Sashiko Fixes: 5c3a0e553593 ("batman-adv: Distributed ARP Table - add ARP parsing functions") Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/distributed-arp-table.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -250,7 +250,10 @@ static u8 *batadv_arp_hw_src(struct sk_b */ static __be32 batadv_arp_ip_src(struct sk_buff *skb, int hdr_size) { - return *(__force __be32 *)(batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN); + u8 *src = batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN; + __be32 *ip = (__force __be32 *)src; + + return get_unaligned(ip); } /** @@ -275,8 +278,9 @@ static u8 *batadv_arp_hw_dst(struct sk_b static __be32 batadv_arp_ip_dst(struct sk_buff *skb, int hdr_size) { u8 *dst = batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN * 2 + 4; + __be32 *ip = (__force __be32 *)dst; - return *(__force __be32 *)dst; + return get_unaligned(ip); } /**