From: Geliang Tang Date: Fri, 21 Feb 2025 15:43:56 +0000 (+0100) Subject: mptcp: pm: add a build check for userspace_pm_dump_addr X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=63132fb054744e58de61d45a6d4f2a707cdfcfb3;p=users%2Fjedix%2Flinux-maple.git mptcp: pm: add a build check for userspace_pm_dump_addr This patch adds a build check for mptcp_userspace_pm_dump_addr() to make sure there is enough space in 'cb->ctx' to store an address id bitmap. Just in case info stored in 'cb->ctx' are increased later. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20250221-net-next-mptcp-pm-misc-cleanup-3-v1-3-2b70ab1cee79@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 277cf092a870..b69fb5b18130 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -643,6 +643,8 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, struct sock *sk; void *hdr; + BUILD_BUG_ON(sizeof(struct id_bitmap) > sizeof(cb->ctx)); + bitmap = (struct id_bitmap *)cb->ctx; msk = mptcp_userspace_pm_get_sock(info);