Re: [PATCH] RDMA/iwpm: fix memory leak in iwpm_add_remote_info()

From: Leon Romanovsky

Date: Sun Nov 15 2026 - 07:52:19 EST



On Tue, 10 Nov 2026 05:03:28 +0900, Junyoung Jang wrote:
> NETLINK_RDMA accepts requests addressed to kernel port ID 0 from a local
> unprivileged socket. The IWCM RDMA_NL_IWPM_REMOTE_INFO callback has no
> RDMA_NL_ADMIN_PERM flag, and RDMA netlink routes this IWCM opcode to its
> dump callback even without NLM_F_DUMP.
>
> iwpm_remote_info_cb() parses the six required attributes and only checks
> that the local and mapped-local sockaddr_storage families match and that
> the remote and mapped-remote families match. Four family-255 addresses
> pass those checks. The callback allocates an iwpm_remote_info object
> with GFP_ATOMIC and passes it to iwpm_add_remote_info(). There,
> get_reminfo_hash_bucket() accepts only AF_INET and AF_INET6, so the
> family-255 lookup returns NULL. The object is neither linked into
> iwpm_reminfo_bucket nor freed, and the callback returns -EINVAL after
> this allocation side effect.
>
> [...]

Applied, thanks!

[1/1] RDMA/iwpm: fix memory leak in iwpm_add_remote_info()
https://git.kernel.org/rdma/rdma/c/4b14bd5d913b16

Best regards,
--
Leon Romanovsky <leon@xxxxxxxxxx>