Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3665790img; Mon, 25 Mar 2019 15:16:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHQvN4LyQ6oSJgwKwbVTjBcWnBFWf1DmlUZNNO6/AGIfrbdleqLuonjVQsP9gIX7oQK8rt X-Received: by 2002:a65:63cd:: with SMTP id n13mr25952311pgv.193.1553552166695; Mon, 25 Mar 2019 15:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553552166; cv=none; d=google.com; s=arc-20160816; b=XwkLltPjOw1L4FZlOr/A6PhEtrV4F7M3C+WwQ2m3Hb2rBrVe21izA+Ejh+OIzUSs0/ gwZm/uJMq9Pz2yO76jkWGyIqTT5jGhn88zFskVH7yfwXo/U9s9N3vUwjzXNuQ7scKp5h mROir7PZAps6xO95/jX+pgm+aysgwmRqVeoABHm7+UeTs2Rtek/3pJEyZhFG7bFXSAUt 56y+Gu1vI+kOz8//oxHT/AFcL7XjSZFkDrm5K1onBHunYNdp527+0/xQhrwJIJBc4Ro2 HHVWu9GlzfSWf/m1sgEpkfd5LDjN1Z2XebcPaqy2kbZjrWm0dH0U3ktx58kx5l9pESdH j/BA== 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=AYHpnIVDKxmo6/3WilvIDPLEyb4Tfp7ExayQzfs9ItU=; b=SYpCeuBtY+mWR9/CcSFkezAgYFY5uu3+ZZL2FN95kv7GDPoBMxsQCYzPAilEaMcIKF ms+8Xmjpbu9fyZfA4QKD5F5UGB5Ej/n/Svucx5wZOxcXWOe735aX48Ln816nVq+UP74Q E4xACPll/N9sij8M+Odo4quid5eLTG11mjgC7JiwYbybiWSe/krePggBK+d1u/qbIK07 8KwpV91HnfdHG3AstPGQ8hzM9fO8VBXsOAUrJ1sHUwol35Kg3+sXUCl/8zipMWyY8RlD 42eFiRRH8O9uNSOr45stErx1/tRSVRJSvf8o6B7/xI2yiDEMTtMCHdz0WUiVOJGGkFaT kChQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=X5pQijd2; 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 e25si4441066pgl.514.2019.03.25.15.15.51; Mon, 25 Mar 2019 15:16:06 -0700 (PDT) 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=@linux-foundation.org header.s=google header.b=X5pQijd2; 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 S1730354AbfCYWOB (ORCPT + 99 others); Mon, 25 Mar 2019 18:14:01 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45154 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfCYWOA (ORCPT ); Mon, 25 Mar 2019 18:14:00 -0400 Received: by mail-lj1-f194.google.com with SMTP id y6so9285437ljd.12 for ; Mon, 25 Mar 2019 15:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AYHpnIVDKxmo6/3WilvIDPLEyb4Tfp7ExayQzfs9ItU=; b=X5pQijd2sCBbiFaZv9aOINBZAkjXG50xrGdu6/8gh9h2CggXiUhpetTONeM04KsBBF UhG2ENlH6PaHLFDngidjIDF5HFlqZR5/6PocyyQf84qd0bjbNFrf//+kG/3Dol9vOKKC w7wwVMsD00c286MEpwLfY6n8U8ebGLVKdQnLg= 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=AYHpnIVDKxmo6/3WilvIDPLEyb4Tfp7ExayQzfs9ItU=; b=eYkJgkAhVhfrhItn5sjBLScLvqsbLauio5rTKRdkjqM/Y0A+lHBy4tPwraKKjelGH5 VqBJA5roU5MFbw99TKvdjUNGzDgTLenuyM/BLKAImW9dotyBzFgK3Jdu90giRuvvh9Ts y8UJRUO8YduWOcH3MHq3KV4MkGZ7Fj06e80NxjWybaWoRDWZCx9GoVWd7jaGnQZoMBBU O0B+QoBOBMHkNYIhjarJJyIQgO4dFZlQQRnlvX4Y+zyxYwvJvAczjAcNazrge8f1T01t bJL95kRrlAusTav25qrUA/lPDR6D/yJZp1lh7fXKC6XDd0Bng6nRNSPokW19FBOn0ANX 4CJQ== X-Gm-Message-State: APjAAAXvcoqJaxY35jk/FhjkfxaHx72cUJpp4klMvRbiNaMJ7LqStZ2w 82e3iA6v8eFdAXSHE/r2knc+aoRDhvw= X-Received: by 2002:a2e:8648:: with SMTP id i8mr15301932ljj.166.1553552037735; Mon, 25 Mar 2019 15:13:57 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id i24sm3689767ljb.31.2019.03.25.15.13.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 15:13:56 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id a6so7179586lfl.5 for ; Mon, 25 Mar 2019 15:13:56 -0700 (PDT) X-Received: by 2002:ac2:4424:: with SMTP id w4mr13455337lfl.148.1553552036163; Mon, 25 Mar 2019 15:13:56 -0700 (PDT) MIME-Version: 1.0 References: <0000000000006946d2057bbd0eef@google.com> <20190325045744.GK2217@ZenIV.linux.org.uk> <20190325211405.GP2217@ZenIV.linux.org.uk> In-Reply-To: From: Linus Torvalds Date: Mon, 25 Mar 2019 15:13:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: KASAN: use-after-free Read in path_lookupat To: Daniel Borkmann Cc: Al Viro , syzbot , Alexei Starovoitov , linux-fsdevel , Linux List Kernel Mailing , syzkaller-bugs 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 On Mon, Mar 25, 2019 at 3:04 PM Daniel Borkmann wrote: > > I'm fine either way, I think the rcu_destroy_inode would indeed simplify > it nicely. In any case fwiw, here's what I'd have ready for standby on bpf > side and tested as well. Decided to get rid of bpf_evict_inode() entirely > since the only callback we'd really need is on final inode destruction: Yes, this looks correct to me. I think this is worth doing regardless. Even if we then make the vfs layer add that rcu_destroy_inode(), that will fit very well with this patch, and getting rid of the special bpf_evict_inode() logic and just letting the normal vfs inode cleanup happen looks like the right thing. So ack from me on your > Subject: [PATCH bpf] bpf: fix use after free in bpf_evict_inode patch regardless of what else we might end up doing in this area to clean things up. Linus