projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e0dd18
)
btrfs-progs: fix unaligned u64 access in btrfs_alloc_data_chunk
author
David Sterba
<dsterba@suse.com>
Fri, 4 Nov 2016 14:11:54 +0000
(15:11 +0100)
committer
David Sterba
<dsterba@suse.com>
Wed, 9 Nov 2016 12:47:34 +0000
(13:47 +0100)
The key.offset member is not well-aligned as the key is packed, use a
temporary variable to pass the argument. Reported by ASAN in misc test
002.
Signed-off-by: David Sterba <dsterba@suse.com>
volumes.c
patch
|
blob
|
history
diff --git
a/volumes.c
b/volumes.c
index 70d894099cd8b0aa7ddefeb81ac4fe4995436ddd..c128472dbfe7f34fff55d966e8bdb8f9227f2fb4 100644
(file)
--- a/
volumes.c
+++ b/
volumes.c
@@
-1080,9
+1080,12
@@
int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans,
key.offset = *start;
dev_offset = *start;
} else {
+ u64 tmp;
+
ret = find_next_chunk(chunk_root,
BTRFS_FIRST_CHUNK_TREE_OBJECTID,
- &key.offset);
+ &tmp);
+ key.offset = tmp;
if (ret)
return ret;
}