From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E0ADC433F5 for ; Sat, 23 Oct 2021 12:02:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E40D960724 for ; Sat, 23 Oct 2021 12:02:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E40D960724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1294B940008; Sat, 23 Oct 2021 08:02:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D938940007; Sat, 23 Oct 2021 08:02:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBBAE940008; Sat, 23 Oct 2021 08:02:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id D5C4F940007 for ; Sat, 23 Oct 2021 08:02:26 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8C283181C9B85 for ; Sat, 23 Oct 2021 12:02:26 +0000 (UTC) X-FDA: 78727564692.08.F4DFDC4 Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by imf24.hostedemail.com (Postfix) with ESMTP id 23160B00009D for ; Sat, 23 Oct 2021 12:02:26 +0000 (UTC) Received: by mail-il1-f199.google.com with SMTP id o8-20020a056e02068800b0025999dab84fso4006697ils.22 for ; Sat, 23 Oct 2021 05:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:date:in-reply-to:message-id:subject :from:to; bh=Y2xC9KlucvmvQkSgxHIj3ttz+G0LYRa6dVH8rX+XzUc=; b=c9wBPQ8Rpll6udEkPka9GK5qtDEVJ4dYF9Au6hWPybWr3+EhMdnNyut+nye9pmkeON QT9SEqnPu0B1Ck7Y2uJAWXjbhUpThAKj/R0+IbfvGuXPE1Ycv48s1YINPbubxl1ANHSU tMolqf8IMWh9/LX+yS9ZSKA4NifgeuiLxlI1P5SAriTQBGnbpBmwJH4ziR0ZBu4yOU1+ PlUvdTMMbbT+w27djIYo4s3sSAOK+cjInJYPpWF29al4h4VM64X+7nIlJi+QU8/2U469 CundbsOaVxg0TMaiIkqiAEQeJbs1UEtEwa746UBO8A+65/yTJKb30MuG2LV/T8fgo7dq 356A== X-Gm-Message-State: AOAM5316lMjDHjtqX+JnfRsepzVfgjk1hIAMPClpbAJLj0Kf7tDwbdtt u083+dsTA1JYx9ELGu1Sh4OBYUdypbzW/pwy9IYG72Yg7xJk X-Google-Smtp-Source: ABdhPJy72EfZXcfTgRqc2R8GDIg4UUKG//MesO7jAOin4uJgmXayeBRMZhm1DC/T5e3gss2PIdvRZKr5MKvdD/mJ8TNrcKwdzRit MIME-Version: 1.0 X-Received: by 2002:a05:6e02:174e:: with SMTP id y14mr3432063ill.189.1634990545581; Sat, 23 Oct 2021 05:02:25 -0700 (PDT) Date: Sat, 23 Oct 2021 05:02:25 -0700 In-Reply-To: <00000000000062d0fc05cef24c57@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000ae3a7905cf03e639@google.com> Subject: Re: [syzbot] WARNING: refcount bug in sys_memfd_secret From: syzbot To: akpm@linux-foundation.org, dvyukov@google.com, jordy@pwning.systems, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rppt@kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: jf8nkw1f3zazy1kjazz6m8d3rmpdoory Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=appspotmail.com (policy=none); spf=pass (imf24.hostedemail.com: domain of 30flzYQkbAKYYefQGRRKXGVVOJ.MUUMRKaYKXIUTZKTZ.IUS@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com designates 209.85.166.199 as permitted sender) smtp.mailfrom=30flzYQkbAKYYefQGRRKXGVVOJ.MUUMRKaYKXIUTZKTZ.IUS@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 23160B00009D X-HE-Tag: 1634990546-619616 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: syzbot has found a reproducer for the following issue on: HEAD commit: cf6c9d12750c Add linux-next specific files for 20211022 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=10bdd272b00000 kernel config: https://syzkaller.appspot.com/x/.config?x=dd1cd3d631599df5 dashboard link: https://syzkaller.appspot.com/bug?extid=b904a1de3ec43711eba5 compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12790a72b00000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13eb76dcb00000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+b904a1de3ec43711eba5@syzkaller.appspotmail.com ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 6528 at lib/refcount.c:25 refcount_warn_saturate+0x169/0x1e0 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 6528 Comm: syz-executor149 Not tainted 5.15.0-rc6-next-20211022-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0x169/0x1e0 lib/refcount.c:25 Code: 09 31 ff 89 de e8 27 1f 9f fd 84 db 0f 85 36 ff ff ff e8 3a 1b 9f fd 48 c7 c7 00 2e 04 8a c6 05 c7 25 a3 09 01 e8 92 ce 31 05 <0f> 0b e9 17 ff ff ff e8 1b 1b 9f fd 0f b6 1d ac 25 a3 09 31 ff 89 RSP: 0018:ffffc90001a4ff10 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88801d369d40 RSI: ffffffff815f06f8 RDI: fffff52000349fd4 RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815ea4ce R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00005555565e9300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f842b6f56c0 CR3: 000000001bc33000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_add include/linux/refcount.h:199 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] __do_sys_memfd_secret mm/secretmem.c:221 [inline] __se_sys_memfd_secret mm/secretmem.c:194 [inline] __x64_sys_memfd_secret+0x182/0x1e0 mm/secretmem.c:194 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fbeb6a4cf89 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffde5076be8 EFLAGS: 00000246 ORIG_RAX: 00000000000001bf RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbeb6a4cf89 RDX: 00007fbeb6a0fe93 RSI: 0000000000000012 RDI: 0000000000080000 RBP: 00007fbeb6a10f70 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007fbeb6a11000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000