Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1863781pxp; Mon, 21 Mar 2022 06:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1iGYQ+oCweXTYoVqisOaj+x4ZRXAyNwvs1OPQCkt0IipOh1agZihAlYY2/L7zbcHmuO2l X-Received: by 2002:a63:4e56:0:b0:381:4051:41 with SMTP id o22-20020a634e56000000b0038140510041mr18563330pgl.365.1647869997195; Mon, 21 Mar 2022 06:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647869997; cv=none; d=google.com; s=arc-20160816; b=m5TROKIJN5mqztIKWyQog9k/d+c9ub+eJuqwtALJsl6/YwmVL5lqv6aeMrjxFwf6w0 y31uX8iVYZYKTnLUHrisccNaK7LyztoBzMld+Nd85OSrViSA3XfK6REpOhO79tB9Ap4p y3qvt0N+QJGr+QyQYMG8dmVQsJu+fDKwMvv/3BlOy0/nxp+KLtvfC3k8AbnJ+l9iAS/s 2sBZR4AWFMA4gChE2FQhwEJAH0HCq8lLGNgrBspIazK5m8GrxwYUbjp9WmK5/hmoWYen Lpsc2TE/XTMPUtdQ3e35hgUT6yNgdGbivdCUxDOlWG66m6HSTiiqOU2GpioLCxS0nMVw YX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=KXYbBBC5J0h2TOeYQsMx7cKYoPfbw2MsahWUea49swo=; b=i9SKqa/poSLhRlaOIiofSaZ9/vGO7C7lGUBJ/zdyEECpvf3CGki3mFVGIi/9CGbuBL Q7dRC9aRx4ApG81Jqi04TfYbP9RqHJzxb2aqbHs+2cysf9g+ZiGUSdfMXklRC9e46vFT t7YWkvPvJ2P4/sjiZSEFuxjpyCoGHd/tJx6+FGcAIHv5QZtS7r+1GeV8ctjnnDvq7qAU rKeFAEEK0POdGmN31VmgM1RIefh+f3SgmRQxmMWAHWtlGZEAlw60RP8Fw2hcHyFUHEeJ WE+HSZ8r/2FHZKDQGXJ/BTZYzTSAhWJC55Yv5jsqP7P3aTKDsw1MtHVie20HUonjjjyM u2gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NBqbA8LH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n22-20020a056a0007d600b004fa3a8dffa6si4277106pfu.93.2022.03.21.06.39.42; Mon, 21 Mar 2022 06:39:57 -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=@redhat.com header.s=mimecast20190719 header.b=NBqbA8LH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345206AbiCUIZ6 (ORCPT + 99 others); Mon, 21 Mar 2022 04:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241261AbiCUIZ4 (ORCPT ); Mon, 21 Mar 2022 04:25:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2D6713D42 for ; Mon, 21 Mar 2022 01:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647851069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KXYbBBC5J0h2TOeYQsMx7cKYoPfbw2MsahWUea49swo=; b=NBqbA8LHBJE2BotMoUS+3pm/YEs+wS05e9PHTvJRNDLlShxFJMCqVJwGz75eaoWSp+Fv+2 f2Y/6Yp7oImXC2tplFiPQMZeiq6G4KLPC6UWv864V9/wBtHWfIQOvRF3iL59XFf/eCJ66n oOCMmn7Y6oBhoUHOgXQCV2EkiVfQr7c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-FOAIly8IOuub2Zyflacl4g-1; Mon, 21 Mar 2022 04:24:24 -0400 X-MC-Unique: FOAIly8IOuub2Zyflacl4g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D52785A5A8; Mon, 21 Mar 2022 08:24:24 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 402632026D60; Mon, 21 Mar 2022 08:24:23 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <000000000000b1807c05daad8f98@google.com> References: <000000000000b1807c05daad8f98@google.com> To: syzbot Cc: dhowells@redhat.com, christophe.jaillet@wanadoo.fr, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] KASAN: null-ptr-deref Read in __free_pages MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <970501.1647851062.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Mar 2022 08:24:22 +0000 Message-ID: <970502.1647851062@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 It should be possible to just test for the pointer being NULL in the loop before calling __free_pages() since the list was allocated with kcalloc(). David #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs= .git 6d39b096627f0a1eb6e14f049d8ae3c93e0290f2