From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757182AbcG1TCu (ORCPT ); Thu, 28 Jul 2016 15:02:50 -0400 Received: from pmta2.delivery5.ore.mailhop.org ([54.186.218.12]:61232 "EHLO pmta2.delivery5.ore.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756531AbcG1TCs (ORCPT ); Thu, 28 Jul 2016 15:02:48 -0400 X-MHO-User: 07208740-54f6-11e6-8929-8ded99d5e9d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 74.99.77.15 X-Mail-Handler: DuoCircle Outbound SMTP X-DKIM: OpenDKIM Filter v2.6.8 io E114F8005E Date: Thu, 28 Jul 2016 19:02:40 +0000 From: Jason Cooper To: Kees Cook Cc: "Roberts, William C" , linux-mm@vger.kernel.org, LKML , "kernel-hardening@lists.openwall.com" , Russell King - ARM Linux , Andrew Morton , "Theodore Ts'o" , Arnd Bergmann , Greg KH , Catalin Marinas , Will Deacon , Ralf Baechle , "benh@kernel.crashing.org" , Paul Mackerras , Michael Ellerman , "David S. Miller" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , Al Viro , Nick Kralevich , Jeffrey Vander Stoep , alyzyn@android.com, Daniel Cashman Subject: Re: [RFC patch 1/6] random: Simplify API for random address requests Message-ID: <20160728190240.GS4541@io.lakedaemon.net> References: <1469471141-25669-1-git-send-email-william.c.roberts@intel.com> <20160726030201.6775-1-jason@lakedaemon.net> <20160726033032.GD4541@io.lakedaemon.net> <20160726170052.GI4541@io.lakedaemon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 26, 2016 at 10:07:22AM -0700, Kees Cook wrote: > On Tue, Jul 26, 2016 at 10:00 AM, Jason Cooper wrote: ... > > if (range == 0 || ULONG_MAX - range < start) > > return start; > > Should it "abort" like this? I was thinking just cap the range, something like: > > if (range > ULONG_MAX - start) > range = ULONG_MAX - start yes, will do. thx, Jason. From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Date: Thu, 28 Jul 2016 19:02:40 +0000 From: Jason Cooper Message-ID: <20160728190240.GS4541@io.lakedaemon.net> References: <1469471141-25669-1-git-send-email-william.c.roberts@intel.com> <20160726030201.6775-1-jason@lakedaemon.net> <20160726033032.GD4541@io.lakedaemon.net> <20160726170052.GI4541@io.lakedaemon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [kernel-hardening] Re: [RFC patch 1/6] random: Simplify API for random address requests To: Kees Cook Cc: "Roberts, William C" , linux-mm@vger.kernel.org, LKML , "kernel-hardening@lists.openwall.com" , Russell King - ARM Linux , Andrew Morton , Theodore Ts'o , Arnd Bergmann , Greg KH , Catalin Marinas , Will Deacon , Ralf Baechle , "benh@kernel.crashing.org" , Paul Mackerras , Michael Ellerman , "David S. Miller" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , Al Viro , Nick Kralevich , Jeffrey Vander Stoep , alyzyn@android.com, Daniel Cashman List-ID: On Tue, Jul 26, 2016 at 10:07:22AM -0700, Kees Cook wrote: > On Tue, Jul 26, 2016 at 10:00 AM, Jason Cooper wrote: ... > > if (range == 0 || ULONG_MAX - range < start) > > return start; > > Should it "abort" like this? I was thinking just cap the range, something like: > > if (range > ULONG_MAX - start) > range = ULONG_MAX - start yes, will do. thx, Jason.