Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3116356rwb; Mon, 15 Aug 2022 18:30:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR79sF0HUI+KuBdi1OmmmyZt/5lpbCw2XkOF52d9Djue2cF+vvswIAJvX3JCxQZyvuWFiqnP X-Received: by 2002:a17:907:6890:b0:732:fcb8:909f with SMTP id qy16-20020a170907689000b00732fcb8909fmr11282748ejc.683.1660613455640; Mon, 15 Aug 2022 18:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613455; cv=none; d=google.com; s=arc-20160816; b=ilLxJUfX48gDQFcZwD63TipT2Vt3Xc6wlT61okxHMf15ZEbu/+J8m3AtVfZRFWJcMH gl+3huN/HJoGE+KSFvVvE2r+UnB17OU+Qer0Pr2feFrXU+j7SuBLXFc4UPn7FCAHCLkV s1fN81cEUJ4Rjdc9fELoikTw4YuMOqNAGoQwuWH1Dfys3e4Wn0CaS7oAa2nVfjfeV3hr 2/JrwiJ2v3t6zCSdJadW0kvN8ba6EYd5pBKBhB6kNBodgSytxoZS1SLIJdOEmKSspHQ6 iOXx8H/I/UfxijkyBelsvtBQzisX8uwhMcVVey84JG3zEp6KVdyUuyFrX2wGg2bMbwoj e6HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lEA7HVzP9q/YCsBtkuhe7rD7I/0rCcWhcr1L44kGYV8=; b=fQ1eRy5+CwM2CCBhvw74pInJyxlM3tGdomj7a4B+dlMuu6jnKx5f23x8v4CT8H4UOi UAztqD01pmQsqM7W4Q/vWIXhFpVpaqfGgnzOqhSB+DPvEJCpB3zMGae1ggQCrQTk+tMo imVobER2MYXKC1B/3L1aNLqh26fvBfIwjB+3CjQ2XwwgUNRRjzorx88p4rO2cRoiKczG KGo/9nTsBsF0XXJj9DZoYOKmR1NC+potOWeLdwqyw1ItupExvlMr+qNsIxG4hKd2X3jK PYZaox1aHqhOytQSuNXdwDQyDT6GWqK0AoBEmX9c23YyA0TEufE3jDTemP8DEx3IYPlM psBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U8S1W5lC; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a0564021e9200b0043bb69a32d6si10069472edf.561.2022.08.15.18.30.29; Mon, 15 Aug 2022 18:30:55 -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=@linuxfoundation.org header.s=korg header.b=U8S1W5lC; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352273AbiHOXC4 (ORCPT + 99 others); Mon, 15 Aug 2022 19:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352288AbiHOW73 (ORCPT ); Mon, 15 Aug 2022 18:59:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A0A27647F; Mon, 15 Aug 2022 12:57:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 825B46068D; Mon, 15 Aug 2022 19:57:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8634DC433B5; Mon, 15 Aug 2022 19:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593443; bh=vy+XyJyxYwqtiCG9GXqA01ZwcmWqeKZo0Fjae8q2p/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U8S1W5lCyo2+5pMoVUNP1bpNDeXGBmzsBpnSN6LOOc8uxbl36rCqcw/VHMbFScGBt Hpgz3ZNU4tARa2nuBlZBo89Ggl/saI2hrGd6c2/wv9SoIIKjAMwiJ+ND8xiEq0VmqF MZDX1KapHsAOu9Jl60de0/kIsQhUmOUjGPiewMw8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Wilcox , Uladzislau Rezki , Linus Torvalds , Joe Perches , "Jason A. Donenfeld" , Kees Cook , Sasha Levin Subject: [PATCH 5.19 0246/1157] usercopy: use unsigned long instead of uintptr_t Date: Mon, 15 Aug 2022 19:53:22 +0200 Message-Id: <20220815180449.423777119@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Jason A. Donenfeld [ Upstream commit 170b2c350cfcb6f74074e44dd9f916787546db0d ] A recent commit factored out a series of annoying (unsigned long) casts into a single variable declaration, but made the pointer type a `uintptr_t` rather than the usual `unsigned long`. This patch changes it to be the integer type more typically used by the kernel to represent addresses. Fixes: 35fb9ae4aa2e ("usercopy: Cast pointer to an integer once") Cc: Matthew Wilcox Cc: Uladzislau Rezki Cc: Greg Kroah-Hartman Cc: Linus Torvalds Cc: Joe Perches Signed-off-by: Jason A. Donenfeld Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220616143617.449094-1-Jason@zx2c4.com Signed-off-by: Sasha Levin --- mm/usercopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/usercopy.c b/mm/usercopy.c index 4e1da708699b..c1ee15a98633 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -161,7 +161,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n, static inline void check_heap_object(const void *ptr, unsigned long n, bool to_user) { - uintptr_t addr = (uintptr_t)ptr; + unsigned long addr = (unsigned long)ptr; unsigned long offset; struct folio *folio; -- 2.35.1