Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4400773rwd; Tue, 23 May 2023 07:17:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75/XCz0S2xVi3SEvZcFattnaPggO5Td10XmAbKbHnoHBDTVFI1yQUeQ9ohNZ6pCgcyd9Xq X-Received: by 2002:a17:90a:9483:b0:233:fb7d:845a with SMTP id s3-20020a17090a948300b00233fb7d845amr14043046pjo.4.1684851441087; Tue, 23 May 2023 07:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684851441; cv=none; d=google.com; s=arc-20160816; b=WGbhisIbDNsvbwgjyy38uobRt9E65/zaBIf8PpNlc1D6Bm3HEL8pT+eMjCR1PcKFJn XaThwLqkfIKcFLuXAIWfkKNHJ66qiFjmDOxyz/SWxVPCbEbpYObW5ciPiNl43oSYbPSC JZVvQAtELjHGYxVWdDZFUrEwgwkqR5RSsNNUvIvMqcmQklKx+9SPal9nnMr5w0O6jxSB 28rSYP1MOEAvxzUM8HHwW/BnatM0ToaJkYcAI3ORN+2rKnITM5W7yfI+2RU0nns7kMkB VT6lVuSPdvQIJmif8RhzSNLgz6aR6FKOBRRLiNNwDVcW/gvXJjPqNnEPpIs276/FHcNR z5rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=TbXL5Twdc1M3fkj/Sfo2AvG8vHBJBOECO6c9XrmOFlhfLJ/DVuT+unkT3ULZCZM8NU mc4GYiMiWN7cTwYQ4+uY1mus4nbfncA/Zghf5pNVM4kGGKgYlN2Yr983Myvkg/026WIN /DS+T1LpvYP08dlYaxQExq9UnsodkuWG+oB34fenm8hRHP7RYcs8YT1U+LERKyQ+RrJm ZwOXkaa6MwzMnOqYX/AxYdZn/ritb0qQgYFBBp8vdKQBUQxNYNa84+7zKDBksB4AKqCv EP0Q4JZaQVwmTtvBF3la0lUknbxS64fRFoAyOisilOiO2rRzBjJZhhPQ9bIytFfmG+nw rtCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yi3hcBL/"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp19-20020a17090afb9300b00246fe4e326dsi8711751pjb.81.2023.05.23.07.17.01; Tue, 23 May 2023 07:17:21 -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=@linaro.org header.s=google header.b="yi3hcBL/"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233878AbjEWOGx (ORCPT + 99 others); Tue, 23 May 2023 10:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237085AbjEWOGu (ORCPT ); Tue, 23 May 2023 10:06:50 -0400 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 748C3130 for ; Tue, 23 May 2023 07:06:47 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-4f4bd608cf4so1001117e87.1 for ; Tue, 23 May 2023 07:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684850746; x=1687442746; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=yi3hcBL/sMAfGA15PDa1P8NdEmww4HzJP2F/sUwI9IpWl8FAr9D8nzxcXs3kk9VZLg gqW+uTf0Quu6EKOMoBtewB5My0WXhMod0GC8z1ZbYL4s/yewGksiSDol/qQUkOAwxxUP tWgq8rOI0YG+2kzNAd6LFlZQnU/w/sUVfPTphub78KgJsbXLOjbr0epF5+oc5rNWTcLT 4z9nAmfx1uJBTtHPDaWVenyL8i5pZQeTVRUJb52fjzXC6jarDxR7o0xXXXnUa9XVKQra c4l8ZCAV1hnrQiBJbDsUuYXenW29rw/An0d2CKxpWMKMbNQerNNefqEtiX0g0tIAPTZn 73Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684850746; x=1687442746; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=CH2B8OsYnVQ+umNHKS9gP1lp6dAdILmi4qhdYTeg6PtWPdZilcn5f1CaaW8fUo/C2L zeqiM2MX5lsKTMtmhauCAJqpijtaIGTumiG6b/vFqn+aj/zSsfg1IKJ6plNoSrzuBXXU wNUihkst+FTah36A/BPPCdUmVW7gTMCJ5T2ILvK+MwZJ9017f6XiNUwolHLpEq3rv8aX 2ZhRJJZ2z9naWAocZdkFhit5DIDNq7Jp6K4UqSDbiKq3U3y8+sV3h8eUb1H+TUMgk/dk bK+WtSW18NfN11FWjINSeT079O6UZ0wmfmfUUW7m96ZZ4FsQhLCWDOZmEtc/Za5wxkQf W3WA== X-Gm-Message-State: AC+VfDw2OKx2wvl/QZMrWOpnkigP16VuEM9tdsXdASbUMHrutmnChoB9 redry9Z+GHLjK7gSh1Q/6viFEw== X-Received: by 2002:ac2:43a2:0:b0:4f3:a1db:ad4 with SMTP id t2-20020ac243a2000000b004f3a1db0ad4mr4313623lfl.66.1684850745735; Tue, 23 May 2023 07:05:45 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id h28-20020ac2597c000000b004e9bf853c27sm1346562lfp.70.2023.05.23.07.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 07:05:45 -0700 (PDT) From: Linus Walleij Date: Tue, 23 May 2023 16:05:25 +0200 Subject: [PATCH v3 01/12] fs/proc/kcore.c: Pass a pointer to virt_addr_valid() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v3-1-a16c19c03583@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v3-0-a16c19c03583@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v3-0-a16c19c03583@linaro.org> To: Andrew Morton , Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-mm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable 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 The virt_addr_valid() should be passed a pointer, the current code passing a long unsigned int is just exploiting the unintentional polymorphism of these calls being implemented as preprocessor macros. Signed-off-by: Linus Walleij --- fs/proc/kcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 25b44b303b35..75708c66527f 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -199,7 +199,7 @@ kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg) ent->addr = (unsigned long)page_to_virt(p); ent->size = nr_pages << PAGE_SHIFT; - if (!virt_addr_valid(ent->addr)) + if (!virt_addr_valid((void *)ent->addr)) goto free_out; /* cut not-mapped area. ....from ppc-32 code. */ -- 2.34.1