Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933444AbcCaUff (ORCPT ); Thu, 31 Mar 2016 16:35:35 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:57434 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758441AbcCaUf3 (ORCPT ); Thu, 31 Mar 2016 16:35:29 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Scott Bauer Cc: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, x86@kernel.org, ak@linux.intel.com, luto@amacapital.net, mingo@redhat.com, tglx@linutronix.de, wmealing@redhat.com, torvalds@linux-foundation.org, Abhiram Balasubramanian , Scott Bauer References: <1459281207-24377-1-git-send-email-sbauer@eng.utah.edu> <1459281207-24377-2-git-send-email-sbauer@eng.utah.edu> Date: Thu, 31 Mar 2016 15:25:16 -0500 In-Reply-To: <1459281207-24377-2-git-send-email-sbauer@eng.utah.edu> (Scott Bauer's message of "Tue, 29 Mar 2016 13:53:24 -0600") Message-ID: <87wpoie6oj.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX1/mHf6G2klxoCLhixDU+jL186oXuTT7KEk= X-SA-Exim-Connect-IP: 67.3.249.252 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Scott Bauer X-Spam-Relay-Country: X-Spam-Timing: total 1321 ms - load_scoreonly_sql: 0.32 (0.0%), signal_user_changed: 13 (1.0%), b_tie_ro: 11 (0.8%), parse: 1.72 (0.1%), extract_message_metadata: 37 (2.8%), get_uri_detail_list: 2.5 (0.2%), tests_pri_-1000: 6 (0.5%), tests_pri_-950: 2.5 (0.2%), tests_pri_-900: 2.1 (0.2%), tests_pri_-400: 47 (3.6%), check_bayes: 45 (3.4%), b_tokenize: 12 (0.9%), b_tok_get_all: 12 (0.9%), b_comp_prob: 4.5 (0.3%), b_tok_touch_all: 12 (0.9%), b_finish: 1.01 (0.1%), tests_pri_0: 655 (49.6%), check_dkim_signature: 1.04 (0.1%), check_dkim_adsp: 88 (6.6%), tests_pri_500: 548 (41.5%), poll_dns_idle: 534 (40.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v4 1/4] SROP Mitigation: Architecture independent code for signal cookies X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1298 Lines: 39 Scott Bauer writes: > This patch adds a per-process secret to the task struct which > will be used during signal delivery and during a sigreturn. > Also, logic is added in signal.c to generate, place, extract, > clear and verify the signal cookie. > > Cc: Abhiram Balasubramanian > Signed-off-by: Scott Bauer > Signed-off-by: Scott Bauer > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 60bba7e..1828fb8 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1502,6 +1502,13 @@ struct task_struct { > unsigned long stack_canary; > #endif > /* > + * Canary value for signal frames placed on user stack. > + * This helps mitigate "Signal Return oriented program" > + * exploits in userland. > + */ > + unsigned long sig_cookie; I suspect we want this to be a per-mm attribute rather than a per-thread attribute. Otherwise you are breaking anything that uses a N-M threading model. Which I suspect means that this implementation choice breaks all go programs on linux. > + /* > * pointers to (original) parent process, youngest child, younger sibling, > * older sibling, respectively. (p->father can be replaced with > * p->real_parent->pid) Eric