Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6950972ybf; Fri, 6 Mar 2020 07:35:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vsBLAYy2V/ZOGvoJjF53q7aj6xITC6LuPHKdGcMq37NkNSTN2c/izci1ruJEvzXivBuqgbi X-Received: by 2002:a9d:6443:: with SMTP id m3mr2985850otl.20.1583508900149; Fri, 06 Mar 2020 07:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583508900; cv=none; d=google.com; s=arc-20160816; b=eDbZxGAOquP+78mG38ssyuoFyzFK1Xb4H0suhav1WWZPxn5ZCUWy1pZScVNJS+yNie 3sJ5fD6R8BVU5wAQKm74oiI+ROENllvaLbgo9LI+fmZNGJSci8+uqedEsgS7LpqN7/uz K3o7rBKKaha9PoH5NnfBlUfFiiFHv2RHq+dVDhiipY8P/OYz6q3eZbIf52OEEkWuCRGH kXhigESCzDj6HkbBGo4KGSBivJ6L4DR27RFAyzYap97ayaiOaBisrWkPvQwDD8VOofok JDMbcrQqDlpuVz5o5BN/9Z1BW4J0PwlVW3R0dph9GBGrjV6JG8nkuwUaSz5U6ZZWdAdW pQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=i4gZAHKM5OgHpwpoUr8vvAtzzBGa02whKHhEoVE9mEM=; b=kXf0jpqJH710ODRIAK5vl6aPHLvJG/JcRasXaFLQOJ6mPSFSUyXF0uiD+biPcYsCcf h8Pr1gI6pkvhAfl2yBUJeeKN0H1s1eGwdeWofR6ZbGNxJTawA7fALwJNjnFFI3r3IZ1O V+Wd4lCdG3eJMC9EgRzMXJogsgfXjlZsdkVASgt8u0/GpTYfz0kj2axKN+7FWqMtUxMk b11F56sq/Eb7NRygbqWoHFZZPbr9/07ddxOybsobTI2BfUxSkgq5Mp42hWtdGwB/M+Ph f68Sti/LwvdeSUzBlH6AtcvfC5BbEiM3Z39e66jpUtq6S6aF5TAilihNonyxW2LxNDPV x8gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=G9n5QPlM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si1627483otp.281.2020.03.06.07.34.47; Fri, 06 Mar 2020 07:35:00 -0800 (PST) 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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=G9n5QPlM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbgCFPeb (ORCPT + 99 others); Fri, 6 Mar 2020 10:34:31 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:42779 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbgCFPeb (ORCPT ); Fri, 6 Mar 2020 10:34:31 -0500 Received: by mail-io1-f65.google.com with SMTP id q128so2450311iof.9 for ; Fri, 06 Mar 2020 07:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=i4gZAHKM5OgHpwpoUr8vvAtzzBGa02whKHhEoVE9mEM=; b=G9n5QPlMISshbixsE+ie6E13cNyBLXq6JKRGFjB4EP/S6Zrh0gMhC1EgqWO1uaiM9I nmFP2D+ghRJwsNVvev4DcCCKo4U/OO9W5LMqH9qt/4nrlcK3KfPYLN32uN/SaEuFAykQ ouTmEboOt7VPd5B+wOtqh90mgfJ4d4GPVkSrF9VjtdnE5O7AcPRidOQ11uwJWcXC6UOn tezGudUm9cWHg6X/3E9T/SpNy+JO5Rc4FMSj7NGmcPtue0uuMEBch6sE4fn4gc0pmeTY 8fcT0U5DxWtmiohEecpi1xqc8Fp4NiWAx3cxckUL3p/bynqs1q7MuEGMqxEkKaK5R1vZ JiAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=i4gZAHKM5OgHpwpoUr8vvAtzzBGa02whKHhEoVE9mEM=; b=hyVxet56Q7AvYx8yIxEOrTot72IYfvgKvYEWKFngz+LxeULr8mgDHDhlvt0xR95JBc AM4novAJIe1OBZHClnCtJ95yFlUjsrx1w9wDuZxFArqautK9lk61KxUDOap6qZpGORzI 31E0YJxhdo49M98L1E8LM+7QwizIfTP4ihNypj4DiNQwvPRG0citNAJRlw/ifEDL7AGZ ZzawevnO9nEmBm5nclYpJSwuu/byz0W6VpAofVL7NrXfN697iKJZ59uyg2pbg1e2BFyV HVawO5uxB60cXPc/YGhgBcwbwa0vMJWj5/u0DMONp7sZRwdCJaHDKmjVirVLb5N+SIGO rltA== X-Gm-Message-State: ANhLgQ1Kt7BZm6v6WCBpOA76qYEHQf6NvvKhUHfrxv7VxXlV6AuRF525 TmYcGUn7pwcJgVSMpreS27zB3w== X-Received: by 2002:a05:6638:e8b:: with SMTP id p11mr3464609jas.11.1583508870767; Fri, 06 Mar 2020 07:34:30 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id l17sm11448757ilc.49.2020.03.06.07.34.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2020 07:34:30 -0800 (PST) Subject: Re: KASAN: use-after-free Read in percpu_ref_switch_to_atomic_rcu To: Jann Horn , "Paul E . McKenney" Cc: Dmitry Vyukov , syzbot , Al Viro , io-uring , linux-fsdevel , Borislav Petkov , "H. Peter Anvin" , LKML , Ingo Molnar , Peter Zijlstra , syzkaller-bugs , Thomas Gleixner , tony.luck@intel.com, the arch/x86 maintainers , Dan Carpenter References: <00000000000067c6df059df7f9f5@google.com> <3f805e51-1db7-3e57-c9a3-15a20699ea54@kernel.dk> From: Jens Axboe Message-ID: <075e7fbe-aeec-cb7d-9338-8eb4e1576293@kernel.dk> Date: Fri, 6 Mar 2020 08:34:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/6/20 7:57 AM, Jann Horn wrote: > +paulmck > > On Wed, Mar 4, 2020 at 3:40 PM Jens Axboe wrote: >> On 3/4/20 12:59 AM, Dmitry Vyukov wrote: >>> On Fri, Feb 7, 2020 at 9:14 AM syzbot >>> wrote: >>>> >>>> Hello, >>>> >>>> syzbot found the following crash on: >>>> >>>> HEAD commit: 4c7d00cc Merge tag 'pwm/for-5.6-rc1' of git://git.kernel.o.. >>>> git tree: upstream >>>> console output: https://syzkaller.appspot.com/x/log.txt?x=12fec785e00000 >>>> kernel config: https://syzkaller.appspot.com/x/.config?x=e162021ddededa72 >>>> dashboard link: https://syzkaller.appspot.com/bug?extid=e017e49c39ab484ac87a >>>> compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) >>>> >>>> Unfortunately, I don't have any reproducer for this crash yet. >>>> >>>> IMPORTANT: if you fix the bug, please add the following tag to the commit: >>>> Reported-by: syzbot+e017e49c39ab484ac87a@syzkaller.appspotmail.com >>> >>> +io_uring maintainers >>> >>> Here is a repro: >>> https://gist.githubusercontent.com/dvyukov/6b340beab6483a036f4186e7378882ce/raw/cd1922185516453c201df8eded1d4b006a6d6a3a/gistfile1.txt >> >> I've queued up a fix for this: >> >> https://git.kernel.dk/cgit/linux-block/commit/?h=io_uring-5.6&id=9875fe3dc4b8cff1f1b440fb925054a5124403c3 > > I believe that this fix relies on call_rcu() having FIFO ordering; but > > says: > > | call_rcu() normally acts only on CPU-local state[...] It simply > enqueues the rcu_head structure on a per-CPU list, > > Is this fix really correct? That's a good point, there's a potentially stronger guarantee we need here that isn't "nobody is inside an RCU critical section", but rather that we're depending on a previous call_rcu() to have happened. Hence I think you are right - it'll shrink the window drastically, since the previous callback is already queued up, but it's not a full close. Hmm... -- Jens Axboe