From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D758C74A5B for ; Wed, 29 Mar 2023 16:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VW2Pe4v55UgdIe4BCLu2ICGAIJ26UWN5/GIKIyZRiXc=; b=gvnlQdM7m/ZGfo 2FVB9vhOGF6cIxHewSvdIQONRTNZRf10E269C2iV63vpBmFzpG/beyp2oWJVblHCpY52m0uWiomee Mf12B/pmJCDX8xzto3t0YqpcsoW8K72tBN5Nq7CCryGnOUAWwHa65pyDd/na5NX6SQD7aYh5gNyih DI2ZUQVAH7L47RGBjx54sVLvWoKtMkWkSqV+nOMm3pk6D39lMxIq9Ijh9YHLDWEPgF9/YuPWWKxwr yaUQh6hT8vuxPgTRJ7yFOG5o1Nq9WD8a7lWQfM74R7F2QuCvi6hCO7oLiJUXJsPq9+i+QyQKWMHTU 2A4tt4UeB3XIsSOBoyNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phYH5-000zX8-2T; Wed, 29 Mar 2023 16:03:47 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phYH1-000zUt-2W for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2023 16:03:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680105822; 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=flHyJjBVGfccD9w0zxb4DkSvcC3y0KlsTHDW15HBFKGCZ9PXaZi7SF8GAkEcI2Rm9PbkM2 DOW4Pr1ami4hFk0erbG9jlHdXS/pjM20+ABPOXmMjsQ0qYa38K8+XSJVfH7uzNRkjhoIwn SCxxuIjoTPjbqUbcV/PNbqfhkxOW0nk= 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-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_090343_899003_0213F724 X-CRM114-Status: GOOD ( 18.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel