Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3189178rdg; Tue, 17 Oct 2023 07:15:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IED+pjHZVWYlaDQtvumyXevfUQl9cl6V34Duw3+7CDNdiR1DtNlF/7HnsgIJU7Zrw6SdGNR X-Received: by 2002:a05:6a20:9192:b0:15c:b7ba:9137 with SMTP id v18-20020a056a20919200b0015cb7ba9137mr2310450pzd.2.1697552144175; Tue, 17 Oct 2023 07:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697552144; cv=none; d=google.com; s=arc-20160816; b=nzeNGxRjcvpA/YfzBDmZ90lPy60BU6oZTD31LYNHw/huW2jjQmFeLY2W7C78hUjA5a HQma4p3SjDAhpBuEl/5L85Zfh6vDiTtNAhU7EuHMW7nKOvGfZcNdt3tdnIkPD9D5O2zR w0dOmC9uws19MNV2yZDTY3LrbP1wTpVgn3boLGwOX/N9WiTujgDHWwQioMo8jpuFvTYT asGbf6xFdMh5oCClM/OGDzXr+ZMGna0Wyse+8hLRLxm5xa3he64d5vP5FCJcDUvHiUeS gezB5E8G5fTYCXU7qgbqYfY4fnLiv1UogDz670Xbf74iIcHt/Ar5nn9SSsqs5P2lt1iN MbmQ== 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; bh=lj+rrdViRJjUfQuPmcCus9x1Xjw7sD9CZl2Q7GMS/eI=; fh=XvBIzPsqgMmbd43cjrjCaz2L5BenGk7kt0hIA1RRK/g=; b=hYSz2lP61rx4TzWSJFmHwjUJHA9nc8sUYat8pfjqtnVUECzgk5On5lY6J2lUuSL+H3 lEzHrxEDwjMVM33fbHD3YnFAbtmXFeBsy+57zpIcpWZW2BxA6C3ENuCHXdYkFMUARrVb 7pIDgGfob7/tEXqSGunVPqBYc8793yPbw80578fgmqtfg5q9OhMorekgtGqGJub8zIri TEyseSQGRI0JWpoV3or1q+2ga3AB7j3C04lDZS5FVvD4kE2b4wCsPfdWIvnsy3BTK938 9tsRNEfvtMnryDXbc97XOH6kcteCJJgHXbD/YqW85TZrYDkyv8V20vvQWlAUAxwzgfN9 MJ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xuUpzZ/O"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b12-20020a63e70c000000b005b065bb6822si1861165pgi.286.2023.10.17.07.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:15:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xuUpzZ/O"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 38F2B803D56D; Tue, 17 Oct 2023 07:15:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343650AbjJQOPd (ORCPT + 99 others); Tue, 17 Oct 2023 10:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344037AbjJQOPa (ORCPT ); Tue, 17 Oct 2023 10:15:30 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD4FCF5 for ; Tue, 17 Oct 2023 07:15:28 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bfed7c4e6dso71901181fa.1 for ; Tue, 17 Oct 2023 07:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697552127; x=1698156927; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lj+rrdViRJjUfQuPmcCus9x1Xjw7sD9CZl2Q7GMS/eI=; b=xuUpzZ/Ob0jr9v6Zt/uC96iRMfllqQHP/OFZtZmQLObkOEpF3NO8JRIfA6lmjOxWOa an8rGewcAtilUBHOdMF7J+VIW2ZpVSFjD22yq2h9HaOY1H/kdvMAfanQSP6wr4Yse674 cIdRvFJTCTCNgrFcmzvhIzDH//3mucV9H6Mf6RejS0Mg0b5orCCZIF+YgwjpRn/DDwny Ji/LnQQeBdHUoZfLA4cRbaOvCqkN2GJlmdVJ16/b+94bzXy2kT04BykQnozR7XSAZHEx IHzFigL+ic/TMlBYfsJZFG2IgotTIJDf9ADckHyECriT+T5qepdlZypTStDfQYS7s3LF 3TEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697552127; x=1698156927; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lj+rrdViRJjUfQuPmcCus9x1Xjw7sD9CZl2Q7GMS/eI=; b=b18/mAvMt8k7DwrdEf/aUY/KwZQMMLWhRmXmkzCVtYYgdN3qcGLs3TlkYVAJmr6Jjs zX+38miG53R3nXfJ30Qn8xa6QUVNBdZLiIRhHZ9o0HhOS/hYFGAUXreAreofIM7GGgz2 7MjXzIBfsx15IoJuiKz2kIFKZMcEjgV5W9g4CPzD3lv3BbbC7bj92bE+5DfaORp5+OCQ Xk2sSKh3PfXnCGJYeG+BAdO3UrQBcYIWtC3Mf5hAaPfHmlrNb6ePvGnSdEnTJVfWRUKd S0LYmoFaxeVm16cyXytDa8iRv2THrHw95xdqG998smJqK30RyTFxgp2a6y5ekicQ7Hrc fWSw== X-Gm-Message-State: AOJu0Yw94ooatDMbLVuSRjRkbLDCeer3bzNKAcHQJWbBFi2gVhOLP12W nA1c1JHSNTd63/R7j+N7kK4D3A== X-Received: by 2002:a05:651c:145:b0:2c5:2191:3f35 with SMTP id c5-20020a05651c014500b002c521913f35mr1879222ljd.2.1697552127096; Tue, 17 Oct 2023 07:15:27 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c4fd300b004060f0a0fd5sm1663409wmq.13.2023.10.17.07.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:15:26 -0700 (PDT) Date: Tue, 17 Oct 2023 17:15:23 +0300 From: Dan Carpenter To: Lorenzo Stoakes Cc: Naresh Kamboju , open list , linux-mm , lkft-triage@lists.linaro.org, "Reviewed-by: Jan Kara" , Alexander Viro , Andy Lutomirski , Christian Brauner , Hugh Dickins , willy@infradead.org, Mike Kravetz , Muchun Song , Andrew Morton , Arnd Bergmann Subject: Re: mm: Unable to handle kernel NULL pointer dereference at virtual address - mmap_region (include/linux/fs.h:580 mm/mmap.c:2946) Message-ID: <3d007161-f0d8-43cf-a0c4-5d62cd38da07@kadam.mountain> References: <48534660-d5f7-45b2-8f99-19c8fb3e51c8@lucifer.local> <49bf8caa-e72e-406f-88d6-6d28aded078a@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49bf8caa-e72e-406f-88d6-6d28aded078a@lucifer.local> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:15:41 -0700 (PDT) On Mon, Oct 16, 2023 at 05:32:00PM +0100, Lorenzo Stoakes wrote: > On Mon, Oct 16, 2023 at 12:05:37PM +0100, Lorenzo Stoakes wrote: > > On Mon, Oct 16, 2023 at 03:52:07PM +0530, Naresh Kamboju wrote: > > > Following kernel crash noticed while running LTP hugetlb and selftests on > > > qemu-x86_64 and qemu-arm64 running with Linux next 6.6.0-rc6-next-20231016. > > > > > > Reported-by: Linux Kernel Functional Testing > > > Reported-by: Naresh Kamboju > > > > > > Test Logs: > > > ----- > > > > [snip] > > > > > <4>[ 97.499871] Call trace: > > > <4>[ 97.500288] mmap_region (include/linux/fs.h:580 mm/mmap.c:2946) > > > > OK this is from a patch of mine, and an easy fix (incorrect assumption about > > vm->vm_file == file). > > > > I will put a fix forward tonight. > > > > > <4>[ 97.500814] do_mmap (mm/mmap.c:1379) > > > <4>[ 97.501243] vm_mmap_pgoff (mm/util.c:546) > > > <4>[ 97.501711] ksys_mmap_pgoff (mm/mmap.c:1425) > > > <4>[ 97.502166] __arm64_sys_mmap (arch/arm64/kernel/sys.c:21) > > > <4>[ 97.502634] invoke_syscall (arch/arm64/include/asm/current.h:19 > > > arch/arm64/kernel/syscall.c:56) > > > <4>[ 97.503175] el0_svc_common.constprop.0 > > > (include/linux/thread_info.h:127 (discriminator 2) > > > arch/arm64/kernel/syscall.c:144 (discriminator 2)) > > > <4>[ 97.503763] do_el0_svc (arch/arm64/kernel/syscall.c:156) > > > <4>[ 97.504191] el0_svc (arch/arm64/include/asm/daifflags.h:28 > > > arch/arm64/kernel/entry-common.c:133 > > > arch/arm64/kernel/entry-common.c:144 > > > arch/arm64/kernel/entry-common.c:679) > > > > [snip] > > Have cc-d people in this thread on it, but for the record, -fix patch is at > https://lore.kernel.org/all/c9eb4cc6-7db4-4c2b-838d-43a0b319a4f0@lucifer.local/ Smatch also caught this bug. Your patch silences the warning. mm/mmap.c:2946 mmap_region() error: we previously assumed 'file' could be null (see line 2849) It's amazing that Naresh was able to hit this after it had only been in linux-next for less than a day. regards, dan carpenter