Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp863388rwl; Wed, 29 Mar 2023 09:22:41 -0700 (PDT) X-Google-Smtp-Source: AKy350bBPh4F9ekLbzax6HZo7up/n5pGH8bvLgEHvPv57EBE0UE9Rpmgyjx3300HkeE70iXuRIxK X-Received: by 2002:a17:90a:1a50:b0:240:75de:12e2 with SMTP id 16-20020a17090a1a5000b0024075de12e2mr14994018pjl.14.1680106960720; Wed, 29 Mar 2023 09:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680106960; cv=none; d=google.com; s=arc-20160816; b=xnPmbVHhqq0AR/J7gqGWPmV719Otm9hLWBjODuFGpYjaDIKUKu+CZ5BklviytYlMYR RxNgmFzCujgmbsuBViIglVh2qoqpTZAmaG/Kr//OM3S0yPlmmRXDcDg0SiwykYwwE3ei WOwZfn9IjgFxRX+ivtAeD/hUrWtEAt3QR3kOzajfbbqJd4lhAt4Y93hadmJXtku+ri7k 2GoD5OfFZfiuDk057UHM+e4kz8GqLGtqjnxPO9iOoCebth9wPFPdisHiZZ72R+OJzhC8 oIycW+6c92eZbby+SdLnf5G7h+Kbd3bMyOJFpfOJ0+7/TDaxIS4xgzVHg4uhUZEZwkc+ u20Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9PZc/wL1SaOvzMH0Hm9CmGIiBNNws8MikE2aRTtEWQ4=; b=MJqr0Doy5A1PFH515nnx/jZi7prusy3bhKokyqM7Yc8Hem66V7ahKO70I/AUAk0KQq G7cWqXh67Sd6hLhF2ZcaCGRrqqXH+BdNrTAlRxa35Dlnkndr8Keyoa6LXy/H4J1rz0u/ lyA4avzqLDDXuWFUO0k5Y8AA2fXbP1JyjqIkqCYQnfADaiKhX23I1mHkEMDnEYhMJpRP CCrdShB1jCadRwnvAt5zS9NcAqEFBq6U1VcpgErFsxcO46IkPocCcO7oD3AsG3emAlyD +0rQPugyknF2SV/6y2Lt9yssgqjB/42BPca/m5FU7kxsQ4Zo+srVbVmGUXe5NjwLMTHJ egqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SWXlczAq; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds16-20020a17090b08d000b0023361862115si1656091pjb.129.2023.03.29.09.22.29; Wed, 29 Mar 2023 09:22:40 -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=@redhat.com header.s=mimecast20190719 header.b=SWXlczAq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbjC2QJJ (ORCPT + 99 others); Wed, 29 Mar 2023 12:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbjC2QIt (ORCPT ); Wed, 29 Mar 2023 12:08:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F16B5BBF for ; Wed, 29 Mar 2023 09:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680106011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9PZc/wL1SaOvzMH0Hm9CmGIiBNNws8MikE2aRTtEWQ4=; b=SWXlczAqVRRnbWY10kNgZB7xcZwjhfmYshLwr1itEKclU8XYjw+WpdY9pKIXXfTwcu2aab C/M0mKf+wVxshZIR2VW9LBR1fpg0K6RJHzGFt+/S8KrzAxyca3M31+6GFzgUvo1wX9vt95 BG6wbcPEC0aWrmKQva+A9dS0WCa54Uo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-70-m06UBDt5NEeHbLQfow7d0g-1; Wed, 29 Mar 2023 12:03:36 -0400 X-MC-Unique: m06UBDt5NEeHbLQfow7d0g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8EBAE8030D3; Wed, 29 Mar 2023 16:03:35 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.161]) by smtp.corp.redhat.com (Postfix) with SMTP id 82BCEC15BA0; Wed, 29 Mar 2023 16:03:31 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 29 Mar 2023 18:03:27 +0200 (CEST) Date: Wed, 29 Mar 2023 18:03:23 +0200 From: Oleg Nesterov To: Arnd Bergmann Cc: Gregory Price , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux-Arch , avagin@gmail.com, Peter Zijlstra , Andy Lutomirski , krisman@collabora.com, Thomas Gleixner , Jonathan Corbet , shuah , Catalin Marinas , Will Deacon , Mark Rutland , tongtiangen@huawei.com, Robin Murphy , Gregory Price Subject: Re: [PATCH v14 1/4] asm-generic,arm64: create task variant of access_ok Message-ID: <20230329160322.GA4477@redhat.com> References: <20230328164811.2451-1-gregory.price@memverge.com> <20230328164811.2451-2-gregory.price@memverge.com> <20230329151515.GA913@redhat.com> <9a456346-e207-44e1-873e-40d21334e01b@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a456346-e207-44e1-873e-40d21334e01b@app.fastmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 On 03/29, Arnd Bergmann wrote: > > On Wed, Mar 29, 2023, at 17:15, Oleg Nesterov wrote: > > > > This look as if access_ok() or __access_ok() doesn't depend on task, but > > this is not true in general. Say, TASK_SIZE_MAX can check is_32bit_task() > > test_thread_flag(TIF_32BIT...) and this uses "current". > > > > Again, we probably do not care, but I don't like the fact task_access_ok() > > looks as if task_access_ok(task) returns the same result as "task" calling > > access_ok(). > > I think the idea of TASK_SIZE_MAX is that it is a compile-time constant and in fact independent of current, while TASK_SIZE > takes TIF_32BIT into account. Say, arch/loongarch defines TASK_SIZE which depends on test_thread_flag(TIF_32BIT_ADDR) but it doesn't define TASK_SIZE_MAX, so __access_ok() will use TASK_SIZE. Oleg.