Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1273428ybb; Fri, 29 Mar 2019 00:53:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5VuaBNQNWTNIGRUQf9zxCaVS+M9vI+cFVuAmapYxtD3ZoIp7+I+fJAwhqEKcFhbup+GG3 X-Received: by 2002:a63:6fcf:: with SMTP id k198mr31917553pgc.158.1553846006082; Fri, 29 Mar 2019 00:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553846006; cv=none; d=google.com; s=arc-20160816; b=yieRZx1lhYJZ4v7e/i6qz61XVeeyZk1Dcri8JBmoqPiAey3GHBQjzxRP7vfrNCgK1d Vo+uN2EDjwLWPMSCbMBzQMVhd4E8iBafq2nRC18suj2B0zxFegmO3L7eGkQweKtYkjoS s7b0k5GjBbLWR60mhBmrHUCX2gpA87L4JveeWceynnDZfb57Z1zpngdu9rKM7v32sq2Z soS/890phPuT+j4yHUJ9GzfTGLpDntz/VLISC+m1swdmLdMT/v2hbOXgQ9j164rSlMUb Lcjpmw8Al0pJKLvbJ+6faqD/z/c1N9a/E0T7WFASFqa1nUrKpH9bV7rBmi34mHstJzG2 p7ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=mSsMWnLoDQGolIUIADqlXTqmwzqrfgHzpkp9I/1NJ08=; b=kJk8j8YZ6lFQ6LH3A9TahSThMUt9zYUUahiIZCePcd2upUSPwd/Fr8JjitHyWUxPs5 Km3MdBAIAJTPtvFaWPKniE1GaGfT/Hjps3kPR77gk15ktX3Mw++s/QGz9bFO4MboCzLe 4pwibj3nmofmYdrvIYmMcrlbhkwPPq4hz9wKaQFkByEIghH6+1Fsb1eTRl4SPXGo1H9Y RJV7mzL549JR1dDPKnVQxIr1aOv+uKN0O3m01+uhOFignHJKdYp7/PAEAAaPQVNhXLJM TdJi8sP5DUOFWso7ufTok5+cvDyqK5acltgYlC5VLOtoM+n/seiyQ/EmdZ3m7vIcXjed Z/KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si1297460plr.434.2019.03.29.00.53.10; Fri, 29 Mar 2019 00:53:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729015AbfC2Hw2 (ORCPT + 99 others); Fri, 29 Mar 2019 03:52:28 -0400 Received: from mga12.intel.com ([192.55.52.136]:35172 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728939AbfC2Hw1 (ORCPT ); Fri, 29 Mar 2019 03:52:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 00:52:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,283,1549958400"; d="scan'208";a="218681730" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2019 00:52:24 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 29 Mar 2019 07:50:06 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.146]) by irsmsx155.ger.corp.intel.com ([169.254.14.140]) with mapi id 14.03.0415.000; Fri, 29 Mar 2019 07:50:05 +0000 From: "Reshetova, Elena" To: 'Kees Cook' , Andy Lutomirski CC: Andy Lutomirski , Josh Poimboeuf , Jann Horn , "Perla, Enrico" , Ingo Molnar , Borislav Petkov , "Thomas Gleixner" , LKML , "Peter Zijlstra" , Greg KH Subject: RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall Thread-Topic: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall Thread-Index: AQHU3W7K/qF6gc5OOEis06RmzC4AhqYR090AgAAOl4CAC99ecIABLxOAgAJO6ICAAAwXgIAABToAgAACwaA= Date: Fri, 29 Mar 2019 07:50:05 +0000 Message-ID: <2236FBA76BA1254E88B949DDB74E612BA4C203E8@IRSMSX102.ger.corp.intel.com> References: <20190318094128.1488-1-elena.reshetova@intel.com> <2236FBA76BA1254E88B949DDB74E612BA4C19A55@IRSMSX102.ger.corp.intel.com> <3F1480E2-3D58-4A79-8609-2A9F7991804F@amacapital.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2U3MGQ2NGYtZDMyNS00ZmUyLWIxN2QtNTU4ODZiM2IzNWM5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidUY0eVhXUVBVakZYbHpyaVdyZDA1d2J5Skh3cXcrbUdLdFdcL05ES3R2NklOTTYzcmw3YmZqdytzUW5LYXBOdDEifQ== x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PiBPbiBUaHUsIE1hciAyOCwgMjAxOSBhdCA5OjI5IEFNIEFuZHkgTHV0b21pcnNraSA8bHV0b0Bh bWFjYXBpdGFsLm5ldD4gd3JvdGU6DQo+ID4gRG9lc27igJl0IHRoaXMganVzdCBsZWFrIHNvbWUg b2YgdGhlIGNhbmFyeSB0byB1c2VyIGNvZGUgdGhyb3VnaCBzaWRlIGNoYW5uZWxzPw0KPiANCj4g RXJmLCB5ZXMsIGdvb2QgcG9pbnQuIExldCdzIGp1c3QgdXNlIHByYW5kb20gYW5kIGJlIGRvbmUg d2l0aCBpdC4NCg0KQW5kIGhlcmUgSSBoYXZlIHNvbWUgbnVtYmVycyBvbiB0aGlzLiBBY3R1YWxs eSBwcmFuZG9tIHR1cm5lZCBvdXQgdG8gYmUgcHJldHR5DQpmYXN0LCBldmVuIHdoZW4gY2FsbGVk IGV2ZXJ5IHN5c2NhbGwuIFNlZSB0aGUgbnVtYmVycyBiZWxvdzoNCg0KMSkgbG1iZW5jaDogLi9s YXRfc3lzY2FsbCAtTiAxMDAwMDAwIG51bGwNCiAgICBiYXNlOiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBTaW1wbGUgc3lzY2FsbDogMC4xNzc0IG1pY3Jvc2Vj b25kcw0KICAgIHJhbmRvbV9vZmZzZXQgKHByYW5kb21fdTMyKCkgZXZlcn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ICAgICpidWZmZXIgPj49IEJJVFNfUEVSX0JZVEU7DQorICAgICAgICAgICAgfSB3aGlsZSAoYnl0 ZXMgPiAwKTsNCisgICAgICAgIH0NCisgICAgICAgIHB1dF9jcHVfdmFyKG5ldF9yYW5kX3N0YXRl KTsNCisgICAgICAgIHB1dF9jcHVfdmFyKG5ldF9yYW5kX3N0YXRlX2J1ZmZlcik7DQorICAgIH0g ZWxzZSB7DQorICAgICAgICBpZiAoYnl0ZXMgPiAwKSB7DQorICAgICAgICAgICAgZG8gew0KKyAg ICAgICAgICAgICAgICAqcHRyKysgPSAodTgpICpidWZmZXI7DQorICAgICAgICAgICAgICAgIGJ5 dGVzLS07DQorICAgICAgICAgICAgICAgICpidWZmZXIgPj49IEJJVFNfUEVSX0JZVEU7DQorICAg ICAgICAgICAgfSB3aGlsZSAoYnl0ZXMgPiAwKTsNCisgICAgICAgIH0NCisgICAgICAgIHB1dF9j cHVfdmFyKG5ldF9yYW5kX3N0YXRlX2J1ZmZlcik7DQorICAgIH0NCit9DQoNCkkgd2lsbCBzZW5k IHRoZSBmaXJzdCB2ZXJzaW9uIG9mIHBhdGNoIChjYWxsaW5nIHByYW5kb21fdTMyKCkgZXZlcnkg dGltZSkNCnNob3J0bHkgaWYgYW55b25lIHdhbnRzIHRvIGRvdWJsZSBjaGVjayBwZXJmb3JtYW5j ZSBpbXBsaWNhdGlvbnMuIA0KDQpCZXN0IFJlZ2FyZHMsDQpFbGVuYS4NCg==