Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: dm-bht.c

Issue 6726018: verity: remove BUG_ON alignment check (Closed) Base URL: http://git.chromium.org/git/dm-verity.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org> 2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org>
3 * 3 *
4 * Device-Mapper block hash tree interface. 4 * Device-Mapper block hash tree interface.
5 * See Documentation/device-mapper/dm-bht.txt for details. 5 * See Documentation/device-mapper/dm-bht.txt for details.
6 * 6 *
7 * This file is released under the GPL. 7 * This file is released under the GPL.
8 */ 8 */
9 9
10 #include <asm/atomic.h> 10 #include <asm/atomic.h>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 static int dm_bht_compute_hash(struct dm_bht *bht, const void *block, 98 static int dm_bht_compute_hash(struct dm_bht *bht, const void *block,
99 u8 *digest) 99 u8 *digest)
100 { 100 {
101 struct hash_desc *hash_desc = &bht->hash_desc[smp_processor_id()]; 101 struct hash_desc *hash_desc = &bht->hash_desc[smp_processor_id()];
102 struct scatterlist sg; 102 struct scatterlist sg;
103 103
104 /* TODO(msb): Once we supporting block_size < PAGE_SIZE, change this to: 104 /* TODO(msb): Once we supporting block_size < PAGE_SIZE, change this to:
105 * offset_into_page + length < page_size 105 * offset_into_page + length < page_size
106 * For now just check that block is page-aligned. 106 * For now just check that block is page-aligned.
107 */ 107 */
108 » BUG_ON(!IS_ALIGNED((uintptr_t)block, PAGE_SIZE)); 108 » /*
109 » * TODO(msb): Re-enable once user-space code is modified to use
110 » * aligned buffers.
111 » * BUG_ON(!IS_ALIGNED((uintptr_t)block, PAGE_SIZE));
112 » */
109 113
110 sg_init_table(&sg, 1); 114 sg_init_table(&sg, 1);
111 sg_set_buf(&sg, block, PAGE_SIZE); 115 sg_set_buf(&sg, block, PAGE_SIZE);
112 /* Note, this is synchronous. */ 116 /* Note, this is synchronous. */
113 if (crypto_hash_init(hash_desc)) { 117 if (crypto_hash_init(hash_desc)) {
114 DMCRIT("failed to reinitialize crypto hash (proc:%d)", 118 DMCRIT("failed to reinitialize crypto hash (proc:%d)",
115 smp_processor_id()); 119 smp_processor_id());
116 return -EINVAL; 120 return -EINVAL;
117 } 121 }
118 if (crypto_hash_digest(hash_desc, &sg, PAGE_SIZE, digest)) { 122 if (crypto_hash_digest(hash_desc, &sg, PAGE_SIZE, digest)) {
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 DMERR("no root digest exists to export"); 1187 DMERR("no root digest exists to export");
1184 if (available > 0) 1188 if (available > 0)
1185 *hexdigest = 0; 1189 *hexdigest = 0;
1186 return -1; 1190 return -1;
1187 } 1191 }
1188 dm_bht_bin_to_hex(bht->root_digest, hexdigest, bht->digest_size); 1192 dm_bht_bin_to_hex(bht->root_digest, hexdigest, bht->digest_size);
1189 return 0; 1193 return 0;
1190 } 1194 }
1191 EXPORT_SYMBOL(dm_bht_root_hexdigest); 1195 EXPORT_SYMBOL(dm_bht_root_hexdigest);
1192 1196
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698