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 A3B50C433F5 for ; Fri, 22 Oct 2021 15:07:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58EC56054F for ; Fri, 22 Oct 2021 15:07:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 58EC56054F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id CC38B940007; Fri, 22 Oct 2021 11:07:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C74CE900003; Fri, 22 Oct 2021 11:07:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3A0E940007; Fri, 22 Oct 2021 11:07:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A5CE3900003 for ; Fri, 22 Oct 2021 11:07:53 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5A62129E0E for ; Fri, 22 Oct 2021 15:07:53 +0000 (UTC) X-FDA: 78724403226.10.9A357FE Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) by imf30.hostedemail.com (Postfix) with ESMTP id 21BBCE0019AE for ; Fri, 22 Oct 2021 15:07:46 +0000 (UTC) Received: by mail-oo1-f47.google.com with SMTP id s80-20020a4a3b53000000b002b7ad17e169so1184927oos.8 for ; Fri, 22 Oct 2021 08:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VoMfgdK37qjGFnYk00ya3OQL9xVUBJpgRRYwx0+5Vro=; b=JHOFiG4rd/ZeejLA/Fvm3+hPIDnjFR+o4C4b65P0Al7A6hhFnXdQIEMUdwXHvYkCpX tFTMXw1FiMIiuysbbNvvF9VNl72veIL5gVk25U4yn2MqD5Avs+x+4BY1+Qj+1Ad83ROY ai+CPTfc5bc45eS51eqNjBLw6RZa4X+2LTAJ7T6YhudHmBocfybJFOF7LjsOCQg+ZV// 5+113d3ztunynR6AtyesaU0Nqso9QB0lD3Al6/ECDJmq44KF+tU8t72tmazf0yYOx/JH tqBMUGwvXag4U109+9YTXJZfgMBMQ2+i2PqV+NmYiUryJ7ijru656drcmFcER8JDxpWr m8gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VoMfgdK37qjGFnYk00ya3OQL9xVUBJpgRRYwx0+5Vro=; b=ErkBtNL1HAPK+RYDAF4FfxhNThvN409QjxaGgQ53kc1dWGbIWVOuMhWesX2Je+13NO 2IewCWdVDHAHzt3QNiOwofuT6i/7SveetKxPl32HTOYMZanxVc3ISwfy66sIlXXwQ8ia EhlBOwv6dgo+dMdWeOEpq8qldsZEJvJinQDU0zRo7ypZDQgPC6lB79EpZ2WZBw/vVWB7 8lO4JcB5/7nMV102wu3qs4C12CORE95A72dYL7fxRRxQOzaQKRZUdNhQVKm45o1pOzAw 8Kdq5hMQ/Lw5eDhksJ8hZw9s9jGvKTnnrkWP4/GBYZamIIK0hGBuga+yRxATeg3eXS/9 6GkQ== X-Gm-Message-State: AOAM5334eI1l0X2X54mA9ySBh8DB5AzqCHYVt36HvQHNvHrMRfDudfXM YB0I4x3I5n1HtozyXbKb8ybjTglMnrS+6KDEydqnSg== X-Google-Smtp-Source: ABdhPJy1F4Rf9LTc/XWo9q23M4iXcRiaC3ed2qiiYZ7yJafE97lNXO5BXzOjh5Xi6BAiSaVpDDp06mH4WRkFxjVanXs= X-Received: by 2002:a4a:d5c8:: with SMTP id a8mr458660oot.18.1634915271824; Fri, 22 Oct 2021 08:07:51 -0700 (PDT) MIME-Version: 1.0 References: <00000000000062d0fc05cef24c57@google.com> In-Reply-To: <00000000000062d0fc05cef24c57@google.com> From: Dmitry Vyukov Date: Fri, 22 Oct 2021 17:07:40 +0200 Message-ID: Subject: Re: [syzbot] WARNING: refcount bug in sys_memfd_secret To: syzbot , Jordy Zomer , Mike Rapoport Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 21BBCE0019AE X-Stat-Signature: gsehyfqazh65k755oa7bfh4expkrya3i Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=JHOFiG4r; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of dvyukov@google.com designates 209.85.161.47 as permitted sender) smtp.mailfrom=dvyukov@google.com X-HE-Tag: 1634915266-916059 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: On Fri, 22 Oct 2021 at 17:02, syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit: 64222515138e Merge tag 'drm-fixes-2021-10-22' of git://ano.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=178e86c4b00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=be398dd7862f4b36 > 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 > > Unfortunately, I don't have any reproducer for this issue yet. > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+b904a1de3ec43711eba5@syzkaller.appspotmail.com +Mike, Jordy for secretmem.c > ------------[ cut here ]------------ > refcount_t: addition on 0; use-after-free. > WARNING: CPU: 2 PID: 32193 at lib/refcount.c:25 refcount_warn_saturate+0x169/0x1e0 lib/refcount.c:25 > Modules linked in: > CPU: 2 PID: 32193 Comm: syz-executor.0 Not tainted 5.15.0-rc6-syzkaller #0 > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 > RIP: 0010:refcount_warn_saturate+0x169/0x1e0 lib/refcount.c:25 > Code: 09 31 ff 89 de e8 f7 b9 9b fd 84 db 0f 85 36 ff ff ff e8 3a b2 9b fd 48 c7 c7 c0 65 e3 89 c6 05 6f 6c 7f 09 01 e8 7e 4a 19 05 <0f> 0b e9 17 ff ff ff e8 1b b2 9b fd 0f b6 1d 54 6c 7f 09 31 ff 89 > RSP: 0018:ffffc90009f9ff10 EFLAGS: 00010286 > RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 > RDX: 0000000000040000 RSI: ffffffff815dbf58 RDI: fffff520013f3fd4 > RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000001 > R10: ffffffff815d5cce R11: 0000000000000000 R12: 0000000000000000 > R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 > FS: 00007f476a1e7700(0000) GS:ffff88802cd00000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000001b32c24000 CR3: 00000000494c4000 CR4: 0000000000150ee0 > 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:0x7f476cc71a39 > Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48 > RSP: 002b:00007f476a1e7188 EFLAGS: 00000246 ORIG_RAX: 00000000000001bf > RAX: ffffffffffffffda RBX: 00007f476cd74f60 RCX: 00007f476cc71a39 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 > RBP: 00007f476cccbe8f R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 > R13: 00007ffc5b5eb85f R14: 00007f476a1e7300 R15: 0000000000022000 > > > --- > 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. > > -- > 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/00000000000062d0fc05cef24c57%40google.com.