From patchwork Sat Jan 19 00:12:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tycho Andersen X-Patchwork-Id: 10771845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E23A3139A for ; Sat, 19 Jan 2019 00:12:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C44EB30764 for ; Sat, 19 Jan 2019 00:12:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6E893078E; Sat, 19 Jan 2019 00:12:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21C2930764 for ; Sat, 19 Jan 2019 00:12:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730136AbfASAMr (ORCPT ); Fri, 18 Jan 2019 19:12:47 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:34685 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730125AbfASAMr (ORCPT ); Fri, 18 Jan 2019 19:12:47 -0500 Received: by mail-qk1-f193.google.com with SMTP id q8so9111206qke.1 for ; Fri, 18 Jan 2019 16:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho-ws.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rwJQTTpQtFTFa/VriVY6MbHV+teJCQS6DxG+RjP0O28=; b=nLX8qGYkkI8ta+WMxkrycHJ1Azark9ReqNBv927bdtpEguyLBd5cth/T4KmQJqOWeL usIsbENCBLNCt45SU/GafVqAR6+jyV8U7QGz9jrTDpoYO1Zr/Kxhc4qQLAl1jSHp/Tw0 n7bb9u/v+n6zrOaq2DGEl7N+bYZTnNZ9rSQhzB2ADIH7gEAFgY9tEa2sa1yMiMBr71fV WuVVYtDaTQe5NNc1gsmwa8f6N4fWCOqR5L5Kp/R5AblCQyv6YWOfmro7W0t6d3gbNPM5 74I09FRyTCVwcVc+zPjkkxwid/bIvM12mBJZJzqKGbd5bUz6sf8IfGekL2iAPJ8dNt+u vwTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rwJQTTpQtFTFa/VriVY6MbHV+teJCQS6DxG+RjP0O28=; b=N1qwZsetbINyy8Bxv4ncRtUcokq+qZtEnCUcVY22NjFhxpV1prRdBQcXulYGHNd7Px wuN0dDykso+x6jm93VN6SaDys3EqtF9C6TA0i0sF0zXmrN7eJbV0cFqHr+B60puilvyL eVxV+nPmz1qS9jb++MGdmNbmmGzACqdiXOl6XMUEQDNkrJlKmsyncxSrPLLN/9VmQ8s0 m2Gim0zlEf5YnPmy00VeZXEr58KOKxPAGxAulvdMtZFg+5ILeYAuWeJhlcd9edVDUT02 x/pUYZRwghV6nizzxvE/p+BGgOfJHhfRlgS8tKVisabdjLmvE6ChdinMPaS7xV3zRfuP BlaA== X-Gm-Message-State: AJcUukdkwC0aDc10FfuTjU5p3pqilyG2api7B65XhK/d2gq5Fp2wCBAJ VGl6z52k3IvnZLUqrZvOrabtwA== X-Google-Smtp-Source: ALg8bN6jnWK3qTEf+DOENn0pA6k/6J1R4KeKPS9a30eGNIqvXvBZa60i7yHQ/enTWGbElDYWUPE8hQ== X-Received: by 2002:a37:8fc1:: with SMTP id r184mr16865795qkd.32.1547856766113; Fri, 18 Jan 2019 16:12:46 -0800 (PST) Received: from localhost.localdomain ([64.125.109.186]) by smtp.gmail.com with ESMTPSA id m14sm41140501qka.21.2019.01.18.16.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 16:12:45 -0800 (PST) From: Tycho Andersen To: Shuah Khan , Kees Cook Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Tycho Andersen Subject: [PATCH v1 0/6] seccomp test fixes Date: Fri, 18 Jan 2019 17:12:11 -0700 Message-Id: <20190119001217.12660-1-tycho@tycho.ws> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi all, Here are the fixes I previously mentioned I would send. I previously assumed that the tests were mostly run as root, but it turns out everything else besides the stuff I wrote in the seccomp tests either sets NNP and doesn't require real root, so it all actually works. This set of fixes should make most of the other tests work unprivileged, while XFAIL-ing the one that requires real root. Cheers, Tycho Tycho Andersen (6): selftests: don't kill child immediately in get_metadata() test selftests: fix typo in seccomp_bpf.c selftest: include stdio.h in kselftest.h selftests: skip seccomp get_metadata test if not real root selftests: set NO_NEW_PRIVS bit in seccomp user tests selftests: unshare userns in seccomp pidns testcases tools/testing/selftests/kselftest.h | 1 + tools/testing/selftests/seccomp/seccomp_bpf.c | 42 ++++++++++++++++--- 2 files changed, 38 insertions(+), 5 deletions(-) Acked-by: Kees Cook