lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 18 Oct 2022 02:04:10 -0700 From: Kees Cook <keescook@...omium.org> To: Greg Kroah-Hartman <gregkh@...uxfoundation.org> Cc: Kees Cook <keescook@...omium.org>, "Rafael J. Wysocki" <rafael@...nel.org>, linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org Subject: [PATCH] devres: Use kmalloc_size_roundup() to match ksize() usage Round up allocations with kmalloc_size_roundup() so that devres's use of ksize() is always accurate and no special handling of the memory is needed by KASAN, UBSAN_BOUNDS, nor FORTIFY_SOURCE. Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org> Cc: "Rafael J. Wysocki" <rafael@...nel.org> Signed-off-by: Kees Cook <keescook@...omium.org> --- drivers/base/devres.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 4ab2b50ee38f..c0e100074aa3 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -101,6 +101,9 @@ static bool check_dr_size(size_t size, size_t *tot_size) size, tot_size))) return false; + /* Actually allocate the full kmalloc bucket size. */ + *tot_size = kmalloc_size_roundup(*tot_size); + return true; } -- 2.34.1
Powered by blists - more mailing lists