[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709185431.GL721198@horms.kernel.org>
Date: Wed, 9 Jul 2025 19:54:31 +0100
From: Simon Horman <horms@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net 2/3] atm: clip: Fix memory leak of struct clip_vcc.
On Fri, Jul 04, 2025 at 06:23:52AM +0000, Kuniyuki Iwashima wrote:
> ioctl(ATMARP_MKIP) allocates struct clip_vcc and set it to
> vcc->user_back.
>
> The code assumes that vcc_destroy_socket() passes NULL skb
> to vcc->push() when the socket is close()d, and then clip_push()
> frees clip_vcc.
>
> However, ioctl(ATMARPD_CTRL) sets NULL to vcc->push() in
> atm_init_atmarp(), resulting in memory leak.
>
> Let's serialise two ioctl() by lock_sock() and check vcc->push()
> in atm_init_atmarp() to prevent memleak.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists