Loading drivers/char/random.c +35 −45 Original line number Diff line number Diff line Loading @@ -272,7 +272,7 @@ static int random_write_wakeup_thresh = 128; static int trickle_thresh __read_mostly = INPUT_POOL_WORDS * 28; static DEFINE_PER_CPU(int, trickle_count) = 0; static DEFINE_PER_CPU(int, trickle_count); /* * A pool of size .poolwords is stirred with a primitive polynomial Loading Loading @@ -372,9 +372,10 @@ static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); #if 0 static int debug = 0; static int debug; module_param(debug, bool, 0644); #define DEBUG_ENT(fmt, arg...) do { if (debug) \ #define DEBUG_ENT(fmt, arg...) do { \ if (debug) \ printk(KERN_DEBUG "random %04d %04d %04d: " \ fmt,\ input_pool.entropy_count,\ Loading Loading @@ -872,7 +873,6 @@ void get_random_bytes(void *buf, int nbytes) { extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0); } EXPORT_SYMBOL(get_random_bytes); /* Loading Loading @@ -1002,8 +1002,7 @@ random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) } static ssize_t urandom_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { return extract_entropy_user(&nonblocking_pool, buf, nbytes); } Loading Loading @@ -1045,8 +1044,7 @@ write_pool(struct entropy_store *r, const char __user *buffer, size_t count) return 0; } static ssize_t random_write(struct file * file, const char __user * buffer, static ssize_t random_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { size_t ret; Loading @@ -1064,8 +1062,7 @@ random_write(struct file * file, const char __user * buffer, return (ssize_t)count; } static int random_ioctl(struct inode * inode, struct file * file, static int random_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int size, ent_count; Loading Loading @@ -1157,7 +1154,6 @@ void generate_random_uuid(unsigned char uuid_out[16]) /* Set the UUID variant to DCE */ uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80; } EXPORT_SYMBOL(generate_random_uuid); /******************************************************************** Loading Loading @@ -1556,10 +1552,7 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, * Choosing a clock of 64 ns period is OK. (period of 274 s) */ seq += ktime_to_ns(ktime_get_real()) >> 6; #if 0 printk("init_seq(%lx, %lx, %d, %d) = %d\n", saddr, daddr, sport, dport, seq); #endif return seq; } Loading @@ -1582,7 +1575,8 @@ u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) { struct keydata *keyptr = get_keyptr(); u32 hash[12]; Loading Loading @@ -1617,13 +1611,9 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, seq += ktime_to_ns(ktime_get_real()); seq &= (1ull << 48) - 1; #if 0 printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n", saddr, daddr, sport, dport, seq); #endif return seq; } EXPORT_SYMBOL(secure_dccp_sequence_number); #endif Loading Loading
drivers/char/random.c +35 −45 Original line number Diff line number Diff line Loading @@ -272,7 +272,7 @@ static int random_write_wakeup_thresh = 128; static int trickle_thresh __read_mostly = INPUT_POOL_WORDS * 28; static DEFINE_PER_CPU(int, trickle_count) = 0; static DEFINE_PER_CPU(int, trickle_count); /* * A pool of size .poolwords is stirred with a primitive polynomial Loading Loading @@ -372,9 +372,10 @@ static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); #if 0 static int debug = 0; static int debug; module_param(debug, bool, 0644); #define DEBUG_ENT(fmt, arg...) do { if (debug) \ #define DEBUG_ENT(fmt, arg...) do { \ if (debug) \ printk(KERN_DEBUG "random %04d %04d %04d: " \ fmt,\ input_pool.entropy_count,\ Loading Loading @@ -872,7 +873,6 @@ void get_random_bytes(void *buf, int nbytes) { extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0); } EXPORT_SYMBOL(get_random_bytes); /* Loading Loading @@ -1002,8 +1002,7 @@ random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) } static ssize_t urandom_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { return extract_entropy_user(&nonblocking_pool, buf, nbytes); } Loading Loading @@ -1045,8 +1044,7 @@ write_pool(struct entropy_store *r, const char __user *buffer, size_t count) return 0; } static ssize_t random_write(struct file * file, const char __user * buffer, static ssize_t random_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { size_t ret; Loading @@ -1064,8 +1062,7 @@ random_write(struct file * file, const char __user * buffer, return (ssize_t)count; } static int random_ioctl(struct inode * inode, struct file * file, static int random_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int size, ent_count; Loading Loading @@ -1157,7 +1154,6 @@ void generate_random_uuid(unsigned char uuid_out[16]) /* Set the UUID variant to DCE */ uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80; } EXPORT_SYMBOL(generate_random_uuid); /******************************************************************** Loading Loading @@ -1556,10 +1552,7 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, * Choosing a clock of 64 ns period is OK. (period of 274 s) */ seq += ktime_to_ns(ktime_get_real()) >> 6; #if 0 printk("init_seq(%lx, %lx, %d, %d) = %d\n", saddr, daddr, sport, dport, seq); #endif return seq; } Loading @@ -1582,7 +1575,8 @@ u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport) { struct keydata *keyptr = get_keyptr(); u32 hash[12]; Loading Loading @@ -1617,13 +1611,9 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, seq += ktime_to_ns(ktime_get_real()); seq &= (1ull << 48) - 1; #if 0 printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n", saddr, daddr, sport, dport, seq); #endif return seq; } EXPORT_SYMBOL(secure_dccp_sequence_number); #endif Loading