Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2441614pxk; Mon, 14 Sep 2020 13:30:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHbo/8tOJTy4VEFYVaYvencHTSXU/0lxPHGZXXsqIT5MsOFkQ4kZTqpw4jD9mCggboleFu X-Received: by 2002:a17:906:c830:: with SMTP id dd16mr16966977ejb.196.1600115432323; Mon, 14 Sep 2020 13:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600115432; cv=none; d=google.com; s=arc-20160816; b=YAnHJnsaGnTRyENreBNfrs0OHcECLu2m+zWHwxWCIQCAbUEzw4V8WVcZuB+iskkSxM 3DR3sQQg8eoORbADHbTdT4aMWzQj/8RVKGzUlTJSRFKILNonBFTAdPj8WTmPbpbiq+IN 22IsAsirl10iXu5cw/t/D3UD78Es5FpXmzOTO8D3HERKWoDHe+GfQSDzAIGzYFs598sD k8C4Lfd4r5i7QOxHzTUv1+LCRaTLy4z8d8l6SflR7XlP1GULV0lRbYh1UbOHO8sXhHAp cuNlTWSQ7A+FONlOici0gNz0O7YA1MEs2aUaNgzJuP7GiVDZg6t2PZ8elyB0ZXAE2dzp 40OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qEpgx25Jil12k55o2aeOued7nizFpjWJtIRv7RIrrgA=; b=01p6QUQ74IkOPPImNBQhIF74wwsoREdfBX0YgCo/o+HJZOQy5Bx4cIrKpjKSqObu4A u4nO2QMkU+hc1WPRe129TN6r9k10jjoKSThEo84+5fEmYRcWEsISw0ZtTdMc+Ogiugx0 ailApk/BJi8ATtqbNZxwItHr4F7iQhrGNkuTCeRWQ6xSlNlTQ9lBT1egizxQv3nHlZ2Z 7qCwn2ly4Jx0QN7eoQl0ivzMAUVlFsJ4QLY2YMkcHwE8UVzQYOOBS8/TnU2GdHj9KRg0 4dz6/yjOtvJEGGYWsG5CrWM81O2pszJPgQwcZVuJAi0mB22/gMatOqM+i0xzaeg+edPv s26A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="oF8La/id"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si7999934edr.363.2020.09.14.13.30.10; Mon, 14 Sep 2020 13:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="oF8La/id"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbgINU1b (ORCPT + 99 others); Mon, 14 Sep 2020 16:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgINUUm (ORCPT ); Mon, 14 Sep 2020 16:20:42 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F83C061351 for ; Mon, 14 Sep 2020 13:20:36 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id n14so531821pff.6 for ; Mon, 14 Sep 2020 13:20:36 -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=qEpgx25Jil12k55o2aeOued7nizFpjWJtIRv7RIrrgA=; b=oF8La/idpVXp4VfUhwPPRt9IR/o1RPig2nmeyh8YrhsmHCRvroMtluVJ4o5U4K8AFY VbIWbH4IFHNJ2TFc1OFb1H1xtGH98TXoNvfhyYpAj/BvKsAp8ayWj8ANKhK3ots4YK+n 3o6kijVtSkUUK+lTSVOjqNR35ksbqN8yyS7c8= 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=qEpgx25Jil12k55o2aeOued7nizFpjWJtIRv7RIrrgA=; b=tqepMhWNzr+5P8xE0XoulQhchU6jB+BuZ4Kh0cBfBOdC94ax3j4xAFkzPVUCnHmSCj r9LXofft5FBTU8uiURXhw5RTLJoz6jPNIr/uYegPbVH5o6u2MjMGJJJLsOEPOgkQ8Zje y4C7ZxKpxKUseIFN1Oi5v+DPd9iMXJlU5+u8H0ognmB88Z8vojxVAF/5B85t7PO6wTv3 xZ/mfsWQAniAx5aAdkbVII7U8Gxt10v38mIDVIq1C6G83lm1cppDLbF2qIS0fl/T7R0m wFKVeyS5aOAZzkGYH4Bw38obqU0fpXZQ/UuyLeSwzojX/X4jCFGRZXDrmoBbrPMCpH5U gmdQ== X-Gm-Message-State: AOAM533kBBkJxrs7iwN08GRn+8AK2jHQnVwMwudUJs6y/8cPDggVITQE XG1yGI+DPY8MtdaBuJb8ILxu8w== X-Received: by 2002:a63:471b:: with SMTP id u27mr12121165pga.139.1600114835739; Mon, 14 Sep 2020 13:20:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u6sm10068865pjy.37.2020.09.14.13.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 13:20:34 -0700 (PDT) Date: Mon, 14 Sep 2020 13:20:34 -0700 From: Kees Cook To: Michael Ellerman Cc: linux-kernel@vger.kernel.org, Thadeu Lima de Souza Cascardo , Max Filippov , Christian Brauner , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 13/15] selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit Message-ID: <202009141319.FC017B0DB@keescook> References: <20200912110820.597135-1-keescook@chromium.org> <20200912110820.597135-14-keescook@chromium.org> <87zh5sq59a.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zh5sq59a.fsf@mpe.ellerman.id.au> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 03:47:13PM +1000, Michael Ellerman wrote: > Kees Cook writes: > > Some archs (like ppc) only support changing the return code during > > syscall exit when ptrace is used. As the syscall number might not > > be available anymore during syscall exit, it needs to be saved > > during syscall enter. Adjust the ptrace tests to do this. > > I'm not that across all the fixture stuff, but if I'm reading it right > you're now calling change_syscall() on both entry and exit for all > arches. Correct. > That should work, but it no longer tests changing the return code on > entry on the arches that support it, which seems like a backward step? That's a good point. I wouldn't be in a position to notice a regression for the other architectures. I will refactor this one... -- Kees Cook