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 78646C433EF for ; Sat, 23 Oct 2021 19:35:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03D6160EDF for ; Sat, 23 Oct 2021 19:35:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03D6160EDF 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 3C2D9940007; Sat, 23 Oct 2021 15:35:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 373106B0071; Sat, 23 Oct 2021 15:35:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 261AF940007; Sat, 23 Oct 2021 15:35:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 14D6A6B006C for ; Sat, 23 Oct 2021 15:35:21 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C2DC428DBA for ; Sat, 23 Oct 2021 19:35:20 +0000 (UTC) X-FDA: 78728706000.17.C51DBE9 Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by imf03.hostedemail.com (Postfix) with ESMTP id 2FDC030000AD for ; Sat, 23 Oct 2021 19:35:17 +0000 (UTC) Received: by mail-il1-f200.google.com with SMTP id s8-20020a92cbc8000000b002582a281a7bso4399370ilq.10 for ; Sat, 23 Oct 2021 12:35:20 -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:message-id:subject:from:to; bh=nTKy/b1KEgyo1EeTP7Q3lB04zZjv6HkFcUrltUrjhvs=; b=E6ksdlxFazAhzsr5FKWGoSfpBJe9Ie4xqq42mca0vTKoR0qpMek7+Soce4yHfNGv9S lbQnCFU5mRuoC0XsIaK/qDsn4f49Z3apqFdTHk1I1v3pmTI8jB1r13tgCBZxEskLSXBm rV+QdIQ2iLWE0xOersyeoQqJ9J9eS4sRpvX5OWbnx/HQh21JKwi10un0hKBYkHFeEjGi qFLEJzLw14g3NjI87HDZ/pYzYiYFWACWCWvU/I0JmNKJRhoHPGfOzKDCrY65cRXkF3Pp bLB1IsW0KCrbTif4Q3Zi2yRtixJsiLlPjPuniw675Pbiret8I7MT3fpAu38pzWE4C7vd L5bQ== X-Gm-Message-State: AOAM5335dL/yIGMnnqv05Rtn0V+b+uhAmuQO3w+HKABPKzuSLjnh6Xqp laBdbwmzpDIkri9VFMoYrq9ROR5wBKKYhivINpf0Cl/K1rnq X-Google-Smtp-Source: ABdhPJwTsASnJUtJu6/m0KTF1qXMif/iV+YKRd289Nhhe4VX+V9dk8VgSpgnHF35tSxprZOEdq//emRWqAVpwkyyMWky8Qil1zRC MIME-Version: 1.0 X-Received: by 2002:a05:6602:48c:: with SMTP id y12mr4807587iov.184.1635017719823; Sat, 23 Oct 2021 12:35:19 -0700 (PDT) Date: Sat, 23 Oct 2021 12:35:19 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <00000000000064451505cf0a3aa2@google.com> Subject: [syzbot] WARNING: refcount bug in memfd_secret From: syzbot To: akpm@linux-foundation.org, jordy@jordyzomer.github.io, jordy@pwning.systems, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, torvalds@linux-foundation.org Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: f7ths8dgxh17owp534a57sk6ttwsawpu Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=appspotmail.com (policy=none); spf=pass (imf03.hostedemail.com: domain of 392N0YQkbAKIUabMCNNGTCRRKF.IQQINGWUGTEQPVGPV.EQO@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com designates 209.85.166.200 as permitted sender) smtp.mailfrom=392N0YQkbAKIUabMCNNGTCRRKF.IQQINGWUGTEQPVGPV.EQO@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2FDC030000AD X-HE-Tag: 1635017717-469 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: Hello, syzbot found the following issue on: HEAD commit: 9c0c4d24ac00 Merge tag 'block-5.15-2021-10-22' of git://gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=115a0328b00000 kernel config: https://syzkaller.appspot.com/x/.config?x=59f3ef2b4077575 dashboard link: https://syzkaller.appspot.com/bug?extid=75639e6a0331cd61d3e2 compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13a035c2b00000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ae869f300000 The issue was bisected to: commit 110860541f443f950c1274f217a1a3e298670a33 Author: Jordy Zomer Date: Wed Sep 8 02:56:18 2021 +0000 mm/secretmem: use refcount_t instead of atomic_t bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1433ea1cb00000 final oops: https://syzkaller.appspot.com/x/report.txt?x=1633ea1cb00000 console output: https://syzkaller.appspot.com/x/log.txt?x=1233ea1cb00000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+75639e6a0331cd61d3e2@syzkaller.appspotmail.com Fixes: 110860541f44 ("mm/secretmem: use refcount_t instead of atomic_t") ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 6529 at lib/refcount.c:25 refcount_warn_saturate+0x13d/0x1a0 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 6529 Comm: syz-executor563 Not tainted 5.15.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0x13d/0x1a0 lib/refcount.c:25 Code: c7 80 e1 b3 8a 31 c0 e8 31 8e 3b fd 0f 0b eb a3 e8 b8 79 71 fd c6 05 43 86 b6 09 01 48 c7 c7 e0 e1 b3 8a 31 c0 e8 13 8e 3b fd <0f> 0b eb 85 e8 9a 79 71 fd c6 05 26 86 b6 09 01 48 c7 c7 40 e2 b3 RSP: 0018:ffffc900012dfed0 EFLAGS: 00010246 RAX: f8bc46cda99bde00 RBX: 0000000000000002 RCX: ffff88801e03d580 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: 0000000000000002 R08: ffffffff81695fe2 R09: ffffed10173a57a8 R10: ffffed10173a57a8 R11: 0000000000000000 R12: ffff888078595180 R13: ffff88806f5e8030 R14: 0000000000000003 R15: dffffc0000000000 FS: 00005555558b2300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff91ea21000 CR3: 000000007077c000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __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+0x2ea/0x350 mm/secretmem.c:194 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f09de6c7f79 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:00007ffe81d58a98 EFLAGS: 00000246 ORIG_RAX: 00000000000001bf RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f09de6c7f79 RDX: 00007f09de68ae83 RSI: 0000000000000012 RDI: 0000000000000000 RBP: 00007f09de68bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007f09de68bff0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 --- 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#bisection syzbot can test patches for this issue, for details see: https://goo.gl/tpsmEJ#testing-patches