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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 623EFC433E1 for ; Mon, 13 Jul 2020 02:33:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F16D20725 for ; Mon, 13 Jul 2020 02:33:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cywAbOnq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="L9LrYy7U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F16D20725 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=FFF4FTSJBzrVDPsMkQ0BtY6z6UD4jrnJMSV6toACkqs=; b=cywAbOnqx9bapfwtv8RezdGXH D1MFfoXrUJBCLEnRSsYyjTTf1BffCJUqV2+GgfIA4q/2UzK6vitnVtGJ6RW3JqzPMpBBKJpcKd1/G ffQhKiScAQ/LfEpHQ4NcNJJjfxfm0LXB2Jl/4dovrJBhmUWirxRUJ75J/wCDEioOyRvT7V2lX23Xs 1nH91ZSu5zNRorhoHTKs8eFSg9e5IzoaPw6vTpHzkmxsmmhOBDyjiSgK2/8iJfQ/gVTrT34R4VGnp 6Dmb9oPZxxYduMcKFuLsvmVAdLsFZ9WcQ0NgWBIBktaShKbRa3swpeTe8kTDvzc6mQhGmE19MX7lx u1ZpT9Vyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1juoGT-0004bV-2x; Mon, 13 Jul 2020 02:32:21 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1juoGQ-0004ax-ME for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2020 02:32:19 +0000 Received: by mail-pf1-x444.google.com with SMTP id 1so5342522pfn.9 for ; Sun, 12 Jul 2020 19:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7mB3orEsWrS6JJF4cePJ1CaoCBXYaWwHOY312iSKTgg=; b=L9LrYy7UGFMlAkltleC4lW/4Aq/QwhSESVEzttITeDQ2OWNFqv4ttCrMxQO/Q7EDmf JAY4kgDqBT87HNbmX1IA+qIxYsq/PL8L7YzaHIwZYIWvRo9gj5uTXpqpo7cz4kMWxH+L +vj97SBFFQFr1io57GQ7QbjjDBAnk/MdDqO6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7mB3orEsWrS6JJF4cePJ1CaoCBXYaWwHOY312iSKTgg=; b=JwHBrxSkl63Giw+FssXFENivIuDqVQWGdYlfIeHq8VS6Yh6gEcdySQphVobmhpRBTR ND1OIXtbq9UA+vRi1XdkLitc/EyiicUEVYxCFqrp6xsDKJ9IrgKJNX2Z6FYOOZMOdU1S DD46lJi70PiXEDYEZG8GaweaQQrk5g5RvjjUdqPZAjyViaCB/Pp7Fi96KiL4yJydgufq 8Q6jvpCtcnReRpQQtgNu+aA5d933bNfnvpymlyHCS0rSjxqvlfEyjMX33p0Li0hDWRZy oyXgH8F7FFiiB+GNVJzzXPQ7/dhLb7LLouluiz6xrW72ajv9MQBgwKwNhOQ0P8CfmEPC LK+g== X-Gm-Message-State: AOAM530ETnSdzlZum4mHFMfK9XAG/+h56nFJNEl5TgMBJuluii1E1hMV RWMMMLKmqRETJ3OleRm34FNYoR2XD8M= X-Google-Smtp-Source: ABdhPJwuZhHLx1/c3QdSbj0bZj4yp8tTZGGICwbLDs0aFKE/mOW3dgDVoDnJ9w6R/UmFje81r7ZZ5Q== X-Received: by 2002:a63:df56:: with SMTP id h22mr65997308pgj.140.1594607535196; Sun, 12 Jul 2020 19:32:15 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z2sm12662532pff.36.2020.07.12.19.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 19:32:14 -0700 (PDT) Date: Sun, 12 Jul 2020 19:32:13 -0700 From: Kees Cook To: Will Deacon Subject: Re: [PATCH v3 6/7] arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter() Message-ID: <202007121931.A31FBE6@keescook> References: <20200710130702.30658-1-will@kernel.org> <20200710130702.30658-7-will@kernel.org> <202007100902.425E50F4D1@keescook> <20200710161148.GC31036@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200710161148.GC31036@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200712_223218_773457_4928EE30 X-CRM114-Status: GOOD ( 17.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Luis Machado , catalin.marinas@arm.com, Keno Fischer , kernel-team@android.com, linux-arm-kernel@lists.infradead.org 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 Fri, Jul 10, 2020 at 05:11:48PM +0100, Will Deacon wrote: > On Fri, Jul 10, 2020 at 09:04:08AM -0700, Kees Cook wrote: > > On Fri, Jul 10, 2020 at 02:07:01PM +0100, Will Deacon wrote: > > > Setting a system call number of -1 is special, as it indicates that the > > > current system call should be skipped. > > > > > > Use NO_SYSCALL instead of -1 when checking for this scenario, which is > > > different from the -1 returned due to a seccomp failure. > > > > I can't understand this paragraph. NO_SYSCALL is -1, so how is this > > "different"? > > > > arch/arm64/include/asm/ptrace.h:#define NO_SYSCALL (-1) > > > > Do you just mean "stop using a literal '-1'"? > > Yes, I'm trying to distinguish '-1' when used as a system call number > from '-1' when used as the return value of secure_computing() on failure. > It's currently all mixed up, and I think it's confusing trying to realise > what is a system call number and what is an error code. Okay, I gotcha now. Yes, that's entirely reasonable. (It's perhaps an artifact of x86's implementation that they get directly passed through.) -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel