Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp702984pxk; Wed, 23 Sep 2020 13:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDLtkKLf5vKeC0MbB5YZdD35wH79JUlarVq5VR0VyLF1EpMs/wwiQgbx6We7EaKcdiQjDA X-Received: by 2002:a17:906:95cd:: with SMTP id n13mr1369943ejy.297.1600894305218; Wed, 23 Sep 2020 13:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600894305; cv=none; d=google.com; s=arc-20160816; b=PDCk5pv507pbuFCquMDxJad2no1Wq1JPlLhTgc+kqDoBEH2Pk5O7nrrv1pF69zfXuf K/jfeKSMtg6NLHwVOW5Qtes5fwPygUugyJ8BtjMOCa8ZXwoj5s8rUiGZfgWyZXF9Xd7W j67SvD4ARsid9vSMMcsSS8ciqS10CBzL+3lFb8MKoGU3bwaYuwDUAQiUP4MQnyM4Zls3 Kcjq4w/H56nKrlumoTHZDoFg79qhevhx8pVvMUYd7ThYt3cNZALWSsPIxGVkhZAxdAj1 lhm/wvAvC9TrXTb/v61laXzxAOQ7nw8RmsRfmzWo06TXfvcS989lCYesauprDQ8titGQ oeEA== 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=vR/4IIWUNKe15foWwpTS+9b9UDo/Qa9Bzr4DnMS8/ac=; b=J7rN3yAnt5P6CQOQ+Fq9gd9esUzNo11o+OJKIneNFH/ALZOiDnkIo2UYjbq25sn6TH XD6b/hqMX4k8X6sPWraEMVD4BTq0CkIKGuN9jvZF90j0XQA8aQBqLdBxqCsEBga75jU3 9UvbpgarNb1Ny6Dm+zh/vyBuad7I4bnVWDjln9wRlqWWluaCgLYEv1jzKPtydls3CmUs apPQLAqTPpogmcxO6E+8t6ythMa+w7KJHympxhhzv4ohitRVELnLhVo2anAt2lPkLo0s TNuYycISl2gaXlABce21gHi1kZJ8s/tQCPtaUK9cLwTiwmoWYjOox5r4zg4LyuhE/16E kIdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cvjPnC0c; 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 h23si619026ejx.721.2020.09.23.13.51.21; Wed, 23 Sep 2020 13:51: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=cvjPnC0c; 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 S1726721AbgIWUt5 (ORCPT + 99 others); Wed, 23 Sep 2020 16:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbgIWUt5 (ORCPT ); Wed, 23 Sep 2020 16:49:57 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EA8C0613D1 for ; Wed, 23 Sep 2020 13:49:57 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id j7so345788plk.11 for ; Wed, 23 Sep 2020 13:49:57 -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=vR/4IIWUNKe15foWwpTS+9b9UDo/Qa9Bzr4DnMS8/ac=; b=cvjPnC0ctMeBB9Bs+hCjmPTbXFlh28AtvRC9s1zm2hw5bXo4ZM3zQP6zMGV/EI6SFo ZCLDgL2ZjoUvZ0VvL5o3QAIC/+pFqbd6cKVOng6IcDOjV9fnoffLoUMEnL06XcnSYhD5 +9ECmXqHcYULlG40Fvwx9JHw4WrGQFnblwk/g= 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=vR/4IIWUNKe15foWwpTS+9b9UDo/Qa9Bzr4DnMS8/ac=; b=l+QsQ/tMKrP6NfjmiSNP+P3MVp75/UkSpAxGm3IFb0a73scHvxi+LZrkEFtMF2ZFI+ KngwbeNMA2ePVTCVLZyw8aASzKyPKtHg7J93mtSPoTKA1/Ig4B705WXPZHgohaF7aT5/ wgnmZKFQF9CR5W9fmUmndncpkk0oMbswlWvsPLOEEZb6OnhawSepoeF37vgN9FkUagNU eGo+d9tYYgW+9+8qRafzMzNuzYru2K1jIBx4nGVZBUyceMFMF7Asku+n22ijW8xl8Fcs JXaLRkJhd/KMDKa7k1NU2YlAh+b/PAv1ZEBJ/7EtGL9eizpHGEXqL0lNI0tQn5x5msNI ZuYQ== X-Gm-Message-State: AOAM530r0gasPUGZsIY4o8rmy+bI7hbic7vrteHVjHdwazBvE4BUWecm IN1etKz2f3NRZzLmV+z6OGJYVf2heD+Wgjpm X-Received: by 2002:a17:90b:3c3:: with SMTP id go3mr1124426pjb.64.1600894196835; Wed, 23 Sep 2020 13:49:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m20sm514433pfa.115.2020.09.23.13.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 13:49:55 -0700 (PDT) Date: Wed, 23 Sep 2020 13:49:54 -0700 From: Kees Cook To: Gabriel Krisman Bertazi Cc: tglx@linutronix.de, luto@kernel.org, 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: <202009231349.4A25EAF@keescook> References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-2-krisman@collabora.com> <202009221243.6BC5635E@keescook> <874kno6yct.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874kno6yct.fsf@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 04:18:26PM -0400, Gabriel Krisman Bertazi wrote: > Kees Cook writes: > > > 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. > > Hi Kees, Thanks again for the review. > > Yes, we can, and I'm happy to follow up with that as part of my TIF > clean up work, but can we not block the current patchset to be merged > waiting for that, as this already grew a lot from the original feature > submission? In that case, I'd say just add the new TIF flag. The consolidation can come later. -- Kees Cook