Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Fengguang Wu
On Sat, Oct 06, 2018 at 08:51:16AM -0700, Kees Cook wrote: On Sat, Oct 6, 2018 at 1:49 AM, Fengguang Wu wrote: On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: And do we have a way to add a rule to 0-day to catch these

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Fengguang Wu
On Sat, Oct 06, 2018 at 08:51:16AM -0700, Kees Cook wrote: On Sat, Oct 6, 2018 at 1:49 AM, Fengguang Wu wrote: On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: And do we have a way to add a rule to 0-day to catch these

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Kees Cook
On Sat, Oct 6, 2018 at 1:49 AM, Fengguang Wu wrote: > On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: >> >> On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: >>> And do we have a way to add a rule to 0-day to catch these so that they >>> get a warning when they are added

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Kees Cook
On Sat, Oct 6, 2018 at 1:49 AM, Fengguang Wu wrote: > On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: >> >> On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: >>> And do we have a way to add a rule to 0-day to catch these so that they >>> get a warning when they are added

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Fengguang Wu
On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: >

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-06 Thread Fengguang Wu
On Fri, Oct 05, 2018 at 08:14:34PM -0700, Joel Fernandes wrote: On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: >

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Joel Fernandes
On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: > On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > > >> As done treewide earlier, this catches several more

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Joel Fernandes
On Fri, Oct 05, 2018 at 05:22:35PM -0700, Greg KH wrote: > On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > > >> As done treewide earlier, this catches several more

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Greg KH
On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > >> As done treewide earlier, this catches several more open-coded > >> allocation size calculations that were added to the

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Greg KH
On Fri, Oct 05, 2018 at 05:04:16PM -0700, Kees Cook wrote: > On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > >> As done treewide earlier, this catches several more open-coded > >> allocation size calculations that were added to the

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Kees Cook
On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: >> As done treewide earlier, this catches several more open-coded >> allocation size calculations that were added to the kernel during the >> merge window. This performs the following

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Kees Cook
On Fri, Oct 5, 2018 at 4:51 PM, Greg KH wrote: > On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: >> As done treewide earlier, this catches several more open-coded >> allocation size calculations that were added to the kernel during the >> merge window. This performs the following

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Greg KH
On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > As done treewide earlier, this catches several more open-coded > allocation size calculations that were added to the kernel during the > merge window. This performs the following mechanical transformations > using Coccinelle: > >

Re: [PATCH v4.19-rc7] treewide: Replace more open-coded allocation size multiplications

2018-10-05 Thread Greg KH
On Fri, Oct 05, 2018 at 04:35:59PM -0700, Kees Cook wrote: > As done treewide earlier, this catches several more open-coded > allocation size calculations that were added to the kernel during the > merge window. This performs the following mechanical transformations > using Coccinelle: > >