[PATCH v3 0/4] enable early printing of hashed pointers

2018-05-03 Thread Tobin C. Harding
iphash (as requested by Steve, and solves original problem for Anna-Maria). Tobin C. Harding (4): random: Fix whitespace pre random-bytes work random: Return nbytes filled from hw RNG vsprintf: Use hw RNG for ptr_key vsprintf: Add command line option debug_early_boot Documentation/admin

[PATCH v3 3/4] vsprintf: Use hw RNG for ptr_key

2018-05-03 Thread Tobin C. Harding
Currently we must wait for enough entropy to become available before hashed pointers can be printed. We can remove this wait by using the hw RNG if available. Use hw RNG to get keying material. Suggested-by: Kees Cook Signed-off-by: Tobin C. Harding --- lib/vsprintf.c | 19

[PATCH v3 0/4] enable early printing of hashed pointers

2018-05-03 Thread Tobin C. Harding
iphash (as requested by Steve, and solves original problem for Anna-Maria). Tobin C. Harding (4): random: Fix whitespace pre random-bytes work random: Return nbytes filled from hw RNG vsprintf: Use hw RNG for ptr_key vsprintf: Add command line option debug_early_boot Documentation/admin

Re: [PATCH 2/2] drivers core: multi-threading device shutdown

2018-05-02 Thread Tobin C. Harding
This code was a pleasure to read, super clean. On Wed, May 02, 2018 at 11:59:31PM -0400, Pavel Tatashin wrote: > When system is rebooted, halted or kexeced device_shutdown() is > called. > > This function shuts down every single device by calling either: > dev->bus->shutdown(dev) >

Re: [PATCH 2/2] drivers core: multi-threading device shutdown

2018-05-02 Thread Tobin C. Harding
This code was a pleasure to read, super clean. On Wed, May 02, 2018 at 11:59:31PM -0400, Pavel Tatashin wrote: > When system is rebooted, halted or kexeced device_shutdown() is > called. > > This function shuts down every single device by calling either: > dev->bus->shutdown(dev) >

Re: [PATCH v2 4/4] vsprintf: Add command line option debug_early_boot

2018-05-02 Thread Tobin C. Harding
On Wed, May 02, 2018 at 09:57:57PM -0700, Kees Cook wrote: > On Wed, May 2, 2018 at 3:50 PM, Tobin C. Harding <m...@tobin.cc> wrote: > > Currently printing [hashed] pointers requires either a hw RNG or enough > > entropy to be available. Early in the boot sequence the

Re: [PATCH v2 4/4] vsprintf: Add command line option debug_early_boot

2018-05-02 Thread Tobin C. Harding
On Wed, May 02, 2018 at 09:57:57PM -0700, Kees Cook wrote: > On Wed, May 2, 2018 at 3:50 PM, Tobin C. Harding wrote: > > Currently printing [hashed] pointers requires either a hw RNG or enough > > entropy to be available. Early in the boot sequence these conditions > > may

Re: [PATCH 3/3] vsprintf: Add use-early-random-bytes cmd line option

2018-05-02 Thread Tobin C. Harding
On Wed, May 02, 2018 at 02:56:45PM -0700, Andrew Morton wrote: > On Wed, 2 May 2018 09:33:40 +1000 "Tobin C. Harding" <m...@tobin.cc> wrote: > > > Currently if an attempt is made to print a pointer before there is > > enough entropy then '(ptrval)'

Re: [PATCH 3/3] vsprintf: Add use-early-random-bytes cmd line option

2018-05-02 Thread Tobin C. Harding
On Wed, May 02, 2018 at 02:56:45PM -0700, Andrew Morton wrote: > On Wed, 2 May 2018 09:33:40 +1000 "Tobin C. Harding" wrote: > > > Currently if an attempt is made to print a pointer before there is > > enough entropy then '(ptrval)' is printed. This mak

[PATCH v2 2/4] random: Return nbytes filled from hw RNG

2018-05-02 Thread Tobin C. Harding
(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Signed-off-by: Tobin C. Harding <m...@tobin.cc> Acked-by: Theodore Ts'o <ty...@mit.edu> --- drivers/char/random.c | 16 +--- include/linux/random.h | 2 +- 2 f

[PATCH v2 2/4] random: Return nbytes filled from hw RNG

2018-05-02 Thread Tobin C. Harding
(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Signed-off-by: Tobin C. Harding Acked-by: Theodore Ts'o --- drivers/char/random.c | 16 +--- include/linux/random.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions

[PATCH v2 4/4] vsprintf: Add command line option debug_early_boot

2018-05-02 Thread Tobin C. Harding
-by: Tobin C. Harding <m...@tobin.cc> --- Documentation/admin-guide/kernel-parameters.txt | 8 lib/vsprintf.c | 18 ++ 2 files changed, 26 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin

[PATCH v2 3/4] vsprintf: Use hw RNG for ptr_key

2018-05-02 Thread Tobin C. Harding
Currently we must wait for enough entropy to become available before hashed pointers can be printed. We can remove this wait by using the hw RNG if available. Use hw RNG to get keying material by default if available. Suggested-by: Kees Cook <keesc...@chromium.org> Signed-off-by: T

[PATCH v2 4/4] vsprintf: Add command line option debug_early_boot

2018-05-02 Thread Tobin C. Harding
-by: Tobin C. Harding --- Documentation/admin-guide/kernel-parameters.txt | 8 lib/vsprintf.c | 18 ++ 2 files changed, 26 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel

[PATCH v2 3/4] vsprintf: Use hw RNG for ptr_key

2018-05-02 Thread Tobin C. Harding
Currently we must wait for enough entropy to become available before hashed pointers can be printed. We can remove this wait by using the hw RNG if available. Use hw RNG to get keying material by default if available. Suggested-by: Kees Cook Signed-off-by: Tobin C. Harding --- lib/vsprintf.c

[PATCH v2 1/4] random: Fix whitespace pre random-bytes work

2018-05-02 Thread Tobin C. Harding
There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Signed-off-by: Tobin C. Harding <m...@tobin.cc> Acked-by: Theodore Ts'o <ty...@mit.edu> --- drivers/char/random.c | 3 +-- 1 fil

[PATCH v2 1/4] random: Fix whitespace pre random-bytes work

2018-05-02 Thread Tobin C. Harding
There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Signed-off-by: Tobin C. Harding Acked-by: Theodore Ts'o --- drivers/char/random.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH v2 0/4] enable early printing of hashed pointers

2018-05-02 Thread Tobin C. Harding
). - Add command line option to use cryptographically insecure hashing. If debug_early_boot is enabled use hash_long() instead of siphash (as requested by Steve, and solves original problem for Anna-Maria). thanks, Tobin. Tobin C. Harding (4): random: Fix whitespace pre random-bytes work

[PATCH v2 0/4] enable early printing of hashed pointers

2018-05-02 Thread Tobin C. Harding
). - Add command line option to use cryptographically insecure hashing. If debug_early_boot is enabled use hash_long() instead of siphash (as requested by Steve, and solves original problem for Anna-Maria). thanks, Tobin. Tobin C. Harding (4): random: Fix whitespace pre random-bytes work

Re: [PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
On Tue, May 01, 2018 at 09:39:02PM -0400, Steven Rostedt wrote: > On Wed, 2 May 2018 09:33:39 +1000 > "Tobin C. Harding" <m...@tobin.cc> wrote: > > > diff --git a/drivers/char/random.c b/drivers/char/random.c > > index 031d18b31e0f..3a66507ea60b 100644 >

Re: [PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
On Tue, May 01, 2018 at 09:39:02PM -0400, Steven Rostedt wrote: > On Wed, 2 May 2018 09:33:39 +1000 > "Tobin C. Harding" wrote: > > > diff --git a/drivers/char/random.c b/drivers/char/random.c > > index 031d18b31e0f..3a66507ea60b 100644 > > --- a/drivers

Re: [PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
On Wed, May 02, 2018 at 09:33:39AM +1000, Tobin C. Harding wrote: > Currently the function get_random_bytes_arch() has return value 'void'. > If the hw RNG fails we currently fall back to using get_random_bytes(). > This defeats the purpose of requesting random material from t

Re: [PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
On Wed, May 02, 2018 at 09:33:39AM +1000, Tobin C. Harding wrote: > Currently the function get_random_bytes_arch() has return value 'void'. > If the hw RNG fails we currently fall back to using get_random_bytes(). > This defeats the purpose of requesting random material from t

[PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Suggested-by: Linus Torvalds <torva...@linux-foundation.org> Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/char/random.c | 16 +--- include/linux/r

[PATCH 3/3] vsprintf: Add use-early-random-bytes cmd line option

2018-05-01 Thread Tobin C. Harding
behaviour. Add a command line option 'use-early-random-bytes'. When enabled get key material from the hw RNG if available. This option should NOT be enabled on production kernels. Suggested-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- li

[PATCH 2/3] random: Return nbytes filled from hw RNG

2018-05-01 Thread Tobin C. Harding
(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Suggested-by: Linus Torvalds Signed-off-by: Tobin C. Harding --- drivers/char/random.c | 16 +--- include/linux/random.h | 2 +- 2 files changed, 10 insertions(+), 8

[PATCH 3/3] vsprintf: Add use-early-random-bytes cmd line option

2018-05-01 Thread Tobin C. Harding
behaviour. Add a command line option 'use-early-random-bytes'. When enabled get key material from the hw RNG if available. This option should NOT be enabled on production kernels. Suggested-by: Kees Cook Signed-off-by: Tobin C. Harding --- lib/vsprintf.c | 50

[PATCH 1/3] random: Fix whitespace pre random-bytes work

2018-05-01 Thread Tobin C. Harding
There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/char/random.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH 0/3] enable early printing of hashed pointers

2018-05-01 Thread Tobin C. Harding
() and that did _not_ work. I do not know how early is early, or in other words, when we are hoping for this to work. thanks, Tobin. Tobin C. Harding (3): random: Fix whitespace pre random-bytes work random: Return nbytes filled from hw RNG vsprintf: Add use-early-random-bytes cmd line option

[PATCH 1/3] random: Fix whitespace pre random-bytes work

2018-05-01 Thread Tobin C. Harding
There are a couple of whitespace issues around the function get_random_bytes_arch(). In preparation for patching this function let's clean them up. Signed-off-by: Tobin C. Harding --- drivers/char/random.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char

[PATCH 0/3] enable early printing of hashed pointers

2018-05-01 Thread Tobin C. Harding
() and that did _not_ work. I do not know how early is early, or in other words, when we are hoping for this to work. thanks, Tobin. Tobin C. Harding (3): random: Fix whitespace pre random-bytes work random: Return nbytes filled from hw RNG vsprintf: Add use-early-random-bytes cmd line option

Re: Hashed pointer issues

2018-04-30 Thread Tobin C. Harding
On Mon, Apr 30, 2018 at 12:16:45PM -0700, Kees Cook wrote: > On Mon, Apr 30, 2018 at 12:00 PM, Linus Torvalds > wrote: > > On Mon, Apr 30, 2018 at 11:38 AM Kees Cook wrote: > > > >> Something like this? (Untested.) > > > > Looks workable. > >

Re: Hashed pointer issues

2018-04-30 Thread Tobin C. Harding
On Mon, Apr 30, 2018 at 12:16:45PM -0700, Kees Cook wrote: > On Mon, Apr 30, 2018 at 12:00 PM, Linus Torvalds > wrote: > > On Mon, Apr 30, 2018 at 11:38 AM Kees Cook wrote: > > > >> Something like this? (Untested.) > > > > Looks workable. > > > >> + /* If we have hw RNG, start hashing

Re: [PATCH v3] module: Fix display of wrong module .text address

2018-04-18 Thread Tobin C. Harding
On Wed, Apr 18, 2018 at 09:14:36AM +0200, Thomas Richter wrote: > Reading file /proc/modules shows the correct address: > [root@s35lp76 ~]# cat /proc/modules | egrep '^qeth_l2' > qeth_l2 94208 1 - Live 0x03ff80401000 > > and reading file /sys/module/qeth_l2/sections/.text > [root@s35lp76 ~]#

Re: [PATCH v3] module: Fix display of wrong module .text address

2018-04-18 Thread Tobin C. Harding
On Wed, Apr 18, 2018 at 09:14:36AM +0200, Thomas Richter wrote: > Reading file /proc/modules shows the correct address: > [root@s35lp76 ~]# cat /proc/modules | egrep '^qeth_l2' > qeth_l2 94208 1 - Live 0x03ff80401000 > > and reading file /sys/module/qeth_l2/sections/.text > [root@s35lp76 ~]#

[GIT PULL] leaking_addresses: changes for 14.17-rc1

2018-04-06 Thread Tobin C. Harding
processes. Also it was noted that the script does not scan _all_ the kernel since it only scans active processes. Scanning only for PID==1 makes explicit the inherent flaw in the script that the scan is only partial and also speeds things up. Signed-off-by: Tobin C. Harding <m...@tobin

[GIT PULL] leaking_addresses: changes for 14.17-rc1

2018-04-06 Thread Tobin C. Harding
processes. Also it was noted that the script does not scan _all_ the kernel since it only scans active processes. Scanning only for PID==1 makes explicit the inherent flaw in the script that the scan is only partial and also speeds things up. Signed-off-by: Tobin C. Harding

Re: [RFC][PATCH] tracing, printk: Force no hashing when trace_printk() is used

2018-04-03 Thread Tobin C. Harding
On Tue, Apr 03, 2018 at 05:06:12PM -0400, Steven Rostedt wrote: > On Tue, 3 Apr 2018 13:07:58 -0700 > Kees Cook wrote: > > > On Tue, Apr 3, 2018 at 12:41 PM, Steven Rostedt wrote: > > > Both trace_debug is set and kptr_restrict is set to zero in the

Re: [RFC][PATCH] tracing, printk: Force no hashing when trace_printk() is used

2018-04-03 Thread Tobin C. Harding
On Tue, Apr 03, 2018 at 05:06:12PM -0400, Steven Rostedt wrote: > On Tue, 3 Apr 2018 13:07:58 -0700 > Kees Cook wrote: > > > On Tue, Apr 3, 2018 at 12:41 PM, Steven Rostedt wrote: > > > Both trace_debug is set and kptr_restrict is set to zero in the same > > > code that produces the above

Re: [PATCH] list_debug: Print unmangled addresses

2018-04-02 Thread Tobin C. Harding
a memory corruption bug, causing this code to execute, the extra address is probably not making the situation any worse. (I am in no way a security expert.) > Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> Reviewed-by: Tobin C. Harding <m...@tobin.cc> > diff --git a/l

Re: [PATCH] list_debug: Print unmangled addresses

2018-04-02 Thread Tobin C. Harding
causing this code to execute, the extra address is probably not making the situation any worse. (I am in no way a security expert.) > Signed-off-by: Matthew Wilcox Reviewed-by: Tobin C. Harding > diff --git a/lib/list_debug.c b/lib/list_debug.c > index a34db8d27667..5d5424b51b74 100644 >

[PATCH] mmc: pwrseq: Use kmalloc_array instead of stack VLA

2018-03-26 Thread Tobin C. Harding
fix of function `gpiod_set_array_value_cansleep()`. It can be expected that this patch will result in a small increase in overhead due to the use of `kmalloc_array()` [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- Patch is untested. I was not able to f

[PATCH] mmc: pwrseq: Use kmalloc_array instead of stack VLA

2018-03-26 Thread Tobin C. Harding
fix of function `gpiod_set_array_value_cansleep()`. It can be expected that this patch will result in a small increase in overhead due to the use of `kmalloc_array()` [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- Patch is untested. I was not able to fully grok the call ch

Re: [PATCH] Documentation: Mention why %p prints ptrval

2018-03-22 Thread Tobin C . Harding
benefit of providing a unique identifier. On 64-bit machines > -the first 32 bits are zeroed. If you *really* want the address see %px > -below. > +the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it > +gathers enough entropy. If you *really* want the address see %px below. Acked-by: Tobin C. Harding <m...@tobin.cc> thanks, Tobin.

Re: [PATCH] Documentation: Mention why %p prints ptrval

2018-03-22 Thread Tobin C . Harding
ue identifier. On 64-bit machines > -the first 32 bits are zeroed. If you *really* want the address see %px > -below. > +the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it > +gathers enough entropy. If you *really* want the address see %px below. Acked-by: Tobin C. Harding thanks, Tobin.

[PATCH v2] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
(and re-initialization) so this overhead should not degrade performance. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- This applies onto tip of wireless-drivers next, commit (28bf8312a983 mwifiex: get_channel from firmware v2: - Use k

[PATCH v2] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
(and re-initialization) so this overhead should not degrade performance. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- This applies onto tip of wireless-drivers next, commit (28bf8312a983 mwifiex: get_channel from firmware v2: - Use kmalloc instead of #define

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
On Wed, Mar 14, 2018 at 11:19:53AM +0200, Kalle Valo wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > Added Konstantin in case he is in charge of administering > > patchwork.kernel.org? > > > > On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-14 Thread Tobin C. Harding
On Wed, Mar 14, 2018 at 11:19:53AM +0200, Kalle Valo wrote: > "Tobin C. Harding" writes: > > > Added Konstantin in case he is in charge of administering > > patchwork.kernel.org? > > > > On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees Cook wrote: >

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
Added Konstantin in case he is in charge of administering patchwork.kernel.org? On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees Cook wrote: > On Tue, Mar 13, 2018 at 7:11 PM, Tobin C. Harding <m...@tobin.cc> wrote: > > On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wro

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
Added Konstantin in case he is in charge of administering patchwork.kernel.org? On Tue, Mar 13, 2018 at 07:53:34PM -0700, Kees Cook wrote: > On Tue, Mar 13, 2018 at 7:11 PM, Tobin C. Harding wrote: > > On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wrote: > >> On

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wrote: > On Tue, Mar 13, 2018 at 10:17 PM, tcharding wrote: > > On Mon, Mar 12, 2018 at 09:46:06AM +, Kalle Valo wrote: > >> tcharding wrote: > > I'm pretty much sure it depends on the original email

Re: [RESEND] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Tue, Mar 13, 2018 at 11:00:47PM +0200, Andy Shevchenko wrote: > On Tue, Mar 13, 2018 at 10:17 PM, tcharding wrote: > > On Mon, Mar 12, 2018 at 09:46:06AM +, Kalle Valo wrote: > >> tcharding wrote: > > I'm pretty much sure it depends on the original email headers, like > above ^^^ — no

Re: [RESEND PATCH] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Sun, Mar 11, 2018 at 09:06:10PM -0500, Larry Finger wrote: > On 03/11/2018 08:43 PM, Tobin C. Harding wrote: > >The kernel would like to have all stack VLA usage removed[1]. rsi uses > >a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size > >is defined

Re: [RESEND PATCH] rsi: Remove stack VLA usage

2018-03-13 Thread Tobin C. Harding
On Sun, Mar 11, 2018 at 09:06:10PM -0500, Larry Finger wrote: > On 03/11/2018 08:43 PM, Tobin C. Harding wrote: > >The kernel would like to have all stack VLA usage removed[1]. rsi uses > >a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size > >is defined

Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-12 Thread Tobin C. Harding
On Mon, Mar 12, 2018 at 06:58:04AM +0100, Stefan Wahren wrote: > Hi Tobin, > > > "Tobin C. Harding" <m...@tobin.cc> hat am 12. März 2018 um 06:46 > > geschrieben: > > > > > > On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrot

Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-12 Thread Tobin C. Harding
On Mon, Mar 12, 2018 at 06:58:04AM +0100, Stefan Wahren wrote: > Hi Tobin, > > > "Tobin C. Harding" hat am 12. März 2018 um 06:46 > > geschrieben: > > > > > > On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrote: > > > The

Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-11 Thread Tobin C. Harding
On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrote: > The kernel would like to have all stack VLA usage removed[1]. The array > here is fixed (declared with a const variable) but it appears like a VLA > to the compiler. Also, currently we are putting 768 bytes on th

Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-11 Thread Tobin C. Harding
On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrote: > The kernel would like to have all stack VLA usage removed[1]. The array > here is fixed (declared with a const variable) but it appears like a VLA > to the compiler. Also, currently we are putting 768 bytes on th

Re: [PATCH] rbd: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
On Sun, Mar 11, 2018 at 10:02:04PM -0700, Eric Biggers wrote: > On Mon, Mar 12, 2018 at 03:49:40PM +1100, Tobin C. Harding wrote: > > The kernel would like to have all stack VLA usage removed[1]. > > Can you please stop writing this? The Linux kernel isn't sentient; it doesn't &g

Re: [PATCH] rbd: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
On Sun, Mar 11, 2018 at 10:02:04PM -0700, Eric Biggers wrote: > On Mon, Mar 12, 2018 at 03:49:40PM +1100, Tobin C. Harding wrote: > > The kernel would like to have all stack VLA usage removed[1]. > > Can you please stop writing this? The Linux kernel isn't sentient; it doesn't &g

[PATCH] rbd: Remove VLA saving ack buffer size

2018-03-11 Thread Tobin C. Harding
to zero on the error path; the buffer size variable is used later in the function, we can maintain this behavior by setting the variable using the macro ARRAY_SIZE. Use constant statement to declare array. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin

[PATCH] rbd: Remove VLA saving ack buffer size

2018-03-11 Thread Tobin C. Harding
to zero on the error path; the buffer size variable is used later in the function, we can maintain this behavior by setting the variable using the macro ARRAY_SIZE. Use constant statement to declare array. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- Excuse the lack

[PATCH] rbd: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
variable we can use the ARRAY_SIZE() macro. Use constant statement to declare array. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/block/rbd.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/block/r

[PATCH] rbd: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
variable we can use the ARRAY_SIZE() macro. Use constant statement to declare array. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- drivers/block/rbd.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c

[PATCH] of: unittest: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- Kees is this annoying you, CC'ing you an all my VLA patches? drivers/of/unittest.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 1991fe

[PATCH] of: unittest: Remove VLA stack usage

2018-03-11 Thread Tobin C. Harding
Signed-off-by: Tobin C. Harding --- Kees is this annoying you, CC'ing you an all my VLA patches? drivers/of/unittest.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 1991fe4319f5..38cbc343b7da 100644

Re: [PATCH] scsi: eata: drop VLA in reorder()

2018-03-11 Thread Tobin C. Harding
Adding kernel newbies to CC because I pose a few noob questions :) Adding Linus to CC because I quoted him. On Sun, Mar 11, 2018 at 10:06:58PM +0100, Salvatore Mesoraca wrote: > n_ready will always be less than or equal to MAX_MAILBOXES. > So we avoid a VLA[1] and use fixed-length arrays instead.

Re: [PATCH] scsi: eata: drop VLA in reorder()

2018-03-11 Thread Tobin C. Harding
Adding kernel newbies to CC because I pose a few noob questions :) Adding Linus to CC because I quoted him. On Sun, Mar 11, 2018 at 10:06:58PM +0100, Salvatore Mesoraca wrote: > n_ready will always be less than or equal to MAX_MAILBOXES. > So we avoid a VLA[1] and use fixed-length arrays instead.

[RESEND PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- RESEND: add wireless mailing list to CC's (requested by Kalle) drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.

[RESEND PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- RESEND: add wireless mailing list to CC's (requested by Kalle) drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.c | 9 +++-- 2

[PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-11 Thread Tobin C. Harding
, let's just allocate the memory instead of using the stack. This saves stack space and removes the VLA build warning. kmalloc a buffer for dumping state instead of using the stack. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- v1 of this

[PATCH v2] staging: vchiq_arm: Clear VLA warning

2018-03-11 Thread Tobin C. Harding
, let's just allocate the memory instead of using the stack. This saves stack space and removes the VLA build warning. kmalloc a buffer for dumping state instead of using the stack. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- v1 of this patch already merged

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 01:10:30PM -0800, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 12:05 PM, Kees Cook wrote: > > When max() is used in stack array size calculations from literal values > > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > >

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 01:10:30PM -0800, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 12:05 PM, Kees Cook wrote: > > When max() is used in stack array size calculations from literal values > > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > > thinks this is a dynamic

Re: [PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:37:06PM +0200, Kalle Valo wrote: > "Tobin C. Harding" <m...@tobin.cc> writes: > > > The kernel would like to have all stack VLA usage removed[1]. rsi uses > > a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size &

Re: [PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:37:06PM +0200, Kalle Valo wrote: > "Tobin C. Harding" writes: > > > The kernel would like to have all stack VLA usage removed[1]. rsi uses > > a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size > > is defined

[PATCH] rsi: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.c | 9 +++-- 2 files changed, 14 insertions(+), 8 del

[PATCH] rsi: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
the array in case of programmer error. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- drivers/net/wireless/rsi/rsi_91x_hal.c | 13 +++-- drivers/net/wireless/rsi/rsi_91x_sdio.c | 9 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git

Re: [PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:16:21AM -0600, Gustavo A. R. Silva wrote: > > I sent a patch for this six hours ago: > > https://patchwork.kernel.org/patch/10268591/ > > -- > Gustavo lol, I knew there would be a race on to fix these :) And you got it right, bonus points. Let's drop this one then.

Re: [PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:16:21AM -0600, Gustavo A. R. Silva wrote: > > I sent a patch for this six hours ago: > > https://patchwork.kernel.org/patch/10268591/ > > -- > Gustavo lol, I knew there would be a race on to fix these :) And you got it right, bonus points. Let's drop this one then.

[PATCH] staging: vchiq_arm: Clear VLA warning

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. The array here is fixed (declared with a const variable) but it appears like VLA to the compiler. We can use a pre-processor define to quiet the compiler. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding &l

[PATCH] staging: vchiq_arm: Clear VLA warning

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. The array here is fixed (declared with a const variable) but it appears like VLA to the compiler. We can use a pre-processor define to quiet the compiler. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding

[PATCH v2] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. We already have a pre-processor constant defined MAX_SGLEN. We can use this instead of the variable param-sglen. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/usb/misc/usb

[PATCH v2] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. We already have a pre-processor constant defined MAX_SGLEN. We can use this instead of the variable param-sglen. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding --- drivers/usb/misc/usbtest.c | 5 - 1

Re: [PATCH 3/4] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 04:55:35PM +1100, Tobin C. Harding wrote: > Signed-off-by: Tobin C. Harding <m...@tobin.cc> > --- Please drop this. To much on github not writing proper commit logs :( v2 to come. thanks, Tobin.

Re: [PATCH 3/4] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 04:55:35PM +1100, Tobin C. Harding wrote: > Signed-off-by: Tobin C. Harding > --- Please drop this. To much on github not writing proper commit logs :( v2 to come. thanks, Tobin.

Re: [PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Thu, Mar 08, 2018 at 10:01:07PM -0800, Joe Perches wrote: > On Fri, 2018-03-09 at 16:50 +1100, Tobin C. Harding wrote: > > The kernel would like to have all stack VLA usage removed[1]. The > > arrays are fixed here (declared with a const variable) but they appear > > like

Re: [PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
On Thu, Mar 08, 2018 at 10:01:07PM -0800, Joe Perches wrote: > On Fri, 2018-03-09 at 16:50 +1100, Tobin C. Harding wrote: > > The kernel would like to have all stack VLA usage removed[1]. The > > arrays are fixed here (declared with a const variable) but they appear > > like

[PATCH 3/4] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- drivers/usb/misc/usbtest.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 90028ef541e3..9e1142b8b91b 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drive

[PATCH 3/4] usb: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
Signed-off-by: Tobin C. Harding --- drivers/usb/misc/usbtest.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 90028ef541e3..9e1142b8b91b 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c

[PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. The arrays are fixed here (declared with a const variable) but they appear like VLAs to the compiler. We can use a pre-processor define to fix the warning. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding &l

[PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. The arrays are fixed here (declared with a const variable) but they appear like VLAs to the compiler. We can use a pre-processor define to fix the warning. [1]: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Tobin C. Harding

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Tobin C. Harding
On Tue, Mar 06, 2018 at 09:46:08PM -0800, Kees Cook wrote: > The kernel would like to remove all VLA usage. This switches to a > simple kasprintf() instead. > > Signed-off-by: Kees Cook > --- > drivers/staging/lustre/lustre/llite/xattr.c | 19 +-- > 1 file

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Tobin C. Harding
On Tue, Mar 06, 2018 at 09:46:08PM -0800, Kees Cook wrote: > The kernel would like to remove all VLA usage. This switches to a > simple kasprintf() instead. > > Signed-off-by: Kees Cook > --- > drivers/staging/lustre/lustre/llite/xattr.c | 19 +-- > 1 file changed, 13

Re: [PATCH 2/2] docs: add Co-Developed-by docs

2018-03-05 Thread Tobin C. Harding
On Mon, Mar 05, 2018 at 04:11:35AM -0800, Matthew Wilcox wrote: > On Mon, Mar 05, 2018 at 02:58:21PM +1100, Tobin C. Harding wrote: > > -12) When to use Acked-by: and Cc: > > -- > > +12) When to use Acked-by: and

Re: [PATCH 2/2] docs: add Co-Developed-by docs

2018-03-05 Thread Tobin C. Harding
On Mon, Mar 05, 2018 at 04:11:35AM -0800, Matthew Wilcox wrote: > On Mon, Mar 05, 2018 at 02:58:21PM +1100, Tobin C. Harding wrote: > > -12) When to use Acked-by: and Cc: > > -- > > +12) When to use Acked-by: and

[PATCH 2/2] docs: add Co-Developed-by docs

2018-03-04 Thread Tobin C. Harding
When Co-Developed-by tag was added, docs were only added to Documention/process/5.Posting.rst and were not added to Documention/process/submitting-patches.rst Add documentation to Documention/process/submitting-patches.rst Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- Th

[PATCH 2/2] docs: add Co-Developed-by docs

2018-03-04 Thread Tobin C. Harding
When Co-Developed-by tag was added, docs were only added to Documention/process/5.Posting.rst and were not added to Documention/process/submitting-patches.rst Add documentation to Documention/process/submitting-patches.rst Signed-off-by: Tobin C. Harding --- The text in this patch is copied

[PATCH 1/2] checkpatch: add check for tag Co-Developed-by

2018-03-04 Thread Tobin C. Harding
worked to allow for the new tag. Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Tobin C. Harding <m...@tobin.cc> --- scripts/checkpatch.pl | 58 +++

<    1   2   3   4   5   6   7   8   9   10   >