Return-path: Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fEA3v-0004nj-PO for speck@linutronix.de; Thu, 03 May 2018 10:58:04 +0200 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEA3u-0000UP-GA for speck@linutronix.de; Thu, 03 May 2018 08:58:02 +0000 Date: Thu, 3 May 2018 10:58:01 +0200 From: Peter Zijlstra Subject: [MODERATED] Re: [PATCH SSBv11 3/3] seccomp 0 Message-ID: <20180503085800.GX12217@hirez.programming.kicks-ass.net> References: =?utf-8?q?=3C5f6464?= =?utf-8?q?d53346d3939a81cab15e5d5b20ad90c05d=2E1525308267=2Egit=2Ekeescoo?= =?utf-8?q?k=40chromium=2Eorg=3E?= MIME-Version: 1.0 In-Reply-To: =?utf-8?q?=3C5f6464d53346d3939a81cab15e5d5b20ad90c05d=2E15253?= =?utf-8?q?08267=2Egit=2Ekeescook=40chromium=2Eorg=3E?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, May 01, 2018 at 03:07:31PM -0700, speck for Kees Cook wrote: > @@ -239,6 +254,9 @@ static inline void seccomp_assign_mode(struct task_struct *task, > */ > smp_mb__before_atomic(); > set_tsk_thread_flag(task, TIF_SECCOMP); > + > + /* Assume seccomp processes want speculation flaw mitigation. */ > + spec_mitigate(task, PR_SPEC_STORE_BYPASS); > } What about the ordering there? That function appears to explicitly set TIF_SECCOMP last, such that when that is observed, the complete environment is observed. But now you add something after it. Does this not mean that if you set this on a remote task, this task can execute TIF_SECCOMP thing before it disables SSB. Is that OK?