Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp846548iol; Thu, 9 Jun 2022 15:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyODaLrWpGbaw5I3C+sPyeI7HvsMNtiHB/8Q5rwRuPJGS4bq+IKosVgCygf0R96V9oHvfYk X-Received: by 2002:a05:6a00:1690:b0:517:cc9e:3e2d with SMTP id k16-20020a056a00169000b00517cc9e3e2dmr42510941pfc.0.1654814590039; Thu, 09 Jun 2022 15:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654814590; cv=none; d=google.com; s=arc-20160816; b=b67J2SoOk8i2fnFhxz0vFKMXaJJhL91lK0Jxu+Thk8+/uyMVmVKijh6V7pbtFJIknu ub2Jg8/kjteFcKoObTXWypbpGumL55BDtP+M2CQXclEDXfdbb602FGrrKsKRgDqSarPI nsZ+Bqgp++QaN+FrMfOgBs0Bhs70sJmZmr47OMvv6GDcy3Izu+F5TLb1b/6RUJ4vgWmR 0R7GL2rH2n2/3NAIdO+KLZyNSepULu8YbeMY39+07GXbFB8dmdaZ78xl7RBVy9XFI6U5 OP+PZp5fZo1EMXJp3V1k2Io/F62eq7Zrh2eB5GdZPb6DVhZ9b2s2mFfs7O+BXY+OsAHv y8MQ== 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:dkim-signature:date; bh=2UPb9iES8+SbQezsY3NnPZtFOJWYv6G44yCeplV12hY=; b=QKov3eCB7Kg5RyHHK+p5pMisu10M2XARKy7YTtN21s4ZRpXBroF5qcgv3L6DNyaa/y zJyGFQi/5h4Tw876GU6GAdbx2s0icoJmZZ+TS992jVRYGHzc0qnwlC/q7l7esqwGoI13 b1Iw9iQXsHEQGmgSPIO2uOXmKGiwbGgrCwToViWUz2oKN3wUz/ZhG6GcGzHXaOdE8kC7 +QbT7gYTvmt1m2cICpQe2iBqUNN0gIkAAqyoLmS34/EHH945jRgwqj49dUeZEK4mbYoV ziAnTFb7DokApONrAupxO9yOv/VhZ5hyyOdElHP+65iSJ20G1TEcPW+vuald/iKbtZSP vbbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=AHIturnd; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902cecc00b00163f8ddf15asi37055592plg.478.2022.06.09.15.42.46; Thu, 09 Jun 2022 15:43:10 -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=@linux.dev header.s=key1 header.b=AHIturnd; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245571AbiFIWFY (ORCPT + 99 others); Thu, 9 Jun 2022 18:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234857AbiFIWFV (ORCPT ); Thu, 9 Jun 2022 18:05:21 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370D43A707; Thu, 9 Jun 2022 15:05:18 -0700 (PDT) Date: Thu, 9 Jun 2022 15:05:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1654812316; 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: in-reply-to:in-reply-to:references:references; bh=2UPb9iES8+SbQezsY3NnPZtFOJWYv6G44yCeplV12hY=; b=AHIturndbBN4CDx+oNBA07koXNaHAnzUcQra6tCpOXsmCewQ4MeJkX80gobs4dh570+SQq +Bo4vun5rtA+c12uZE3thcsY5phDz87d6tZkz1IiXOycsCMz7nrpGc2Jh+At2f1ecObMTL V4iu5dpTqsNdKlca0Ehf+ZZRKay27Ik= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Naresh Kamboju , Linux-Next Mailing List , open list , regressions@lists.linux.dev, lkft-triage@lists.linaro.org, Linux ARM , linux-mm , Stephen Rothwell , Andrew Morton , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Raghuram Thammiraju , Mark Brown , Will Deacon , Vasily Averin , Qian Cai Subject: Re: [next] arm64: boot failed - next-20220606 Message-ID: References: <20220609191221.rv3lqbhipnvvzt67@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609191221.rv3lqbhipnvvzt67@google.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 Thu, Jun 09, 2022 at 07:12:21PM +0000, Shakeel Butt wrote: > On Thu, Jun 09, 2022 at 10:56:09AM -0700, Roman Gushchin wrote: > > On Thu, Jun 09, 2022 at 10:47:35AM -0700, Shakeel Butt wrote: > > > On Thu, Jun 9, 2022 at 10:27 AM Roman Gushchin wrote: > > > > > > > [...] > > > > +struct mem_cgroup *mem_cgroup_from_obj(void *p) > > > > +{ > > > > + struct folio *folio; > > > > + > > > > + if (mem_cgroup_disabled()) > > > > + return NULL; > > > > + > > > > + if (unlikely(is_vmalloc_addr(p))) > > > > + folio = page_folio(vmalloc_to_page(p)); > > > > > > Do we need to check for NULL from vmalloc_to_page(p)? > > > > Idk, can it realistically return NULL after is_vmalloc_addr() returned true? > > I would be surprised, but maybe I'm missing something. > > is_vmalloc_addr() is simply checking the range and some buggy caller can > provide an unmapped address within the range. Maybe VM_BUG_ON() should > be good enough (though no strong opinion either way). No strong opinion here as well, but I think we don't have to be too defensive here. Actually we'll know anyway, unlikely a null pointer dereference will be unnoticed. And it's not different to calling mem_cgroup_from_obj() with some random invalid address now. Thanks!