Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp731132rwr; Wed, 3 May 2023 05:32:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hstt3+iTm9uOp4lgC1UfXGPqWzwjlDglxpUiSMR9k16qYMuTAbVQ413c8VoCZUWx3qujp X-Received: by 2002:a05:6a20:144a:b0:f2:e20a:c8f4 with SMTP id a10-20020a056a20144a00b000f2e20ac8f4mr2000648pzi.31.1683117171428; Wed, 03 May 2023 05:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683117171; cv=none; d=google.com; s=arc-20160816; b=yek/wwrmLfPts+7u4I/K9VIMIHomakMb6GpZPXPo92duRov6x2nLJWcKp0OfqPC+jm vUonI1APFyx3frNTpquFs9TDTvKB7ZlXUAaZMjkvA2MUpm3VY7+Z+07SQKLv0ZnXo3Ma ZSb/aTLz9xx9z9O/9bEtRMrm4L+EffAoMYbL34CtuOgOt75wFVpm86KGG5Kir8lU2iWQ 7d2zq+Ln4kMD/9aqTVrXU89yNlg60Aospl79khOKld1fI8QTzzWBMF1GTUsq0B4a1U0Q 3u9uml3CqMiyz7ENpmCWGOsqE+a1ZjESjbgkQSmzBgQjm7Lols0TGDfmolCT+6Dc5MGb TrTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=1aj1/GqmVdeLgj770nx57dpPk5kBLDi8DCbCRfjzh5A=; b=BK7YQPizlg5jtYlRS8dpdMUSlBzHcRYbrC3+hqUtvPsYAyruPbIQ90kFxbQ2tNRGGr sAFTqWeZRuAPs+Kpu+Z+Du5Ixf13THP9Jm4Yo8JhhkXLaznoJiLpzfmgnL3tdAfCBsbM pOhP6Zu3oe7mzWQitUWYZAhuC66E79cTa6skBKhmkPaD3VWj+ABQozllp/1Mm4+BfHNY cwHhKgrgO8pYh4ISQo6xPAOJLRX8O4TO4uEucjUX9UyqueKk4Lg9X/85z9XPfgGQhVJa wdPjv7pHS3m3rmOsz6a7f6Ga/xhzfIteYo0VBCqAyjwN6+aCtf8tzV4Pq1FtVRL+ef5d EhyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=3NSXZIBV; dkim=neutral (no key) header.i=@suse.cz header.b=GiNeFG3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020aa79ece000000b0063b834cf20esi29206232pfq.91.2023.05.03.05.32.32; Wed, 03 May 2023 05:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=3NSXZIBV; dkim=neutral (no key) header.i=@suse.cz header.b=GiNeFG3R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbjECMXl (ORCPT + 99 others); Wed, 3 May 2023 08:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjECMXk (ORCPT ); Wed, 3 May 2023 08:23:40 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6325C5587; Wed, 3 May 2023 05:23:39 -0700 (PDT) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SORTED_RECIPS, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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