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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 2DDCFC43381 for ; Mon, 25 Mar 2019 21:14:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09D0F206BA for ; Mon, 25 Mar 2019 21:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730384AbfCYVOK (ORCPT ); Mon, 25 Mar 2019 17:14:10 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:55380 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729569AbfCYVOK (ORCPT ); Mon, 25 Mar 2019 17:14:10 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1h8Wv0-0006qr-9Q; Mon, 25 Mar 2019 21:14:06 +0000 Date: Mon, 25 Mar 2019 21:14:06 +0000 From: Al Viro To: Linus Torvalds Cc: syzbot , Alexei Starovoitov , Daniel Borkmann , linux-fsdevel , Linux List Kernel Mailing , syzkaller-bugs Subject: Re: KASAN: use-after-free Read in path_lookupat Message-ID: <20190325211405.GP2217@ZenIV.linux.org.uk> References: <0000000000006946d2057bbd0eef@google.com> <20190325045744.GK2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 12:18:02PM -0700, Linus Torvalds wrote: > COMPLETELY UNTESTED. And no filesystems converted to actually use the > new rcu_destroy_inode() thing. > > Hmm? Maybe, but we really need to come up with sane documentation on the entire drop_inode/evict_inode/destroy_inode/rcu_destroy_inode group ;-/ And I want to understand the writeback-related issues in ocfs2 and f2fs - the current kludges in those smell fishy. > if (unlikely(inode_init_always(sb, inode))) { > - if (inode->i_sb->s_op->destroy_inode) > + if (inode->i_sb->s_op->destroy_inode) { > inode->i_sb->s_op->destroy_inode(inode); > - else > + if (!inode->i_sb->s_op->rcu_destroy_inode) > + return NULL; > + } > + if (!inode->i_sb->s_op->rcu_destroy_inode || > + !inode->i_sb->s_op->rcu_destroy_inode(inode)) > kmem_cache_free(inode_cachep, inode); ITYM i_callback(inode); here, possibly suitably renamed.