Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5435893ybi; Tue, 4 Jun 2019 06:41:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzWOSvRgCGnRJ/IMrb+k10Lk4h3KfiysIN4VZ1dNDHp0R3H7A2QqOh1sEiPmQmkdBUEir9 X-Received: by 2002:a63:6884:: with SMTP id d126mr35737437pgc.154.1559655711538; Tue, 04 Jun 2019 06:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559655711; cv=none; d=google.com; s=arc-20160816; b=pvYj++z+dI6dRgyZEv24GnqA3K0EklKLZ2cyWgwou5tuWXsRHuebxlnnTAuwNohKge m7kJAjsldqWsxaMX+AG9TNv16LEuDIfhKv8RgJcVoiB+RExP4aOuQOGVWfhK3/zDGZGS FIkrDCFpcDav0CxfLoPe3ptZgZNWtTCiUCBrvN6g70uFRHNB6xXwPUBulVUSgIy7GyCw HJ8mFIZ1ogJBlFoVa8mauatSvHkKL8iLyPbDxmA8IzYaBRbN6gQwaYxcjzdXZoCXHZ3t 2dzhVEN6D9FELcLiqyDBUipmAFJnODwHmWQ18gzVFZedHG2EZkq72d93F5nhTx7UkOZY NKxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0WXKUmTeUweiz7SeHm408/knTOSg6CffX96W9GMM7rU=; b=BXy71kEoA/hMDIUh9tM/LPgey4o7trOBoWvIEoiUZdz3xB3NPGltqzqPEZHm9RLLFC IYvUkNL/x4n0RaAA5h/PG1GHDgVFqHRB4md2pa/OSX1nMAnJI9vv7ysq6FCwtXKp13VC hWLI2KqDsR4pXVroGgPjHYFIfDGMd90Jxf6mSwvAGA4MGkEkOlKwV4jMsv1G81dzP2J4 HKMc6U0C/sJ+A5a468OfiIb9qb/K2CnF69bdSVisK6H7QtYaupKrbxMY4b4Rnyigpoe5 Cu6WOWQKQry1IeptkDsF8E/lVYgNnh9PE0IutBSdGOYeFw7LqefVi2sPizOlyTeALviv KVnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XytfCuMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si25291564pfa.36.2019.06.04.06.41.33; Tue, 04 Jun 2019 06:41:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XytfCuMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727601AbfFDNjK (ORCPT + 99 others); Tue, 4 Jun 2019 09:39:10 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:53868 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727392AbfFDNjJ (ORCPT ); Tue, 4 Jun 2019 09:39:09 -0400 Received: by mail-it1-f195.google.com with SMTP id m187so140693ite.3 for ; Tue, 04 Jun 2019 06:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0WXKUmTeUweiz7SeHm408/knTOSg6CffX96W9GMM7rU=; b=XytfCuMILvLVI45yAPNZX96DXz4ti9+BE4oM0Muu3+GREgDyZyDTxk4FhVgvYjIBfP 7qzvTa7TWbI5E6s9AG6I2URL+X4C24YhlYfkgqW/Cfyn0Sg8WuAIJXcWsX92OPHR3avq UmCFv3nHwVg56SzVRbutp8EawbqREPdrl8q70fwpfni4QkCmdsQpRp23dkr/Vpwrq/EH 8LroSVjFm74k9DI9PMj94TPyyLFFCjyJ0025t0zwXnGje9W8QMKy4dxm9FbOTUFIhAkE CTSBEMwjs1+ZLPh/7Xx7ZuKKAa7QGxE5OrcPUVhzmdm0uMw5bZOKQSSMufelj8t5meIq JINg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0WXKUmTeUweiz7SeHm408/knTOSg6CffX96W9GMM7rU=; b=oXjGylMuHbEbdOsISmHLN7hiayhUSWLaylzGM38QiClaj7CLBF9bMdIdoQrEIPqrZF USvAZ11nsPBLYLu/ONVy58mHYONVPJ4680kSGUx4sUd9dVSH8j6v5Uhk9RQBWSpnMFWi +Yc5FlpAsSx+wRp48Dsc3T5mnrs1b345S2G7bwyVpu8GQu8Srck3MKsEU3Ic9QwFznS9 HFaCdgo6rw4icvVLulQofzZ1nr9plO5eWfZLPkYrGXFxUqRXHHLnDvZerg8o9MZI8S+K CjyBOYKu9MTVQ+F+hCy63hfrNafeu9M3kfCpfwbNVX8s9iL2U2iSKfg1oRRknh0sTypq XABA== X-Gm-Message-State: APjAAAW4TNFkHCf697w2CXUo9rGLOgT2EF5C4z9rQmNtkVIIqtcVlce/ xnAcHrvtqlV8yRHsjgAst4cxK21sTlypDn9mgrfzkw== X-Received: by 2002:a24:9083:: with SMTP id x125mr14800222itd.76.1559655548187; Tue, 04 Jun 2019 06:39:08 -0700 (PDT) MIME-Version: 1.0 References: <000000000000f122ab058a303d94@google.com> In-Reply-To: From: Dmitry Vyukov Date: Tue, 4 Jun 2019 15:38:55 +0200 Message-ID: Subject: Re: memory leak in sctp_stream_init_ext To: Xin Long Cc: syzbot , davem , LKML , linux-sctp@vger.kernel.org, Marcelo Ricardo Leitner , network dev , Neil Horman , syzkaller-bugs , Vlad Yasevich Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 4, 2019 at 3:37 PM Xin Long wrote: > > On Fri, May 31, 2019 at 10:59 PM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit: bec7550c Merge tag 'docs-5.2-fixes2' of git://git.lwn.net/.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=152a0916a00000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=64479170dcaf0e11 > > dashboard link: https://syzkaller.appspot.com/bug?extid=7f3b6b106be8dcdcdeec > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1142cd4ca00000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10f81d72a00000 > > > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > > Reported-by: syzbot+7f3b6b106be8dcdcdeec@syzkaller.appspotmail.com > > > > executing program > > executing program > > executing program > > executing program > > executing program > > BUG: memory leak > > unreferenced object 0xffff8881114f5d80 (size 96): > > comm "syz-executor934", pid 7160, jiffies 4294993058 (age 31.950s) > > hex dump (first 32 bytes): > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > > backtrace: > > [<00000000ce7a1326>] kmemleak_alloc_recursive > > include/linux/kmemleak.h:55 [inline] > > [<00000000ce7a1326>] slab_post_alloc_hook mm/slab.h:439 [inline] > > [<00000000ce7a1326>] slab_alloc mm/slab.c:3326 [inline] > > [<00000000ce7a1326>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553 > > [<000000007abb7ac9>] kmalloc include/linux/slab.h:547 [inline] > > [<000000007abb7ac9>] kzalloc include/linux/slab.h:742 [inline] > > [<000000007abb7ac9>] sctp_stream_init_ext+0x2b/0xa0 > > net/sctp/stream.c:157 > > [<0000000048ecb9c1>] sctp_sendmsg_to_asoc+0x946/0xa00 > > net/sctp/socket.c:1882 > > is this possible to be a false positive? https://goo.gl/tpsmEJ#memory-leaks > As in my testing, I tracked the objects allocated by > "sctp_sendmsg_to_asoc () -> sctp_stream_init_ext()." > all of them got freed properly in sctp_stream_free(), > while this warning was still triggered. > > > [<000000004483ca2b>] sctp_sendmsg+0x2a8/0x990 net/sctp/socket.c:2102 > > [<0000000094bdc32e>] inet_sendmsg+0x64/0x120 net/ipv4/af_inet.c:802 > > [<0000000022d1c2a5>] sock_sendmsg_nosec net/socket.c:652 [inline] > > [<0000000022d1c2a5>] sock_sendmsg+0x54/0x70 net/socket.c:671 > > [<000000006ab53119>] sock_write_iter+0xb6/0x130 net/socket.c:1000 > > [<00000000973772ef>] call_write_iter include/linux/fs.h:1872 [inline] > > [<00000000973772ef>] new_sync_write+0x1ad/0x260 fs/read_write.c:483 > > [<0000000033f2491b>] __vfs_write+0x87/0xa0 fs/read_write.c:496 > > [<00000000372fbd56>] vfs_write fs/read_write.c:558 [inline] > > [<00000000372fbd56>] vfs_write+0xee/0x210 fs/read_write.c:542 > > [<000000007ccb2ea5>] ksys_write+0x7c/0x130 fs/read_write.c:611 > > [<000000001c29b8c7>] __do_sys_write fs/read_write.c:623 [inline] > > [<000000001c29b8c7>] __se_sys_write fs/read_write.c:620 [inline] > > [<000000001c29b8c7>] __x64_sys_write+0x1e/0x30 fs/read_write.c:620 > > [<0000000014d9243b>] do_syscall_64+0x76/0x1a0 > > arch/x86/entry/common.c:301 > > [<0000000059f6e9a8>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > > > BUG: memory leak > > unreferenced object 0xffff8881114f5d80 (size 96): > > comm "syz-executor934", pid 7160, jiffies 4294993058 (age 33.160s) > > hex dump (first 32 bytes): > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > > backtrace: > > [<00000000ce7a1326>] kmemleak_alloc_recursive > > include/linux/kmemleak.h:55 [inline] > > [<00000000ce7a1326>] slab_post_alloc_hook mm/slab.h:439 [inline] > > [<00000000ce7a1326>] slab_alloc mm/slab.c:3326 [inline] > > [<00000000ce7a1326>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553 > > [<000000007abb7ac9>] kmalloc include/linux/slab.h:547 [inline] > > [<000000007abb7ac9>] kzalloc include/linux/slab.h:742 [inline] > > [<000000007abb7ac9>] sctp_stream_init_ext+0x2b/0xa0 > > net/sctp/stream.c:157 > > [<0000000048ecb9c1>] sctp_sendmsg_to_asoc+0x946/0xa00 > > net/sctp/socket.c:1882 > > [<000000004483ca2b>] sctp_sendmsg+0x2a8/0x990 net/sctp/socket.c:2102 > > [<0000000094bdc32e>] inet_sendmsg+0x64/0x120 net/ipv4/af_inet.c:802 > > [<0000000022d1c2a5>] sock_sendmsg_nosec net/socket.c:652 [inline] > > [<0000000022d1c2a5>] sock_sendmsg+0x54/0x70 net/socket.c:671 > > [<000000006ab53119>] sock_write_iter+0xb6/0x130 net/socket.c:1000 > > [<00000000973772ef>] call_write_iter include/linux/fs.h:1872 [inline] > > [<00000000973772ef>] new_sync_write+0x1ad/0x260 fs/read_write.c:483 > > [<0000000033f2491b>] __vfs_write+0x87/0xa0 fs/read_write.c:496 > > [<00000000372fbd56>] vfs_write fs/read_write.c:558 [inline] > > [<00000000372fbd56>] vfs_write+0xee/0x210 fs/read_write.c:542 > > [<000000007ccb2ea5>] ksys_write+0x7c/0x130 fs/read_write.c:611 > > [<000000001c29b8c7>] __do_sys_write fs/read_write.c:623 [inline] > > [<000000001c29b8c7>] __se_sys_write fs/read_write.c:620 [inline] > > [<000000001c29b8c7>] __x64_sys_write+0x1e/0x30 fs/read_write.c:620 > > [<0000000014d9243b>] do_syscall_64+0x76/0x1a0 > > arch/x86/entry/common.c:301 > > [<0000000059f6e9a8>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > > > executing program > > executing program > > executing program > > executing program > > executing program > > executing program > > > > > > --- > > This bug 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 bug report. See: > > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > syzbot can test patches for this bug, for details see: > > https://goo.gl/tpsmEJ#testing-patches > > -- > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/CADvbK_evGyJZaUQZa6U26tJSQCNW4jb3uqLWGQGF_7HJgv-Sog%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout.