From patchwork Mon Aug 29 13:13:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12957786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA87ECAAD4 for ; Mon, 29 Aug 2022 13:15:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF0BF940008; Mon, 29 Aug 2022 09:15:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5218940007; Mon, 29 Aug 2022 09:15:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F388940008; Mon, 29 Aug 2022 09:15:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 899BF940007 for ; Mon, 29 Aug 2022 09:15:27 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4D644C0911 for ; Mon, 29 Aug 2022 13:15:27 +0000 (UTC) X-FDA: 79852676694.08.D541F17 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by imf04.hostedemail.com (Postfix) with ESMTP id 0335C40038 for ; Mon, 29 Aug 2022 13:15:26 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id x10so8004812ljq.4 for ; Mon, 29 Aug 2022 06:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=9rkFfHr5EkX5b+fiSmfBWgHjuBzmRZJuXzCeEx/qOoA=; b=aQR2QyQGFTdii+XNr3ERdpB9/5Y8RvC4SBdpFC4a0O+1A2eCrNRJVRfFzduA8QOwvD oRw3+zq5xwYjlkgGlBgKPZ4r6hLrm1A/hs9ha6a2dt7sO3JYfMYFuCNDdDexN6H3Y6wZ qL4roZNbkQtch9kO2hexmJT8m4OyvnMpXKbVVffeonCw6dRRGNJqem7TcqqAYStvSpzI BVIp/HE3ogMzdZ8qhYA5z825hrJV6h9BVvDdhI8acMfzC0LHgB5jEp6tIY7zsPmNKiDy tUUo/pLqX/L3sCPC+0Kh6BCEaaUzbYqnDT3NXd8RWkHY04UhN0LpdPk2e+m9P/VkZXaE t5gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=9rkFfHr5EkX5b+fiSmfBWgHjuBzmRZJuXzCeEx/qOoA=; b=HqvLU++ePmMH/vB/y4yA94zPy9GY+4WvQNzoqJB4+1qE2JoDdz8Ua5d6P/30vf+I3+ pmd36X5QD16sUM23z2h9D8OMT8Rc/M9MwVse2OEhnFTHHKoVWienSHLRMK9Q2iGoRmjc KPYILVo4LpL8xp3kB28P3eusytnQi74wOFh5S5Unm+9hJbfAHLtl2IE0u4a4je+BglEk RnU1npoJECyno1J6rfeRDtyWN5fz7jV6HxnHo+jiEtpVU+QKzC9CsTtkHOrbgjU3Yeo1 dH1m4DrN3d1FlJJ5fKxZlfIuucF77iMkmM7dkv0FNSzuoIUz3KV1/yGPctteSUKUOwjc wOUg== X-Gm-Message-State: ACgBeo24b/OgLLy0+ChEjnOKmquvyMnTq0EPFDzUmt2BDm5xTmGsoMm9 gYZc742UwX0WpuhWNMk9jbl44g== X-Google-Smtp-Source: AA6agR53skRt+mxkOoJuk0fFfwrLh4bpLrrQKaoPhF5Ek10UyfxFK7OjBMWG+CRCa6LKHx2NYlY6ag== X-Received: by 2002:a2e:b88d:0:b0:25f:f179:3837 with SMTP id r13-20020a2eb88d000000b0025ff1793837mr6062269ljp.357.1661778925279; Mon, 29 Aug 2022 06:15:25 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id z16-20020a05651c11d000b00266461bf934sm175403ljo.107.2022.08.29.06.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 06:15:24 -0700 (PDT) From: Linus Walleij To: Andrew Morton Cc: linux-mm@kvack.org, Linus Walleij Subject: [PATCH] fs/proc/kcore.c: Pass a pointer to virt_addr_valid() Date: Mon, 29 Aug 2022 15:13:17 +0200 Message-Id: <20220829131317.114007-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661778927; a=rsa-sha256; cv=none; b=G3WhYBLXN/nHu7/vBoUTJB2FRN5fYrtZ1rMcIUs2dsEz6AMth7R78xq18dMrNC+X265xFO NlFssmNqy6lIP1+PaAZ/JY+foWqlvVTCW+q4w6ixbrqLR9/ImhIGBznJKaaYhSl6s23MTK CjqgTKIDPXcf6zknXg7GXAoTK1jCRVU= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=aQR2QyQG; spf=pass (imf04.hostedemail.com: domain of linus.walleij@linaro.org designates 209.85.208.178 as permitted sender) smtp.mailfrom=linus.walleij@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661778927; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=9rkFfHr5EkX5b+fiSmfBWgHjuBzmRZJuXzCeEx/qOoA=; b=b+y68eMgg251yYTYi0KmjkyUZc6bvf067cuzb5SeVyopKSMrE0ndKs8afxC8Ds2uLoGw+p rQc23i5zLXKdflwhq10T/ieHyY9RR342H7TkRXvHDweMJHTlxwrBYbTtYvHNlOx1eG31vh g7forGs66IDE43+aJpeq/OGLQSyksmM= X-Stat-Signature: pnmibo8q35ki4aggy6d48t5s94743w9r X-Rspamd-Queue-Id: 0335C40038 X-Rspam-User: X-Rspamd-Server: rspam01 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=aQR2QyQG; spf=pass (imf04.hostedemail.com: domain of linus.walleij@linaro.org designates 209.85.208.178 as permitted sender) smtp.mailfrom=linus.walleij@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-HE-Tag: 1661778926-138504 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 dff921f7ca33..f358960b7a1f 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -200,7 +200,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. */