Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Josh Poimboeuf
On Mon, May 01, 2017 at 10:36:59AM -0700, Kees Cook wrote: > >> +#ifdef CONFIG_FAST_REFCOUNT > >> +static DEFINE_RATELIMIT_STATE(refcount_ratelimit, 15 * HZ, 3); > >> + > >> +void refcount_error_report(struct pt_regs *regs, const char *kind) > >> +{ > >> + do_send_sig_info(SIGKILL, SEND_SIG_FOR

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Josh Poimboeuf
On Mon, May 01, 2017 at 10:28:53AM -0700, Kees Cook wrote: > On Mon, May 1, 2017 at 8:54 AM, Josh Poimboeuf wrote: > > On Thu, Apr 27, 2017 at 01:22:05PM -0700, Kees Cook wrote: > >> +#define __REFCOUNT_EXCEPTION(size) \ > >> + ".if "__stringify(size)" == 4\n\t"

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Kees Cook
On Mon, May 1, 2017 at 9:30 AM, Josh Poimboeuf wrote: >> +#define __REFCOUNT_EXCEPTION(size) \ >> + ".if "__stringify(size)" == 4\n\t" \ >> + ".pushsection .text.refcount_overflow\n"\ >> + ".elseif "__stringify(size)" == -4\n\t" \ >> +

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Kees Cook
On Mon, May 1, 2017 at 8:54 AM, Josh Poimboeuf wrote: > On Thu, Apr 27, 2017 at 01:22:05PM -0700, Kees Cook wrote: >> On Wed, Apr 26, 2017 at 6:31 PM, kbuild test robot wrote: >> > Hi Kees, >> > >> > [auto build test WARNING on next-20170424] >> > [cannot apply to tip/x86/core linus/master linux/

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Josh Poimboeuf
> +#define __REFCOUNT_EXCEPTION(size) \ > + ".if "__stringify(size)" == 4\n\t" \ > + ".pushsection .text.refcount_overflow\n"\ > + ".elseif "__stringify(size)" == -4\n\t" \ > + ".pushsection .text.refcount_underflow\n" \ > + "

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-05-01 Thread Josh Poimboeuf
On Thu, Apr 27, 2017 at 01:22:05PM -0700, Kees Cook wrote: > On Wed, Apr 26, 2017 at 6:31 PM, kbuild test robot wrote: > > Hi Kees, > > > > [auto build test WARNING on next-20170424] > > [cannot apply to tip/x86/core linus/master linux/master v4.9-rc8 v4.9-rc7 > > v4.9-rc6 v4.11-rc8] > > [if your

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-04-27 Thread Kees Cook
On Wed, Apr 26, 2017 at 6:31 PM, kbuild test robot wrote: > Hi Kees, > > [auto build test WARNING on next-20170424] > [cannot apply to tip/x86/core linus/master linux/master v4.9-rc8 v4.9-rc7 > v4.9-rc6 v4.11-rc8] > [if your patch is applied to the wrong git tree, please drop us a note to > help

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-04-26 Thread kbuild test robot
Hi Kees, [auto build test WARNING on next-20170424] [cannot apply to tip/x86/core linus/master linux/master v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc8] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-04-25 Thread Kees Cook
On Tue, Apr 25, 2017 at 5:25 PM, Jann Horn wrote: > On Wed, Apr 26, 2017 at 12:56 AM, Kees Cook wrote: >> This protection is a modified version of the x86 PAX_REFCOUNT >> implementation from PaX/grsecurity. This speeds up the refcount_t API by >> duplicating the existing atomic_t implementation w

Re: [PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-04-25 Thread Jann Horn
On Wed, Apr 26, 2017 at 12:56 AM, Kees Cook wrote: > This protection is a modified version of the x86 PAX_REFCOUNT > implementation from PaX/grsecurity. This speeds up the refcount_t API by > duplicating the existing atomic_t implementation with a single instruction > added to detect if the refcou

[PATCH v2 2/2] x86, refcount: Implement fast refcount overflow protection

2017-04-25 Thread Kees Cook
This protection is a modified version of the x86 PAX_REFCOUNT implementation from PaX/grsecurity. This speeds up the refcount_t API by duplicating the existing atomic_t implementation with a single instruction added to detect if the refcount has wrapped past INT_MAX (or below 0) resulting in a sign