Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7426254yba; Thu, 2 May 2019 09:36:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyL0xfRRQzDjadP0uSdtriitHrRECc6s51XyYWdy4ghs0U3tOIly6XPFwiYQj4r601fZPRi X-Received: by 2002:a17:902:266:: with SMTP id 93mr4771201plc.201.1556814982526; Thu, 02 May 2019 09:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556814982; cv=none; d=google.com; s=arc-20160816; b=zGOmSVoLgg2LmCsx5z9tH2X+DYEhunbbtsPe6nSN2XQc8l2RJlChIeV0Otj4bOsBad sGWJaLQjDWZOa6nE7J7NnIqdklej3CqnOl0NF8DeE+by9QHidJr8Rc1RN8T2Hlk7QK7p k++OF+JfAfg/b2G9wjNvF3205lxZ/+BLR0vQkJn+9g5/MeEOQ/zPXU07+hspR7XiCo0j /Cgmr0lGQq4kcXWztTteU3EtEsO59e3rcznunkFbZbBODZoglX6/O7WfEijmSTawb2+h kheBci8UOfOVgKzzlGecGjYwdAb7ZsKPR8CcdXkBcXW60qL7cE1NfyJ6/8gTvCGG3tJd UD2g== 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=ADipCSY9jL6lYIPlN+niCu7Q+R0jEjXvMQJ+M2zOQ80=; b=imJDiJ4C3pUYafg83Lsj+WQQy9WUhJ9CAyQeEXGiQ2OQWcr0futLnU9Qjvr/5/L18F aS2ahs7EJ5Lr+pmKyUy2SA1QGeUvn/fkM6SjTxrf5KPXAhQnRMGvV0qHbHWdh2kjKXjh qWs8fKQz6Ml6JPRiqD1U2qhpPXK+kE3IE53+HCAE7Andb+k6fbkzGDd7Kwx+0d1ibWe7 TT0uktJtWsn5X2XdBC9EZLLyJUegSkt6qk9PKy4YM2MkcZjDBs2VCvM3oWt2ecNUdTbu yZzpk4+XKd4jVyQ1PFHpxEV4edc1RnumfCqSeRLdV7VBKMThQoIVFbYH91awj9wdH1Hz jrpA== 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 d66si1866408pfa.201.2019.05.02.09.36.07; Thu, 02 May 2019 09:36:22 -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 S1726554AbfEBQeu convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 May 2019 12:34:50 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:33168 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbfEBQeu (ORCPT ); Thu, 2 May 2019 12:34:50 -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-160-SA7C3NSCNyuEpoaJBQmVzg-1; Thu, 02 May 2019 17:34:47 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 2 May 2019 17:34:46 +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; Thu, 2 May 2019 17:34:46 +0100 From: David Laight To: 'Ingo Molnar' , Andy Lutomirski CC: "Reshetova, Elena" , Theodore Ts'o , Eric Biggers , "ebiggers@google.com" , "herbert@gondor.apana.org.au" , Peter Zijlstra , "keescook@chromium.org" , 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: AQHU9E1UquBTkhVACE2y3BuRFoekIqY8wW2AgAAdM1CAAXexAIAANZ3ggAAW1gCAAApRgIAAMeKAgAAd+PCAAQuGgIAAYQuAgAAKhwCACsPi4IADJTwAgAAcagCAAExngIAEBbGAgACIbACAAbyQ8IAA9yhggAF9YoCAABkBsIAAayebgAAR3KA= Date: Thu, 2 May 2019 16:34:46 +0000 Message-ID: References: <2236FBA76BA1254E88B949DDB74E612BA4C63E24@IRSMSX102.ger.corp.intel.com> <20190426140102.GA4922@mit.edu> <57357E35-3D9B-4CA7-BAB9-0BE89E0094D2@amacapital.net> <2236FBA76BA1254E88B949DDB74E612BA4C66A8A@IRSMSX102.ger.corp.intel.com> <6860856C-6A92-4569-9CD8-FF6C5C441F30@amacapital.net> <2236FBA76BA1254E88B949DDB74E612BA4C6A4D7@IRSMSX102.ger.corp.intel.com> <303fc4ee5ac04e4fac104df1188952e8@AcuMS.aculab.com> <2236FBA76BA1254E88B949DDB74E612BA4C6C2C3@IRSMSX102.ger.corp.intel.com> <2e55aeb3b39440c0bebf47f0f9522dd8@AcuMS.aculab.com> <20190502150853.GA16779@gmail.com> In-Reply-To: <20190502150853.GA16779@gmail.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: SA7C3NSCNyuEpoaJBQmVzg-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: Ingo Molnar > Sent: 02 May 2019 16:09 > * Andy Lutomirski wrote: > > > Or we decide that calling get_random_bytes() is okay with IRQs off and > > this all gets a bit simpler. > > BTW., before we go down this path any further, is the plan to bind this > feature to a real CPU-RNG capability, i.e. to the RDRAND instruction, > which excludes a significant group of x86 of CPUs? It has already been measured - it is far too slow. Even just using 6 bits so it doesn't have to be read every system call is probably a significant overhead (I don't think that was tested though). I do agree that using 'real' randomness is probably OTT here. > Because calling tens of millions of system calls per second will deplete > any non-CPU-RNG sources of entropy and will also starve all other users > of random numbers, which might have a more legitimate need for > randomness, such as the networking stack ... If the function you use to generate random numbers from the 'entropy pool' isn't reversible (in a finite time) I don't think you really need to worry about bits-in v bits-out. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)