[dm-devel] [bug report] dm crypt: add cryptographic data integrity protection (authenticated encryption)

Milan Broz gmazyland at gmail.com
Tue Mar 14 16:47:20 UTC 2017


On 03/13/2017 05:15 PM, Mike Snitzer wrote:
> On Mon, Mar 13 2017 at 12:08pm -0400,
> Mike Snitzer <snitzer at redhat.com> wrote:
...

>>>   1385	return_clone:
>>>   1386		if (unlikely(gfp_mask & __GFP_DIRECT_RECLAIM))
>>>   1387			mutex_unlock(&cc->bio_alloc_lock);
>>>   1388	
>>>   1389		/* Allocate space for integrity tags */
>>>   1390		if (dm_crypt_integrity_io_alloc(io, clone)) {
>>>                                                     ^^^^^
>>> Oops inside new function call.
>>>
>>>   1391			crypt_free_buffer_pages(cc, clone);
>>>   1392			bio_put(clone);
>>
>> Thanks for the report.  This code makes no sense as is.
>>
>> Milan, please help me understand why you're allocating memory needed for
>> integrity tags in this 'return_clone' error path.
> 
> I folded in a fix for this, Milan please review crypt_alloc_buffer()
> changes in this revised commit:
> https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.12&id=8896496efaef45ca1a734782a8d7f9082299fa5d

Yes, it should be ok.

TBH I have no idea how this happened, that error path was clearly wrong, perhaps copy&paste error :-)

Thanks!
Milan


 




More information about the dm-devel mailing list