Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4193464pxk; Tue, 22 Sep 2020 12:45:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpqM4xxlPlZjIw5Da4COYKBuxK+YxLWV8D7Jc/oGWLYNwJdgQHYZIDGP3aty/xdQF6Oea0 X-Received: by 2002:a50:f1d1:: with SMTP id y17mr5517676edl.231.1600803945990; Tue, 22 Sep 2020 12:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600803945; cv=none; d=google.com; s=arc-20160816; b=bNFRSoilA9/W9rXopbYsm4Jtlct/ZVnIggC7rCsxHkudR9Zhp5c3taDqS0eKuMQzj4 fCvhrRg+2Zr6bnmUd6KsU9uDD0VdBp+DWX520o+Y6WskScAs5ET6rTPbr1rVOqn1E4IT fs/7ItL4EUZ++vBk0P8+f5MsH3fJyShm8wQ6z7beZvhhLn2+pR15VY4w6JOV26RaXq0g MmyQPp47LWjveASuR1+nYRSvWIm4TrEk3rigBJEjALYWFla92KI48XiMJ4+J2mrZkBho yBaJj3pk8/Dl0Lcdz3HsSyq/XSPYpTZmQmpHyb29mBV0U+zhBlDZnWxN6FsqmfEcFfK9 OTaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Xz2HRr+8jfMHydCknS290/QHwlWp02k4FcjW+L/Em9I=; b=ELc5zLulpWDtyDrB/5GsKaLutuf7msOIUdQVfbSWVB4C2UqE2ZILqYrB3p0uU128Rt JRcT4xWVi1Emmtp9AiGTuwFjzrp/IKe2bT9kSloQslgufIntBELfAWyeRvEiuBQvNC3M xqowgvv1onLXjzi9XVJOhCYlJ4/eMSNidU3hxtSPoB5LHzZamrHJ9jQujwzVGLS2WLCG EbIDu/arPvX/3Q7Ve2l1Iw/W/kYDAGLAfdk9ZP8SCoZeVP0rNNNRr/zdEFmVLhODQerr GjiLIjwuYd9wgKtF5f4MgJYxWa+M9VvBHplVN5atDhLYUvZmsFiwxOyYSc6egfflZgdB R/0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ACQkpKsG; 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 j23si11280734edq.339.2020.09.22.12.45.22; Tue, 22 Sep 2020 12:45:45 -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=ACQkpKsG; 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 S1726576AbgIVToY (ORCPT + 99 others); Tue, 22 Sep 2020 15:44:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbgIVToX (ORCPT ); Tue, 22 Sep 2020 15:44:23 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86684C061755 for ; Tue, 22 Sep 2020 12:44:23 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id f2so12824870pgd.3 for ; Tue, 22 Sep 2020 12:44:23 -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=Xz2HRr+8jfMHydCknS290/QHwlWp02k4FcjW+L/Em9I=; b=ACQkpKsGyBx/9tLSKJxE1NFnviev8kAWHtBnoSKLT5BmiA8AMEf3biF7Dvxu/xrvkb rEG+qpMKSnNwKiVYJ+OPsL6Cja3hCbjsHb8r83MGK7ya4LYrr+UVXnMVQRZcVJ/a9oa8 Lk6ydusXQZWGWSzcp11iod8TBdF2x1zUCzvFc= 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=Xz2HRr+8jfMHydCknS290/QHwlWp02k4FcjW+L/Em9I=; b=uOLYlFSo6FbphE5J8wnP6VspqLMyHKrVovQfUmYTjmmciW3Q4+6AD1bbXuOC8/6skv +mvu+UwdnhbCSlevCN7EL0PAXvTPED/Ek7UQ2i+ecPw94sByTHfL3pXp9aRKyngPdozK A6SzxAVzLgl32KXxr9XAaYIHU8vJTqeoLyzsyeFyISgFz2GA2GpZ56zzqg0XdzpFHm1p +rkouYOeQ86MpDQzOtbd0Gs++hCmzJhQlixx3RN/AJyjaUqg2x23mvqksPXKYutKS0xS FF4JHX+n1SveEVN6EGElZKYAG3bxeBg0AgNc7hwAj3b2SHpQY8waQQGD52tZOifdqZ50 IAQQ== X-Gm-Message-State: AOAM531/74a+WyYtURcDjRAR4U9bi/c9lL48nEknVbPz2PulWnCOrEgo wAILB+YsS5NcFW0grlnzheMOYw== X-Received: by 2002:a63:441a:: with SMTP id r26mr197932pga.290.1600803863106; Tue, 22 Sep 2020 12:44:23 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u71sm16397776pfc.43.2020.09.22.12.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 12:44:22 -0700 (PDT) Date: Tue, 22 Sep 2020 12:44:21 -0700 From: Kees Cook To: Gabriel Krisman Bertazi Cc: luto@kernel.org, tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, willy@infradead.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, kernel@collabora.com Subject: Re: [PATCH v6 1/9] kernel: Support TIF_SYSCALL_INTERCEPT flag Message-ID: <202009221243.6BC5635E@keescook> References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-2-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904203147.2908430-2-krisman@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 04:31:39PM -0400, Gabriel Krisman Bertazi wrote: > Convert TIF_SECCOMP into a generic TI flag for any syscall interception > work being done by the kernel. The actual type of work is exposed by a > new flag field outside of thread_info. This ensures that the > syscall_intercept field is only accessed if struct seccomp has to be > accessed already, such that it doesn't incur in a much higher cost to > the seccomp path. > > In order to avoid modifying every architecture at once, this patch has a > transition mechanism, such that architectures that define TIF_SECCOMP > continue to work by ignoring the syscall_intercept flag, as long as they > don't support other syscall interception mechanisms like the future > syscall user dispatch. When migrating TIF_SECCOMP to > TIF_SYSCALL_INTERCEPT, they should adopt the semantics of checking the > syscall_intercept flag, like it is done in the common entry syscall > code, or even better, migrate to the common syscall entry code. Can we "eat" all the other flags like ptrace, audit, etc, too? Doing this only for seccomp seems strange. -- Kees Cook