Netdev List
 help / color / mirror / Atom feed
From: syzbot <syzbot+b3f058b8e3b0d80d5bfb@syzkaller.appspotmail.com>
To: achender@kernel.org, davem@davemloft.net, edumazet@kernel.org,
	 horms@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org,
	 linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com,  rds-devel@oss.oracle.com,
	santosh.shilimkar@oracle.com,  sowmini.varadhan@oracle.com,
	syzkaller-bugs@googlegroups.com,  willemb@google.com
Subject: [syzbot] [rds?] memory leak in rds_sendmsg
Date: Sun, 29 Nov 2026 15:17:46 -0800	[thread overview]
Message-ID: <6b0cb29a.c4dd33ab.25911d.002b.GAE@google.com> (raw)

Hello,

syzbot found the following issue on:

HEAD commit:    7cd8495c0f16 Merge tag 'io_uring-7.4-20261127' of git://gi..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=130406bd580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8025cb9d600652c3
dashboard link: https://syzkaller.appspot.com/bug?extid=b3f058b8e3b0d80d5bfb
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=162bc1d9580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=170406bd580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/65e3c2f2accb/disk-7cd8495c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bab7aacdf4c7/vmlinux-7cd8495c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/267cdac798e7/bzImage-7cd8495c.xz

The issue was bisected by AI to:

commit 401910db4cd425899832a093539222b6174f92a2
Author: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date:   Tue Feb 27 17:52:43 2018 +0000

    rds: deliver zerocopy completion notification with data

reasoning:      https://syzkaller.appspot.com/ai_job?id=3aeb77a2-ddcd-480e-94a3-97a0c28d61ad

AI-generated root cause summary:
A struct rds_msg_zcopy_info object allocated in rds_message_zcopy_from_user()
can be leaked when an RDS socket is closed before all of its queued zerocopy
rds_message objects have been freed. rds_release() purges rs->rs_zcookie_queue
after rds_send_drop_to(), which removes messages from the socket and connection
queues but does not clear rm->m_rs or wait for transport references such as
cp->cp_xmit_rm to be dropped. When the last reference to the rds_message is
later released, rds_message_purge() unconditionally calls
rds_rm_zerocopy_callback(), inserting the rds_msg_zcopy_info into
rs->rs_zcookie_queue before calling sock_put() to drop the final socket
reference. Because rds_sock_destruct() does not purge rs->rs_zcookie_queue, the
socket is freed while the zcopy notification object remains linked in the
now-freed queue.

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=b3f058b8e3b0d80d5bfb

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b3f058b8e3b0d80d5bfb@syzkaller.appspotmail.com

The bisection result may be wrong.
If you agree with it, please also add:
Fixes: 401910db4cd4 ("rds: deliver zerocopy completion notification with data")

BUG: memory leak
unreferenced object 0xffff88812a3e1880 (size 64):
  comm "syz.5.22", pid 5979, jiffies 4294947590
  hex dump (first 32 bytes):
    d8 2c fa 09 81 88 ff ff d8 2c fa 09 81 88 ff ff  .,.......,......
    01 00 00 00 42 00 00 00 00 00 00 00 00 00 00 00  ....B...........
  backtrace (crc cc362ab):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4733 [inline]
    slab_alloc_node mm/slub.c:5033 [inline]
    __kmalloc_cache_noprof+0x35f/0x3f0 mm/slub.c:5676
    _kmalloc_noprof include/linux/slab.h:991 [inline]
    _kzalloc_noprof include/linux/slab.h:1312 [inline]
    rds_message_zcopy_from_user net/rds/message.c:456 [inline]
    rds_message_copy_from_user+0x219/0x4d0 net/rds/message.c:513
    rds_sendmsg+0x1486/0x1d00 net/rds/send.c:1338
    sock_sendmsg_nosec net/socket.c:800 [inline]
    __sock_sendmsg net/socket.c:818 [inline]
    ____sys_sendmsg+0x54a/0x580 net/socket.c:2713
    ___sys_sendmsg+0x12c/0x160 net/socket.c:2770
    __sys_sendmsg+0xcd/0x140 net/socket.c:2802
    do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
    do_syscall_64+0xe9/0x540 arch/x86/entry/syscall_64.c:89
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff8881274f96c0 (size 64):
  comm "syz.2.19", pid 6180, jiffies 4294947912
  hex dump (first 32 bytes):
    d8 1a 5b 03 81 88 ff ff d8 1a 5b 03 81 88 ff ff  ..[.......[.....
    01 00 00 00 42 00 00 00 00 00 00 00 00 00 00 00  ....B...........
  backtrace (crc fce564):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4733 [inline]
    slab_alloc_node mm/slub.c:5033 [inline]
    __kmalloc_cache_noprof+0x35f/0x3f0 mm/slub.c:5676
    _kmalloc_noprof include/linux/slab.h:991 [inline]
    _kzalloc_noprof include/linux/slab.h:1312 [inline]
    rds_message_zcopy_from_user net/rds/message.c:456 [inline]
    rds_message_copy_from_user+0x219/0x4d0 net/rds/message.c:513
    rds_sendmsg+0x1486/0x1d00 net/rds/send.c:1338
    sock_sendmsg_nosec net/socket.c:800 [inline]
    __sock_sendmsg net/socket.c:818 [inline]
    ____sys_sendmsg+0x54a/0x580 net/socket.c:2713
    ___sys_sendmsg+0x12c/0x160 net/socket.c:2770
    __sys_sendmsg+0xcd/0x140 net/socket.c:2802
    do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
    do_syscall_64+0xe9/0x540 arch/x86/entry/syscall_64.c:89
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#ai-bisection

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

                 reply	other threads:[~2026-11-29 23:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6b0cb29a.c4dd33ab.25911d.002b.GAE@google.com \
    --to=syzbot+b3f058b8e3b0d80d5bfb@syzkaller.appspotmail.com \
    --cc=achender@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=sowmini.varadhan@oracle.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=willemb@google.com \
    /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