Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4318072rwd; Tue, 23 May 2023 06:18:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LVR5pTrQqQTfjL4qJXaIU/Lv4oBoaQ3/AA5dBBgn8KA7lgZY/Gp87MK2fdOdQI6gGkGsW X-Received: by 2002:a05:6a20:160e:b0:10b:6b1f:acf1 with SMTP id l14-20020a056a20160e00b0010b6b1facf1mr9147056pzj.29.1684847910726; Tue, 23 May 2023 06:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684847910; cv=none; d=google.com; s=arc-20160816; b=a1qqNv/qYV8EN1kfa75atWOOIyElUIgDQdEVOnDMkiwtTqj6TwHm8Gvp696ABV2sXe t7lP0LpwG9336/g+dtLgc3/C4Qk1YxZJBXCJ+XoDwDp10sjQSHlXbC11x9Kcwlm99K/X sHeO+6e4J3HUO58fHxFUsUvAm8aTuC2IyDLXMQKilISDLu1QharFYkqBQ9e/YaSTTXPk idi3NGYcc75SmIE8jcE88pRjXedEL4hbRaznNyBbNdD63Jbwmlt3ZooCQWKonRxwNO4U 4VYPDDMeAjQzyc+JrIgkW8gUDF2z3zxRqOYiWxVum1Gw9wsbjy1GFXeqg4JngLdUgUjY cpUQ== 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; bh=jL7/XByFM774I9rrb8eZqb+0SKwaIo2cZ+YkazPUvUw=; b=y8W+OeX0ieyT3k52A8a0ozk3OoO7VnKii8u32iwEkSrBklMN63f/FH+aGqHQL35NMm glIJLDCsgzO/+XsPt3HS9SRnW6bHffghPTja1AtrrZC2X6mNOt0yz8BDwb95VTpdZX3I 8fN1vQVLcjdVc0SyHsjPscBxIlVCCHw9DSflT1fyO8X4ox0sAtVlfDVctCGnzrjrnBfG O3dtTrtEzKuJ8NhGqj9kMoMbQ5BICMarnzwOcYxL4Y4sXgB82Yvg2nfEnBrKSFevSjFR UvwdDx7u4k+wZt5e3/0G30l7LpBwguBYXm4Ixf4hDUrumShnwjQzcX6t78OavnOrDQev zHTQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 189-20020a6302c6000000b00536e63c8643si820679pgc.558.2023.05.23.06.18.17; Tue, 23 May 2023 06:18:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236793AbjEWNIG (ORCPT + 99 others); Tue, 23 May 2023 09:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjEWNIE (ORCPT ); Tue, 23 May 2023 09:08:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6F6126 for ; Tue, 23 May 2023 06:08:02 -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 AC5CE63235 for ; Tue, 23 May 2023 13:08:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63831C433D2; Tue, 23 May 2023 13:07:58 +0000 (UTC) Date: Tue, 23 May 2023 14:07:55 +0100 From: Catalin Marinas To: David Hildenbrand Cc: Alexey Izbyshev , Florent Revest , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, anshuman.khandual@arm.com, joey.gouly@arm.com, mhocko@suse.com, keescook@chromium.org, peterx@redhat.com, broonie@kernel.org, szabolcs.nagy@arm.com, kpsingh@kernel.org, gthelen@google.com, toiwoton@gmail.com Subject: Re: [PATCH v2 3/5] mm: Make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long Message-ID: References: <20230517150321.2890206-1-revest@chromium.org> <20230517150321.2890206-4-revest@chromium.org> <884d131bbc28ebfa0b729176e6415269@ispras.ru> <3c2e210b75bd56909322e8a3e5086d91@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,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 On Tue, May 23, 2023 at 11:12:37AM +0200, David Hildenbrand wrote: > Also, how is passing "0"s to e.g., PR_GET_THP_DISABLE reliable? We need arg2 > -> arg5 to be 0. But wouldn't the following also just pass a 0 "int" ? > > prctl(PR_GET_THP_DISABLE, 0, 0, 0, 0) > > I'm easily confused by such (va_args) things, so sorry for the dummy > questions. Isn't the prctl() prototype in the user headers defined with the first argument as int while the rest as unsigned long? At least from the man page: int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); So there are no va_args tricks (which confuse me as well). Any int passed to arg[2-5] would be converted by the compiler to an unsigned long before being passed to the kernel. So I think the change in this patch is harmless as the conversion is happening anyway. (well, unless I completely missed what the problem is) -- Catalin