From patchwork Tue May 23 14:05:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 98021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2189086vqo; Tue, 23 May 2023 07:34:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lGRSw7YapNTG0uuwMtwxYxBOa0tvEu9zY2j6YMtlJMI4C9fDlMOHWl/ZsMnaGjfOPUh4c X-Received: by 2002:a05:6a20:549d:b0:10b:acb4:6249 with SMTP id i29-20020a056a20549d00b0010bacb46249mr7550319pzk.8.1684852460879; Tue, 23 May 2023 07:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684852460; cv=none; d=google.com; s=arc-20160816; b=aJtNYh90EiUBkVxnHKt7K+K0a/bzKTV3kbD3BQU5zRx/2mCoYbRW85/Wkrea06St42 h98aLW4fjbSYc5rh2izX4ccIqzQ3M8KwLvUhOpQkPBjrbGcGeTIo8R9jYSBswiNz0uYV LKNy4PCS21CG3i5Tr7vIAmV+mN5g4Pevt2ZmllWV9vq2LCmwPjsZDGZX2Ge35DCPv9kE 7OdCnrtFksSpzKs1YxzsPE5GjrRlUc2J8jsLFNO4AeVWzUWPVdXq+geUZyAeLN07TXO/ 8sXkCY4V0PDcT1t5JRFzIwO6PZ2APv4l/Aaw4QZnhiDYYs1FwcQgvjFwyA27Hx5UDj+z x2YA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a63b90c000000b0052866b25be5si81064pge.746.2023.05.23.07.34.08; Tue, 23 May 2023 07:34:20 -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 S237090AbjEWOGy (ORCPT + 99 others); Tue, 23 May 2023 10:06:54 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766695853850783278?= X-GMAIL-MSGID: =?utf-8?q?1766695853850783278?= 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. */