Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp695550imm; Thu, 31 May 2018 07:52:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFHEOtJacoUFj6F3aLuVc9GfbrQ1ku1S+k6L186vabUlj3BCBUy2/9mCtoBT99RKTb3/4z X-Received: by 2002:a62:4a88:: with SMTP id c8-v6mr7126518pfj.23.1527778342630; Thu, 31 May 2018 07:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527778342; cv=none; d=google.com; s=arc-20160816; b=d6Z9mnl5+7MyakYEI5IwqPLYsgmZtdrwI41BZdtEqM4CqTtuXIB+qlJsnREx3pUqh5 Z1PN6kfHAy85ZWy1MLriu0XeRJVlB45BA4b5sWvrd/W61nMQGVyrtP0mAJZIPh8IiEKA MRAgIpmhxUFmvqrTGQQRo3YMPDBHtwSarvC8bURsOm5V1+Sav08bFPAaZaMCQQqy8s5Z cGlPRfvyhLPM3O7SZeHgBYoCSJb2pSN+PJWsZHEBRIL5St6fKlNGeLBpVn1OrDgHDXW1 gRWWvrfgtm+g8sQDTtg5FYdgEw18+0C1+7XpklJtxb1zKmz3ByUU6QYtu4sjnx6nEfVG pPfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=MaNFqbdfYZWdGqFn7KY3kUPjSomPu3ZW+Yy+D6Gm6YE=; b=BHWUsoqrISMkm3WXhP/2TEeFTmZahn2i8WAw7qWOoYGbH4p8Y9JGobpPeJ0/xgFgw+ USt9ZKHoY8lMKQ84O7nVzys4+xQszUhbUfLKoay1qWHug//zFnSfa+cgQ7TwU0TG4g1R h6UbB2TXFhVq/ZRgT90cNMGDjSBKHhxiWEB5AaWpUj17PtKwqydE3IGNsBGyk52lUMJV t7noP1VxVvRLFG6z+eu4JmuCyVe+4buFIANNNoZQxOeqcDYKHo/6a5+YUBEJ0MIBpa5m otpn1kZtWWShNs96F4M6RQoTA/Y1Zpkx9t5XoFkSlxXJ6RBBcRo91F1g1Zf2jZxyAgGY t0nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=kQaaTwik; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si36588278pls.407.2018.05.31.07.52.08; Thu, 31 May 2018 07:52:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=kQaaTwik; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755423AbeEaOut (ORCPT + 99 others); Thu, 31 May 2018 10:50:49 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:40622 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755254AbeEaOur (ORCPT ); Thu, 31 May 2018 10:50:47 -0400 Received: by mail-io0-f194.google.com with SMTP id g14-v6so26084197ioc.7 for ; Thu, 31 May 2018 07:50:47 -0700 (PDT) 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; bh=MaNFqbdfYZWdGqFn7KY3kUPjSomPu3ZW+Yy+D6Gm6YE=; b=kQaaTwikPxx7CL1lhHW6yxbBWmeRrp5fFmHUurvpj5CUW6vOfno4yY5pnCiaWZtQoJ byuHTquFfXMv1YbovQIx2Q91XpzhgR0IxGMOabUI3iMu2QAO+HqnAlUVwg1vkDfJn2i9 bCwApijcr5fIqvxPPW+f6EsNijcs6kcHjvHlg9I45s/o7GHxajS868UjnFrAq9PsC7CS M5sSeoCGY7O94AWLMu4TdOMTpg1kcx8220XJpVYWxPDqvagfjQT5yfUP0h3Rbh0payTe t1VrCc48MLIW+w7EusKNzJgqRZps92cQqvBDsA9ROOr2/upad6Cuwn8e9SZvd2ljbrLb oSZw== 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; bh=MaNFqbdfYZWdGqFn7KY3kUPjSomPu3ZW+Yy+D6Gm6YE=; b=W4bT2XqWr+KwVeTuAnba+RdpjUUB6/Z1AeRlPE6SfqPnj542OIVWGRhBw1dDoWJRW7 RgBMhZ/zzfvkN4mGkutINRlJrjt0hEHzdpXPAWsbbKMUcOZNmxVVVC4iBEhBnvIexFoX xx5hnB0kFtUcJjh1rW+9BE+sJLa760rj60lazWCuVQn11Zp4zATzE2VCmCBLPkJtaN0L 1royK3sHK4/Eipy1h5ye29oZ77+XGs0ipIRw/QJnTW4NNJn1+SmCog4MPa97NIlKE7jn dOWu7yFlbMgpXbJcnfLbJtxdBCDWKE8HV18Q22a7cIXvRFXKC9oqKOwxCMn+GiRGzHTq kpKg== X-Gm-Message-State: ALKqPwcmY+mlw8ng+botH91dygiib76pKWHHZdUa1MqtpygNEqJHpqkX NaqogyXE66lr2vVtH4PnouBPUXU8ck0= X-Received: by 2002:a6b:1745:: with SMTP id 66-v6mr6653980iox.278.1527778246497; Thu, 31 May 2018 07:50:46 -0700 (PDT) Received: from cisco.lan ([8.24.24.129]) by smtp.gmail.com with ESMTPSA id m14-v6sm208506iti.36.2018.05.31.07.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 07:50:45 -0700 (PDT) From: Tycho Andersen To: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org Cc: Kees Cook , Andy Lutomirski , Oleg Nesterov , "Eric W . Biederman" , "Serge E . Hallyn" , Christian Brauner , Tyler Hicks , Akihiro Suda , "Tobin C . Harding" , Tycho Andersen Subject: [PATCH v3 0/4] seccomp trap to userspace Date: Thu, 31 May 2018 08:49:45 -0600 Message-Id: <20180531144949.24995-1-tycho@tycho.ws> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Here's a v3 of the seccomp trap to userspace, with all the nits from v2 fixed. Open questions from v2 are still: 1. is it ok not to use netlink? 2. what should the fd passing API look like? (see patch notes on this one for details of why the current one might (?) be a problem) As an added bonus, I've also written some stress testing, with lots of tasks and listeners (1000 of each) sharing the same notification thread, and not found any issues so far. Code is here: https://github.com/tych0/kernel-utils/blob/master/seccomp/notify_stress.c although I haven't included it in the patchset. v2: https://lkml.org/lkml/2018/5/17/627 Tycho Andersen (4): seccomp: add a return code to trap to userspace seccomp: make get_nth_filter available outside of CHECKPOINT_RESTORE seccomp: add a way to get a listener fd from ptrace seccomp: add support for passing fds via USER_NOTIF arch/Kconfig | 7 + include/linux/seccomp.h | 14 +- include/uapi/linux/ptrace.h | 2 + include/uapi/linux/seccomp.h | 20 +- kernel/ptrace.c | 4 + kernel/seccomp.c | 477 +++++++++++++++++- tools/testing/selftests/seccomp/seccomp_bpf.c | 373 +++++++++++++- 7 files changed, 889 insertions(+), 8 deletions(-) -- 2.17.0