#ifndef RND_H #define RND_H #define HIG_ENTROPY_SOURCE "/dev/random" #define LOW_ENTROPY_SOURCE "/dev/urandom" /* secrand is not really secure, but the name only suggests it's better to use * than rand(3) when transferring bytes over the network in non-security * critical structure members. secrand() is only used to fill up salts actually. */ extern int secrand(void); extern void gen_key_bytes(unsigned char *area, size_t len); #endif /* RND_H */ xt.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2016-05-17 17:37:38 +0800
committerDavid Sterba <dsterba@suse.com>2016-05-25 22:15:21 +0200
commitf1fee6534dcfbf468a159789aa202db2bce8c200 (patch)
tree4149ed8954a0c344b354769d1c9bbed9a8e54114
parent2d324f59f343967a03eeb2690f0ff178304d0687 (diff)
btrfs: scrub: Set bbio to NULL before calling btrfs_map_block
We usually call btrfs_put_bbio() when btrfs_map_block() failed, btrfs_put_bbio() works right whether bbio is a valid value, or NULL. But there is a exception, in some case, btrfs_map_block() will return fail without touching *bbio(keeping its original value), and if bbio was not initialized yet, invalid memory accessing will happened. Above case is in scrub_missing_raid56_pages(), and similar case in scrub_raid56_parity(). Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>