Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6160751ybi; Wed, 29 May 2019 03:53:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPvJkHLqtlV0rKidEQBBPqbd7+ryxQqRT6rMYGY6xAeZVANONTelkQ8PM7FnrqzZ4oWH7l X-Received: by 2002:a63:e50c:: with SMTP id r12mr123002740pgh.284.1559127198053; Wed, 29 May 2019 03:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559127198; cv=none; d=google.com; s=arc-20160816; b=fwGdKlGINj3lwrly+E3ZRIDw4qd+P8+bCVzdKrZBUCHSbw/wRP0RnBtDoEx5ewOz1s GqFBZ5IqPUoitwDJM7zTaRk06qnAxCjkI+f754biHmOUKmtsAL7vdaq/9NGIl8vPsLwM R3J5KvsambhYLWNBtnLnwVmP7KYwHetTml5pm/R5bM5nc/tu/Yts8CQzBhtsW4AlIMc5 hFWkWwmtOnD0Ap8XLk9DtCJxqTFewXT10gtCzMhe5g9QgIKmAeLR2hS62XNgzczVuO79 EPyD06v7ZBWl+i7rzoseTQpOd7jLbjhgPnq8Yk+AbUrXy/zNAkWKCty5J9yEn+DAXJ98 XSNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=Qmbjwc/eJV2kks84Hp3xAL5HVZGTtfmex0Qooy14dp8=; b=I/cSRAcOf7GsRTTdp5HHUYYPpbRqgNQiGD3FmMeLn0OO1Izuxfu1NC8bSbcuzI4Oqs WtJOCf67H5ZmKg9Dt03+AivcbUyqp9Mvrs8sOtco/7XJdVnJrgiZEiePK/ka+W3MDHEq H9V+Ue6is/+UP1KL7LZbQMiVu+zFCwFwjU+GviNFu03eSlLGvrzvzMrd7Uvoif+H129D G6EKoxVIE7ZIa6GZLumw8/kOJWUx35OoDzTx3NaPRNasFfcuFCdWcPLzEVPGrzHUKHlp f/Rf20zRC+v+BSr+t+kh0hN+NFS1zyn7sOUOW1aQfieSV8LLvoLobD3fLDkxxPrZKY83 S8pA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33si25938843pld.312.2019.05.29.03.53.02; Wed, 29 May 2019 03:53:18 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbfE2Kvr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 May 2019 06:51:47 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:42073 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfE2Kvq (ORCPT ); Wed, 29 May 2019 06:51:46 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-193-tjoSKSwtOfSt0uX1-9NT_Q-1; Wed, 29 May 2019 11:51:42 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 29 May 2019 11:51:42 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 29 May 2019 11:51:42 +0100 From: David Laight To: "'Reshetova, Elena'" , Theodore Ts'o CC: Kees Cook , Ingo Molnar , "Andy Lutomirski" , Eric Biggers , "ebiggers@google.com" , "herbert@gondor.apana.org.au" , Peter Zijlstra , "Daniel Borkmann" , "linux-kernel@vger.kernel.org" , "jpoimboe@redhat.com" , "jannh@google.com" , "Perla, Enrico" , "mingo@redhat.com" , "bp@alien8.de" , "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "Edgecombe, Rick P" , Linus Torvalds , Peter Zijlstra Subject: RE: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall Thread-Topic: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall Thread-Index: AQHU81HQwzT9MH4dM0y/JZXnSwiYT6Y8wW2AgAAdM1CAAXexAIAANZ3ggAAW1gCAAApRgIAAMeKAgAAd+PCAAQuGgIAAYQuAgAAKhwCACsPi4IADJTwAgAAcagCAAExngIAEBbGAgACIbACAAbyQ8IAA626AgAGZfXCAAARpgIAAWpuAgAAF74CAABf/AIAAAvkAgAGZnrD///dzgIAHjbaA///31ICAAC4VAIABBxmAgAAfuaCAAA5FAIAED8OAgAAYaYCAAINWgIAAbRaAgBjvMfCAACWEgIABZK1ggAAKveA= Date: Wed, 29 May 2019 10:51:41 +0000 Message-ID: References: <20190508113239.GA33324@gmail.com> <2236FBA76BA1254E88B949DDB74E612BA4C762F7@IRSMSX102.ger.corp.intel.com> <20190509055915.GA58462@gmail.com> <2236FBA76BA1254E88B949DDB74E612BA4C7741F@IRSMSX102.ger.corp.intel.com> <20190509084352.GA96236@gmail.com> <201905111703.5998DF5F@keescook> <20190512080245.GA7827@gmail.com> <201905120705.4F27DF3244@keescook> <2236FBA76BA1254E88B949DDB74E612BA4CA8DBF@IRSMSX102.ger.corp.intel.com> <20190528133347.GD19149@mit.edu> <2236FBA76BA1254E88B949DDB74E612BA4CABA56@IRSMSX102.ger.corp.intel.com> In-Reply-To: <2236FBA76BA1254E88B949DDB74E612BA4CABA56@IRSMSX102.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: tjoSKSwtOfSt0uX1-9NT_Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Reshetova, Elena > Sent: 29 May 2019 11:14 .... > On related note: the current prng we have in kernel (prandom) is based on a > *very old* style of prngs, which is basically 4 linear LFSRs xored together. I'm no expert here (apart from some knowledge of LFRS/CRC) but even adding the results of the 4 LFSR (instead of xor) will make the generator much more secure (aka computationally expensive to reverse) without affecting the randomness or repeat cycle. FWIW if you are going to merge LFRS you probably want to clock them different numbers of times (+ve or -ve) otherwise the output 'mostly' shifts one bit per clock and the same bits tend to get merged. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)