Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3119283rwb; Mon, 15 Aug 2022 18:35:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6EuVloBqcsnCCiShBe+izvd749OKG8+QIDAamwBEAhEBdkJ6GHt5aNds13qzuM3TmnIrLz X-Received: by 2002:a05:6a00:1a47:b0:52e:6a8c:5430 with SMTP id h7-20020a056a001a4700b0052e6a8c5430mr18483421pfv.48.1660613726186; Mon, 15 Aug 2022 18:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613726; cv=none; d=google.com; s=arc-20160816; b=XwAc27B82djhiFXhnLhSNYWCGmqkpipq+5tbhdQiIbG+bwJQEzArGku+iDkuO1bhIL 3su2jQ3bUZPuFRe6m4OBDc79M38RzzhWf4qSfkwDm7kPghMDBEDs4iUwjr37IHd2Ns8t P5aNdSGfRjSLKX/dgnvgR13u68P8IhWudpRMkU4vxJIdDGa4TQZEMFZC3k2GhFKjlqQR nDB2wGSaTx026dmbZGcSL6kBftf++OGVW7JoCaHArE0QHZW/YzOF4rfCTA8rnCeTEIO1 xgtSxLuKiUmb0MuZlTP3KGinn9sc42SH+3sAETy8Pja99hzdFF4OMNE0BglG55Ul9M1Z 0o+g== 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:date:dkim-signature; bh=UeErxgbLsIOnl1kKr0gd1MbfngQnOPyfN93GP4+152g=; b=vgfN+QaBGhE2OSHQCHpIQBSOk6whSm9WkvQlnem+iLicg4y/BR4Ejfla/r0R6nNORM 3OQuJueeH5kpqACHc8OE2GZUeBCU6oMRPrYiNfx5mOYRVxzjZRnv+4SPB4BZXTzEvrxm c9xdtXlyWXYEhiZWqv7oB/0IoKPtCYsTwflhFIYut8nNzHOfkeJXyjYaNKhagBmET2IT +0PCP4SnFtqE4MXFyQta016XaN91sQdQLAp359Pimu1Odb8U3SOYS/4mpFVCNSF1ILvT gBRyPef0SKCCkiqnNffkjnL3puyGZu7O2vVzo904/U40vBJVbpJXVOs6ce7fK9ka+mZj fEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KwI+w1Wm; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l184-20020a6388c1000000b0041dcd148307si11938913pgd.655.2022.08.15.18.35.14; Mon, 15 Aug 2022 18:35:26 -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=@infradead.org header.s=casper.20170209 header.b=KwI+w1Wm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353621AbiHOXcH (ORCPT + 99 others); Mon, 15 Aug 2022 19:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343956AbiHOX0K (ORCPT ); Mon, 15 Aug 2022 19:26:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8521747B9B; Mon, 15 Aug 2022 13:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UeErxgbLsIOnl1kKr0gd1MbfngQnOPyfN93GP4+152g=; b=KwI+w1Wmmgs2RIYXYUmn/oWg3t HZubBothMQce3fFWX8GXOWkWDc7Vc6TNeF2nZPtru/dO1woNE1bvTZ/mViIZ5PRbpuGvu3FQdRsOv y5/3PvKxKUrOGiCTFPJPz17iDysP5xjxIdBnh9MpOyVYGWhe1vLxH2BYaeDLuZIohrSvqUpHtwKMV V+DLtqiLsKQZJquaiKbQVPDOy+R8Xygz5EKfDS7FQiG4MM4dTUldAe5o7QG2RUBg2a9ptovyvzov/ JTxIrcqbNiLAAiQZlG9FFLt+oi234Ibx1AU4Xh1YFLCSGwrHTfwIbj7c/lTZu55Clddn0Dm7hkw6k /0WcpsTQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNgLt-006383-RC; Mon, 15 Aug 2022 20:06:21 +0000 Date: Mon, 15 Aug 2022 21:06:21 +0100 From: Matthew Wilcox To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Uladzislau Rezki , Linus Torvalds , Joe Perches , "Jason A. Donenfeld" , Kees Cook , Sasha Levin Subject: Re: [PATCH 5.19 0246/1157] usercopy: use unsigned long instead of uintptr_t Message-ID: References: <20220815180439.416659447@linuxfoundation.org> <20220815180449.423777119@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220815180449.423777119@linuxfoundation.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Mon, Aug 15, 2022 at 07:53:22PM +0200, Greg Kroah-Hartman wrote: > 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") Not sure why this needs to be backported? > 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 > > >