public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] net: rds: rds_send_probe memory leak
@ 2021-03-14  8:23 Fatih Yildirim
  2021-03-14  8:36 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Fatih Yildirim @ 2021-03-14  8:23 UTC (permalink / raw)
  To: santosh.shilimkar, davem, kuba
  Cc: gregkh, netdev, linux-rdma, rds-devel, linux-kernel

Hi Santosh,

I've been working on a memory leak bug reported by syzbot.
https://syzkaller.appspot.com/bug?id=39b72114839a6dbd66c1d2104522698a813f9ae2

It seems that memory allocated in rds_send_probe function is not freed.

Let me share my observations.
rds_message is allocated at the beginning of rds_send_probe function.
Then it is added to cp_send_queue list of rds_conn_path and refcount
is increased by one.
Next, in rds_send_xmit function it is moved from cp_send_queue list to
cp_retrans list, and again refcount is increased by one.
Finally in rds_loop_xmit function refcount is increased by one.
So, total refcount is 4.
However, rds_message_put is called three times, in rds_send_probe,
rds_send_remove_from_sock and rds_send_xmit functions. It seems that
one more rds_message_put is needed.
Would you please check and share your comments on this issue?

Thanks,
Fatih



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-14 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-14  8:23 [BUG] net: rds: rds_send_probe memory leak Fatih Yildirim
2021-03-14  8:36 ` Greg KH
2021-03-14 12:19   ` Fatih Yildirim
2021-03-14 12:44     ` Greg KH
2021-03-14 13:05       ` Fatih Yildirim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox