Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1541384pxy; Sat, 1 May 2021 17:22:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSsLdKYQN+TM4MEMgHUE0tmuxw+CHO8fVpdp8U+rzXbonHXy+psO0xP439JZbyeqMiA9gU X-Received: by 2002:a05:6402:4390:: with SMTP id o16mr13171096edc.14.1619914930173; Sat, 01 May 2021 17:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619914930; cv=none; d=google.com; s=arc-20160816; b=nC0ksGNC8B7pTblJg6sDwZ9GPkFfGiRhPcIwWaw7T6ZKnXYdj/dnLLdqmFsZUW4a1K FTP7tnLgQCc46jO1RObvB0Gwk5jcvhhVibxeju2pWG/CTgppvERYzOkHV9PCa4RaDGvD FQSYtEeJR0madrPsbZJ+RWvMqifWOoEhJj5qTekkY4EVmKt8KLMCetiHLG8juy1m0Srk uyO8A2Q/pUdLDdlF2UBwikK2/qx9nEhzx7bS2ve8EFv3c9bescTpEi6sKa7gM3ySfBM0 +uBenM8iPFH4F6ztJF3fwTBQsY+KkZDGvSuKdEdJ8gNOiQ4PyMVGiNBSCER+rOPaSjjH Ic5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1Of0XcLlfHKCxHPsgc9mruieTzxAs761HczQBIKnhe0=; b=sZo4SrGfUuFR9HqOc9k0PU5hL1sSSNEhKwHkVukrhUq8omUwWllptBnz3Dk1dJ4hd/ NaMV+rCOcEQ4FN9+jVmtocy4CyBhD4ZjHBxhh0/4KzDV50BlS1UylL00q/Jz15jk2+VE aP0ehFXQALdiclsFsL4H3voz7x08A28c7eCCQQhr5AP7GfgOCTtgUUOiRReCM3UaOE8N RGBZNlPlTXnYR9fvIlKFgKS9lRaPxfiweXxoTH6UaboCtxLk+WakAlshJWH3QLqtsumU zI1etLrnpFP1v8ymlCeHUrpRy/bFtHXyUBU8DPV7GTz3yt97NzITpXxkp9Xuxqd/a87N JYCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=RJJsSKb3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si5718953edy.80.2021.05.01.17.21.46; Sat, 01 May 2021 17:22:10 -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=@sargun.me header.s=google header.b=RJJsSKb3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231809AbhEBATy (ORCPT + 99 others); Sat, 1 May 2021 20:19:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbhEBATx (ORCPT ); Sat, 1 May 2021 20:19:53 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54B7C06174A for ; Sat, 1 May 2021 17:19:01 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id k127so1892823qkc.6 for ; Sat, 01 May 2021 17:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1Of0XcLlfHKCxHPsgc9mruieTzxAs761HczQBIKnhe0=; b=RJJsSKb3J60FEzVIAXoIuWglAxKe/2ieSjFdC/m8M4pCax51twizMiQJD4xRJf5cUP 1PUHPfJmCTkgdV3QuOfLqnpf4Pq3A3bBE4/lsPM67Mxqg+LY6A9pqmBlfIvvRch3vTS8 KaXFLUQZEAxFqfZ0qa3rBLWpEhsMn9YW8SQvw= 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=1Of0XcLlfHKCxHPsgc9mruieTzxAs761HczQBIKnhe0=; b=P41hwpU7O/RLbWGpMYK4kh4T6fDeIpa2UVYGv8pAaf0J82k2SfygtQH2FiJ8QsPxpJ OWta8+mThVU0nftpiFTjwXqy7epPvaVeg1IaF2vFfZwTIeJB0FNQQr82XTDPoAgYZtk7 UnrLS5U0dhlkv6ZNZjL8uDBAAyYlKcusOdgaLOfQ2fv3Sdr26vyaN1iKfQETEETyz3oA FKb6JwKyMEbQWabzCp00ZEm7bguTfv3M+bGlPSqsMU2O2klEf5bxzanbkFO27TloqNli hKzFZ5WLDJ4wJjv5Vj9dAfe/pNJ2DKoneabrPJosAnmaXYlj1Aqeq2lUPW/axRo7fLJS zTQg== X-Gm-Message-State: AOAM530z5stn885NWkr3MEAEoDYtUao/YS0+f5MtT1lGPghfCG3dPb0M tVO2sWmj3Ppl2YI9O5sMK57n6T2bt+YdYtST5mA= X-Received: by 2002:a37:b603:: with SMTP id g3mr12729945qkf.38.1619914740751; Sat, 01 May 2021 17:19:00 -0700 (PDT) Received: from ubuntu.netflix.com (136-25-20-203.cab.webpass.net. [136.25.20.203]) by smtp.gmail.com with ESMTPSA id p5sm5146067qkh.135.2021.05.01.17.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 17:18:59 -0700 (PDT) From: Sargun Dhillon To: Kees Cook , LKML , Linux Containers , Tycho Andersen , Andy Lutomirski Cc: Sargun Dhillon , =?UTF-8?q?Mauricio=20V=C3=A1squez=20Bernal?= , Rodrigo Campos , Giuseppe Scrivano , Christian Brauner , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Subject: [PATCH 0/4] Atomic addfd send and reply Date: Sat, 1 May 2021 17:18:47 -0700 Message-Id: <20210502001851.3346-1-sargun@sargun.me> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is somewhat of a respin of "Handle seccomp notification preemption" but without the controversial parts. This patchset addresses a race condition we've dealt with recently with seccomp. Specifically programs interrupting syscalls while they're in progress. This was exacerbated by Golang's recent adoption of "async preemption", in which they try to interrupt any syscall that's been running for more than 10ms during GC. During certain syscalls, it's non-trivial to write them in a reetrant manner in userspace (socket). Rodrigo Campos (2): seccomp: Support atomic "addfd + send reply" selftests/seccomp: Add test for atomic addfd+send Sargun Dhillon (2): Documentation: seccomp: Fix user notification documentation seccomp: Refactor notification handler to prepare for new semantics .../userspace-api/seccomp_filter.rst | 28 +++++-- include/uapi/linux/seccomp.h | 1 + kernel/seccomp.c | 79 ++++++++++++++----- tools/testing/selftests/seccomp/seccomp_bpf.c | 38 +++++++++ 4 files changed, 120 insertions(+), 26 deletions(-) -- 2.25.1