Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()

2020-06-15 Thread Michal Hocko
On Mon 15-06-20 21:57:16, Waiman Long wrote: > The kzfree() function is normally used to clear some sensitive > information, like encryption keys, in the buffer before freeing it back > to the pool. Memset() is currently used for the buffer clearing. However, > it is entirely possible that the comp

Re: [PATCH] staging: android: ashmem.c: Cleanup

2020-06-15 Thread kernel test robot
Hi Dio, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on staging/staging-testing] [cannot apply to aa5af974127d317071d6225a0f3678c5f520e7ce] url: https://github.com/0day-ci/linux/commits/Dio-Putra/staging-android-ashmem-c-Cleanup/20200614-013821 base: http

Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()

2020-06-15 Thread Eric Biggers
On Mon, Jun 15, 2020 at 09:57:16PM -0400, Waiman Long wrote: > The kzfree() function is normally used to clear some sensitive > information, like encryption keys, in the buffer before freeing it back > to the pool. Memset() is currently used for the buffer clearing. However, > it is entirely possib

[PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Waiman Long
As said by Linus: A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively detrimental, because maybe in the future we r

[PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()

2020-06-15 Thread Waiman Long
In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc() was incorrectly paired with kzfree(). According to David Sterba, there isn't any sensitive information in the subvol_info that needs to be cleared before freeing. So kfree_sensitive() isn't really needed, use kfree() instead.

[PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()

2020-06-15 Thread Waiman Long
The kzfree() function is normally used to clear some sensitive information, like encryption keys, in the buffer before freeing it back to the pool. Memset() is currently used for the buffer clearing. However, it is entirely possible that the compiler may choose to optimize away the memory clearing

[PATCH v4 0/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Waiman Long
v4: - Break out the memzero_explicit() change as suggested by Dan Carpenter so that it can be backported to stable. - Drop the "crypto: Remove unnecessary memzero_explicit()" patch for now as there can be a bit more discussion on what is best. It will be introduced as a separate pa

[PATCH][next] staging: rts5208: Use array_size() helper in vmalloc()

2020-06-15 Thread Gustavo A. R. Silva
and memset() The vmalloc() function has no 2-factor argument form, so multiplication factors need to be wrapped in array_size(). Also, while there, use array_size() in memset(). This issue was found with the help of Coccinelle and, audited and fixed manually. Addresses-KSPP-ID: https://github.co

[driver-core:debugfs_cleanup] BUILD SUCCESS 8b905726a5dd443ac67f92fe9d4768335f19332d

2020-06-15 Thread kernel test robot
-kconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a006-20200615 i386 randconfig-a002-20200615 i386 randconfig-a001-20200615 i386 randconfig-a004-20200615 i386

[driver-core:readfile] BUILD SUCCESS fd5cf2d6f921ca0f8f777d8833a0a3e5100bc515

2020-06-15 Thread kernel test robot
powerpc rhel-kconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a006-20200615 i386 randconfig-a002-20200615 i386 randconfig-a001-20200615 i386

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Waiman Long
On 6/15/20 2:07 PM, Dan Carpenter wrote: On Mon, Apr 13, 2020 at 05:15:49PM -0400, Waiman Long wrote: diff --git a/mm/slab_common.c b/mm/slab_common.c index 23c7500eea7d..c08bc7eb20bd 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1707,17 +1707,17 @@ void *krealloc(const void *p, size_

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Dan Carpenter
On Mon, Apr 13, 2020 at 05:15:49PM -0400, Waiman Long wrote: > diff --git a/mm/slab_common.c b/mm/slab_common.c > index 23c7500eea7d..c08bc7eb20bd 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -1707,17 +1707,17 @@ void *krealloc(const void *p, size_t new_size, gfp_t > flags) > EXP

[PATCH] staging: comedi: fix up missing whitespace in comment

2020-06-15 Thread Garrit Franke
From: Garrit Franke I noticed this missing whitespace in a comment inside ni_mio_common.c Signed-off-by: Garrit Franke --- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/driver

Re: [PATCH v2] Staging: rtl8712: Addressed checkpatch.pl issues related to macro parameter wrapping in parentheses.

2020-06-15 Thread Greg Kroah-Hartman
On Sun, Jun 14, 2020 at 06:31:46PM +0100, Ricardo Ferreira wrote: > Attempting to wet my feet in kernel patch submission by submitting a > checkstyle > fix for the rtl8712 driver. > > Signed-off-by: Ricardo Ferreira > --- What changed from v1? Always put that below the --- line, so please fix

Re: [PATCH] Staging: rtl8712: Addressed checkpatch.pl issues related to macro parameter wrapping in parentheses.

2020-06-15 Thread Greg Kroah-Hartman
On Mon, Jun 15, 2020 at 10:28:51AM +0100, Ricardo Ferreira wrote: > On Sun, 14 Jun 2020 at 15:05, Greg Kroah-Hartman > wrote: > > > > On Sun, Jun 14, 2020 at 02:51:25PM +0100, Ricardo Ferreira wrote: > > > #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \ > > > do {\ > > > - INIT_LIST_

Re: [PATCH] Staging: rtl8712: Addressed checkpatch.pl issues related to macro parameter wrapping in parentheses.

2020-06-15 Thread Ricardo Ferreira
On Sun, 14 Jun 2020 at 15:05, Greg Kroah-Hartman wrote: > > On Sun, Jun 14, 2020 at 02:51:25PM +0100, Ricardo Ferreira wrote: > > #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \ > > do {\ > > - INIT_LIST_HEAD(&pcmd->list);\ > > - pcmd->cmdcode = code;\ > > - pcmd->parmbuf = (