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: Fri, 7 Oct 2022 23:53:59 -0600 From: "Jason A. Donenfeld" <Jason@...c4.com> To: linux-kernel@...r.kernel.org, patches@...ts.linux.dev Cc: "Jason A. Donenfeld" <Jason@...c4.com>, Andreas Noever <andreas.noever@...il.com>, Andrew Morton <akpm@...ux-foundation.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Borislav Petkov <bp@...en8.de>, Catalin Marinas <catalin.marinas@....com>, Christoph Böhmwalder <christoph.boehmwalder@...bit.com>, Christoph Hellwig <hch@....de>, Christophe Leroy <christophe.leroy@...roup.eu>, Daniel Borkmann <daniel@...earbox.net>, Dave Airlie <airlied@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>, "David S . Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Florian Westphal <fw@...len.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "H . Peter Anvin" <hpa@...or.com>, Heiko Carstens <hca@...ux.ibm.com>, Helge Deller <deller@....de>, Herbert Xu <herbert@...dor.apana.org.au>, Huacai Chen <chenhuacai@...nel.org>, Hugh Dickins <hughd@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "James E . J . Bottomley" <jejb@...ux.ibm.com>, Jan Kara <jack@...e.com>, Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>, Johannes Berg <johannes@...solutions.net>, Jonathan Corbet <corbet@....net>, Jozsef Kadlecsik <kadlec@...filter.org>, KP Singh <kpsingh@...nel.org>, Kees Cook <keescook@...omium.org>, Marco Elver <elver@...gle.com>, Mauro Carvalho Chehab <mchehab@...nel.org>, Michael Ellerman <mpe@...erman.id.au>, Pablo Neira Ayuso <pablo@...filter.org>, Paolo Abeni <pabeni@...hat.com>, Peter Zijlstra <peterz@...radead.org>, Richard Weinberger <richard@....at>, Russell King <linux@...linux.org.uk>, Theodore Ts'o <tytso@....edu>, Thomas Bogendoerfer <tsbogend@...ha.franken.de>, Thomas Gleixner <tglx@...utronix.de>, Thomas Graf <tgraf@...g.ch>, Ulf Hansson <ulf.hansson@...aro.org>, Vignesh Raghavendra <vigneshr@...com>, WANG Xuerui <kernel@...0n.name>, Will Deacon <will@...nel.org>, Yury Norov <yury.norov@...il.com>, dri-devel@...ts.freedesktop.org, kasan-dev@...glegroups.com, kernel-janitors@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-block@...r.kernel.org, linux-crypto@...r.kernel.org, linux-doc@...r.kernel.org, linux-fsdevel@...r.kernel.org, linux-media@...r.kernel.org, linux-mips@...r.kernel.org, linux-mm@...ck.org, linux-mmc@...r.kernel.org, linux-mtd@...ts.infradead.org, linux-nvme@...ts.infradead.org, linux-parisc@...r.kernel.org, linux-rdma@...r.kernel.org, linux-s390@...r.kernel.org, linux-um@...ts.infradead.org, linux-usb@...r.kernel.org, linux-wireless@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, loongarch@...ts.linux.dev, netdev@...r.kernel.org, sparclinux@...r.kernel.org, x86@...nel.org Subject: [PATCH v5 7/7] prandom: remove unused functions With no callers left of prandom_u32() and prandom_bytes(), as well as get_random_int(), remove these deprecated wrappers, in favor of get_random_u32() and get_random_bytes(). Reviewed-by: Kees Cook <keescook@...omium.org> Signed-off-by: Jason A. Donenfeld <Jason@...c4.com> --- drivers/char/random.c | 11 +++++------ include/linux/prandom.h | 12 ------------ include/linux/random.h | 5 ----- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 01acf235f263..2fe28eeb2f38 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -97,7 +97,7 @@ MODULE_PARM_DESC(ratelimit_disable, "Disable random ratelimit suppression"); * Returns whether or not the input pool has been seeded and thus guaranteed * to supply cryptographically secure random numbers. This applies to: the * /dev/urandom device, the get_random_bytes function, and the get_random_{u8, - * u16,u32,u64,int,long} family of functions. + * u16,u32,u64,long} family of functions. * * Returns: true if the input pool has been seeded. * false if the input pool has not been seeded. @@ -161,15 +161,14 @@ EXPORT_SYMBOL(wait_for_random_bytes); * u16 get_random_u16() * u32 get_random_u32() * u64 get_random_u64() - * unsigned int get_random_int() * unsigned long get_random_long() * * These interfaces will return the requested number of random bytes * into the given buffer or as a return value. This is equivalent to - * a read from /dev/urandom. The u8, u16, u32, u64, int, and long - * family of functions may be higher performance for one-off random - * integers, because they do a bit of buffering and do not invoke - * reseeding until the buffer is emptied. + * a read from /dev/urandom. The u8, u16, u32, u64, long family of + * functions may be higher performance for one-off random integers, + * because they do a bit of buffering and do not invoke reseeding + * until the buffer is emptied. * *********************************************************************/ diff --git a/include/linux/prandom.h b/include/linux/prandom.h index 78db003bc290..e0a0759dd09c 100644 --- a/include/linux/prandom.h +++ b/include/linux/prandom.h @@ -12,18 +12,6 @@ #include <linux/percpu.h> #include <linux/random.h> -/* Deprecated: use get_random_u32 instead. */ -static inline u32 prandom_u32(void) -{ - return get_random_u32(); -} - -/* Deprecated: use get_random_bytes instead. */ -static inline void prandom_bytes(void *buf, size_t nbytes) -{ - return get_random_bytes(buf, nbytes); -} - struct rnd_state { __u32 s1, s2, s3, s4; }; diff --git a/include/linux/random.h b/include/linux/random.h index 08322f700cdc..147a5e0d0b8e 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -42,10 +42,6 @@ u8 get_random_u8(void); u16 get_random_u16(void); u32 get_random_u32(void); u64 get_random_u64(void); -static inline unsigned int get_random_int(void) -{ - return get_random_u32(); -} static inline unsigned long get_random_long(void) { #if BITS_PER_LONG == 64 @@ -100,7 +96,6 @@ declare_get_random_var_wait(u8, u8) declare_get_random_var_wait(u16, u16) declare_get_random_var_wait(u32, u32) declare_get_random_var_wait(u64, u32) -declare_get_random_var_wait(int, unsigned int) declare_get_random_var_wait(long, unsigned long) #undef declare_get_random_var -- 2.37.3
Powered by blists - more mailing lists