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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A15AC77B7F for ; Wed, 3 May 2023 12:23:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5D0D6B0071; Wed, 3 May 2023 08:23:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A0CE36B0072; Wed, 3 May 2023 08:23:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FD536B0074; Wed, 3 May 2023 08:23:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by kanga.kvack.org (Postfix) with ESMTP id 6F1A06B0071 for ; Wed, 3 May 2023 08:23:38 -0400 (EDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1269222769; Wed, 3 May 2023 12:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683116618; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1aj1/GqmVdeLgj770nx57dpPk5kBLDi8DCbCRfjzh5A=; b=3NSXZIBV+sB8PZpGuqg7j7n8qezGfY59qBYR1exU5COZm9JyT9WUogVvLcs81qYBbfvqTY mnX9FTtzTqJpjpLJssAtkgFMC3626NBevjRpjBUsu/GsQRAklTmpZ0tVpjZx/50KtzKew7 WJAWtn4yVvG1AV2zmBPL7ip1zuxzjEw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683116618; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1aj1/GqmVdeLgj770nx57dpPk5kBLDi8DCbCRfjzh5A=; b=GiNeFG3RUj/NEfWs7b+o/rT+gYLe6AH5qkekOLk5kVlW7cm1ufoaBPPhgnK6nVOXCmbvBg CJswCYKv5MvQ1ODw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 03F881331F; Wed, 3 May 2023 12:23:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NKzrAEpSUmQ3egAAMHmgww (envelope-from ); Wed, 03 May 2023 12:23:38 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 85A0FA0744; Wed, 3 May 2023 14:23:37 +0200 (CEST) Date: Wed, 3 May 2023 14:23:37 +0200 From: Jan Kara To: syzbot Cc: akpm@linux-foundation.org, hch@lst.de, jack@suse.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [mm?] [udf?] KASAN: null-ptr-deref Read in filemap_fault Message-ID: <20230503122337.fxyfchh4ximvnuwn@quack3> References: <00000000000090900c05fa656913@google.com> <0000000000004a34a305fac69bcb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0000000000004a34a305fac69bcb@google.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 03-05-23 02:23:19, syzbot wrote: > syzbot has bisected this issue to: > > commit 66dabbb65d673aef40dd17bf62c042be8f6d4a4b > Author: Christoph Hellwig > Date: Tue Mar 7 14:34:10 2023 +0000 > > mm: return an ERR_PTR from __filemap_get_folio > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15220608280000 > start commit: 865fdb08197e Merge tag 'input-for-v6.4-rc0' of git://git.k.. > git tree: upstream > final oops: https://syzkaller.appspot.com/x/report.txt?x=17220608280000 > console output: https://syzkaller.appspot.com/x/log.txt?x=13220608280000 > kernel config: https://syzkaller.appspot.com/x/.config?x=d1c8518c09009bad > dashboard link: https://syzkaller.appspot.com/bug?extid=48011b86c8ea329af1b9 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=137594c4280000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10cfd602280000 > > Reported-by: syzbot+48011b86c8ea329af1b9@syzkaller.appspotmail.com > Fixes: 66dabbb65d67 ("mm: return an ERR_PTR from __filemap_get_folio") > > For information about bisection process see: https://goo.gl/tpsmEJ#bisection Actually looking into commit 66dabbb65d67 it seems it has two problems - one in filemap_fault() where in: if (IS_ERR(folio)) { if (fpin) goto out_retry; we need to clear folio so that we don't try to folio_put() the error pointer. And another in afs_dir_get_folio() where the changes effectively make that function return ERR_PTR instead of NULL as well which will then confuse afs_edit_dir_add() and other callers (which were not updated). Honza -- Jan Kara SUSE Labs, CR