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 X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DBDEC43381 for ; Mon, 25 Mar 2019 22:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A2732063F for ; Mon, 25 Mar 2019 22:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553552041; bh=gptljuDKYtd4mBF7inngaQOoThcVckkYVNKZFHbmhYA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=WYPSPcZsKMZ9957pqwz+4/F/pX8IyJBIYPmkGcGlU/M+FJR52/ev3s9DRXlKHrTOp sNnbnsP73Q7Lb2WRRc1AXoeX6xqaXHJ0X3DJNrrBMMjxCZ/v7CTrUcsTx/EgKpw/CK zsyWlFoBLP9Teyy4/McF8BNGTZktlVIMrA+YXx9g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbfCYWOA (ORCPT ); Mon, 25 Mar 2019 18:14:00 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:35200 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729127AbfCYWOA (ORCPT ); Mon, 25 Mar 2019 18:14:00 -0400 Received: by mail-lj1-f195.google.com with SMTP id t13so9279615lji.2 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=lS75VgT2p7c31ZELSV+I12ZP3toxq47zh61vVULeDV1LdwzCyIghjSw9FRj3yUMDyt VmZYBTq1LlaktYvs6cc6osk0rBjwB/DmFebD8bEHseyfZhOwJDJ+RLYmBzH3Y8L7XGrh HuOgPwoYhuqJNmSfSk/XjQewacmiafv1DjlpdfOuwrUSnBbhJ4Sb3b1w8L7yn6B96Xgb y3/y9VuydPsQB7yzceviDP+J6bwPPmiSIM+5q6ztP+ajRWt+duX9KmWZ4zo34EInJ977 34qDgvDSJgm1hq6epTa+5p2UCZ9PVzFv9coj7wp7KKsRt0FnwNhfeJ0tY3RBqQg6a/ow 7d7Q== X-Gm-Message-State: APjAAAVmtWGNIEyU2hfx0ThTWDzgc2MIM5dVtsuaHh0M5VuEXO1S1L+y pWOefMLyJafJuy4VzhGglHP6wbJSsU8= X-Google-Smtp-Source: APXvYqyZWYSGHFS+UlM7ICjuTVbznlpy5+4ORqSsUV2DE6Y+82HcmhkCFGK7gNKHaKcpiQ+A9mbChA== X-Received: by 2002:a2e:380c:: with SMTP id f12mr14132663lja.116.1553552037693; Mon, 25 Mar 2019 15:13:57 -0700 (PDT) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id o21sm3777380lfl.54.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-f48.google.com with SMTP id 5so7157861lft.12 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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