From: Qingfang DENG <dqfext@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
Masahide NAKAMURA <nakam@linux-ipv6.org>,
Ville Nuorvala <vnuorval@tcs.hut.fi>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Qingfang DENG <qingfang.deng@siflower.com.cn>
Subject: [PATCH net v2] neighbour: fix unaligned access to pneigh_entry
Date: Thu, 1 Jun 2023 09:54:32 +0800 [thread overview]
Message-ID: <20230601015432.159066-1-dqfext@gmail.com> (raw)
In-Reply-To: <CANn89iKRX2QTgS44Ky6Jua-+UNrFY3E7RCT_7OfG=GnFvAzdFQ@mail.gmail.com>
From: Qingfang DENG <qingfang.deng@siflower.com.cn>
After the blamed commit, the member key is longer 4-byte aligned. On
platforms that do not support unaligned access, e.g., MIPS32R2 with
unaligned_action set to 1, this will trigger a crash when accessing
an IPv6 pneigh_entry, as the key is cast to an in6_addr pointer.
Change the type of the key to u32 to make it aligned.
Fixes: 62dd93181aaa ("[IPV6] NDISC: Set per-entry is_router flag in Proxy NA.")
Signed-off-by: Qingfang DENG <qingfang.deng@siflower.com.cn>
---
v2: remove the ifdef, and use u32 type
include/net/neighbour.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3fa5774bddac..f6a8ecc6b1fa 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -180,7 +180,7 @@ struct pneigh_entry {
netdevice_tracker dev_tracker;
u32 flags;
u8 protocol;
- u8 key[];
+ u32 key[];
};
/*
--
2.34.1
next prev parent reply other threads:[~2023-06-01 1:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 10:42 [PATCH net] neighbour: fix unaligned access to pneigh_entry Qingfang DENG
2023-05-31 18:16 ` Jakub Kicinski
2023-05-31 18:41 ` Eric Dumazet
2023-06-01 1:54 ` Qingfang DENG [this message]
2023-06-02 4:50 ` [PATCH net v2] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230601015432.159066-1-dqfext@gmail.com \
--to=dqfext@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nakam@linux-ipv6.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=qingfang.deng@siflower.com.cn \
--cc=vnuorval@tcs.hut.fi \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).