Messages in this thread | | | Date | Tue, 13 Dec 2016 00:39:48 -0800 | From | Eric Biggers <> | Subject | Re: [PATCH v3] siphash: add cryptographically secure hashtable function |
| |
On Mon, Dec 12, 2016 at 11:18:32PM +0100, Jason A. Donenfeld wrote: > + for (; data != end; data += sizeof(u64)) { > + m = get_unaligned_le64(data); > + v3 ^= m; > + SIPROUND; > + SIPROUND; > + v0 ^= m; > + } > +#if defined(CONFIG_DCACHE_WORD_ACCESS) && BITS_PER_LONG == 64 > + b |= le64_to_cpu(load_unaligned_zeropad(data) & bytemask_from_count(left)); > +#else
Hmm, I don't think you can really do load_unaligned_zeropad() without first checking for 'left != 0'. The fixup section for load_unaligned_zeropad() assumes that rounding the pointer down to a word boundary will produce an address from which an 'unsigned long' can be loaded. But if 'left = 0' and we happen to be on a page boundary with the next page unmapped, then this will not be true and the second load will still fault.
Eric
| |