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 8824EC77B62 for ; Wed, 29 Mar 2023 18:00:12 +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=+N9NlrxzqFZuVn5MVA2Rb7uKE8SbOp+1Mdmh+BArclI=; b=ZXMCYVrWqB5eRI JvKvqPgu2BmCgV1QG0iUg0ioa1/GB7EavfCH9UJhfDNbnVrKnMRCdlZxIBp2ZFs+K9VqkYcnloPj/ OHmcth4hFx0nXLgcd4uzT1OIYFGoVNLJogVHwx/1yG72S+LajqiKJ1AsFZ+U6+EfQl/NUunnzn6ak kPsEELEZdFC5Pfl7RjeCgmxlXFzNEWL+O3uOxfEBJYJnFvEccWCAF9bYw/6cG8rdJ+RPA1opcttwq oibyB4GkpQ2sjRb/IRj7++zMSQgVhmXf4RuCcQX5UpGWJc08c1hUfCy4F51kuk875id0kr7Xor6v3 ncPgTFlzmlSyZEu9F4Zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pha4n-001Nzz-0e; Wed, 29 Mar 2023 17:59:13 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pha4j-001Nya-2l for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2023 17:59:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680112748; 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=Bjdk/0Vi9XEk8rAPBToebWaS2lMtqxl+/fQ8ndI4Fq4=; b=FH3Ma+CMiXOUxNzgFo2x1VJGL9WGcdxpPrhoVpmitdN7dumbHjCwWVR5gJxNfhATjQZgRq w2Uv/VRBVMz7PCocek8fMqCh802I4oXpQhKWkzT6+FZruw9iAsYRpF3a6gQQ/m1kRUoVYn BIjKLdki/djCBTg/bvMrM1tgYIT+WJM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-203-kbDiB8jMMXGxsU4Z-OuJDA-1; Wed, 29 Mar 2023 13:59:04 -0400 X-MC-Unique: kbDiB8jMMXGxsU4Z-OuJDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D201E3C0C8A6; Wed, 29 Mar 2023 17:59:03 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.161]) by smtp.corp.redhat.com (Postfix) with SMTP id B68761121330; Wed, 29 Mar 2023 17:58:59 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 29 Mar 2023 19:58:56 +0200 (CEST) Date: Wed, 29 Mar 2023 19:58:51 +0200 From: Oleg Nesterov To: Gregory Price Cc: Arnd Bergmann , 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 Subject: Re: [PATCH v14 1/4] asm-generic,arm64: create task variant of access_ok Message-ID: <20230329175850.GA8425@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> <20230329160322.GA4477@redhat.com> <20230329171322.GB4477@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_105909_994074_2A341FA0 X-CRM114-Status: GOOD ( 18.06 ) 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, Gregory Price wrote: > > On Wed, Mar 29, 2023 at 07:13:22PM +0200, Oleg Nesterov wrote: > > > > - if (selector && !access_ok(selector, sizeof(*selector))) > > - return -EFAULT; > > - > > break; > > default: > > return -EINVAL; > > > > The result of this would be either a task calling via prctl or a tracer > calling via ptrace would be capable of setting selector to a bad pointer > and producing a SIGSEGV on the next system call. Yes, > It's a pretty small footgun, but maybe that's reasonable? I hope this is reasonable, > From a user perspective, debugging this behavior would be nightmarish. > Your call to prctl/ptrace would succeed and the process would continue > to execute until the next syscall - at which point you incur a SIGSEGV, Yes. But how does this differ from the case when, for example, user does prtcl(PR_SET_SYSCALL_USER_DISPATCH, selector = 1) ? Or another bad address < TASK_SIZE? access_ok() will happily succeed, then later syscall_user_dispatch() will equally trigger SIGSEGV. Oleg. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel