Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6915977ybf; Fri, 6 Mar 2020 07:00:05 -0800 (PST) X-Google-Smtp-Source: ADFU+vtqvyw5RF2CYbdOcP22KYvKrtpirAi0mOOMzVg49Q2+vgB38uwiYai1cq3Vl7v242L4pco0 X-Received: by 2002:a9d:aa7:: with SMTP id 36mr2941144otq.52.1583506805804; Fri, 06 Mar 2020 07:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583506805; cv=none; d=google.com; s=arc-20160816; b=ejTFb/mqezZbA9aTd3PllOPa652GMR3wSxc9aEgnhrldGLe+5PYBCQvypeaBkUJSKI wyWV2BSmt4oHESDd9XtDbvAZwOBLH5lqTfU5m1sMeX8zTCB/mhYnXSXMaT/hl/WITG+P 7u5XofIxvvo6ydtNt86ZdkXWMHUuhMr9p34ThZ22ba47s/jEio7K3v6zKm2J7TJ/jrmi rbVbk7EFjMo+sjZDRZNN4a65yWzkrtqx42p0g9caDa078KljynKZsp3TP+RW6wM+ZUyH HsgvkUgimBkvxQXGrkgY5ctk9nPe21wOk2grcQu5mRMCsSEDRS0G9cl1ETHgfmeiJNa9 cBWA== 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=WBnwvd6m9GGRqbhsxjX4JoMKUAeQbZNO8mLVzJ/I/GI=; b=gCDs/gWcbFuyxZfy600R8BXMBaJrQewiOicxjKLRcycH6nXuxuECsST2ae6Z+t8v3O MgwVR6u5/JL28xFpOc+r4yf3mmRnwNoBQCdB57MIEP8BDWOUaJ/nqvI9jndGy4WrQIWY h26GqVMhpt1nlew8TKVcXdLItac6Y8G8cZcFqejTtdKolFGz6OpHzXhQWCI+UssgmbZf +meHV4FnrJ23EqXQSQsttGOAjnKUUAZipc422E8Ugl8t0tgyz8oXLKeby9W2AksRd/8s 9089JGp5+/SVG4PVS2EV76ySAUZswQTKHoj3tUqJgZRdbH1aY2x3m7DNrAEQmlQEzVcB HmfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cn8NdgPm; 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 l8si1446820oii.249.2020.03.06.06.59.54; Fri, 06 Mar 2020 07:00:05 -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=@google.com header.s=20161025 header.b=cn8NdgPm; 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 S1726956AbgCFO6Z (ORCPT + 99 others); Fri, 6 Mar 2020 09:58:25 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:40786 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbgCFO6Y (ORCPT ); Fri, 6 Mar 2020 09:58:24 -0500 Received: by mail-ot1-f67.google.com with SMTP id x19so2675038otp.7 for ; Fri, 06 Mar 2020 06:58:24 -0800 (PST) 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=WBnwvd6m9GGRqbhsxjX4JoMKUAeQbZNO8mLVzJ/I/GI=; b=cn8NdgPmltJKdgy+m9kDNqjqGycZMzVHjROSIydwYn9tO8Xj0E1IkfcWd5s6ogZUVP ggA3/DsZiXHFCDjbFPJFFr77dfLQlwzeNyP2+prS1NSc3JSOddnMBuN9Ss6nhZKII6oe vtYV3GHrLLjzCLcOeiAz9SveBLCWyBdU/LGrX8nqMttD9s4UzVDQfQ7yxJvXCU9LAzxF 9lYUForhjre8PyCILO6L8Q+TGx9WmZ1znzMUAwFZWyo3bxVCMMhBu0JtUyVsOhp8WZD5 7d8+l7IKI3MsF7z4OIa5E+UeJr5u05Mr1u3wEB6hvX+Gs0jnd+SVYp+JIDucPxeR/E1I BhzA== 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=WBnwvd6m9GGRqbhsxjX4JoMKUAeQbZNO8mLVzJ/I/GI=; b=slfcBIgVOWhGwkfgdDIK4rHOYcbdhA1M9zA2DrJsPAj/FHlySUuVuhyY8fYh42alAN 4928IjH9ar5avuRWvLlV47YkTah8SdtyOSnm7U6MEqxIkjOjklqu9YfFgHx/VHdPD3AY l/WC1XQMQVeyQ3gWOI2jSb17quj3xRpwNGdiGwO3irNWcC1Ttwou6k9/wICRh+UoaPm/ s4uVKBF5XJ4EZNdm1OmCfPHq5S1K/WXGr6eqRNeevfHCfK9ihotHXFV1JHgNlZtj62gr kR0/pteZyD9sF2y4twn0VuGwtoDSc/pLZ21TiW8yST8cLVb/gsNN8RrBc5GGX/iG/RmT w8BQ== X-Gm-Message-State: ANhLgQ0NMzGGu9IBS2XTlb+yCIwkSd2ViRVWgFTsw16HwGI7G7KH/+3s PJ/RZsWhf8KjjVtbWRI2D28/hIH9weKj8uVE/v3Smg== X-Received: by 2002:a9d:7358:: with SMTP id l24mr2744832otk.228.1583506703794; Fri, 06 Mar 2020 06:58:23 -0800 (PST) MIME-Version: 1.0 References: <00000000000067c6df059df7f9f5@google.com> <3f805e51-1db7-3e57-c9a3-15a20699ea54@kernel.dk> In-Reply-To: <3f805e51-1db7-3e57-c9a3-15a20699ea54@kernel.dk> From: Jann Horn Date: Fri, 6 Mar 2020 15:57:57 +0100 Message-ID: Subject: Re: KASAN: use-after-free Read in percpu_ref_switch_to_atomic_rcu To: Jens Axboe , "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 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 +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?