Tuesday, May 30, 2017

Re: bioctl crypto size limitation ?

On Friday 26 May 2017 15:59:18 sharon s. wrote:
> On 05/26/17 15:49, sharon s. wrote:
> > disklabel: ioctl DIOCWDINFO: Open partition would move or shrink
> > disklabel: unable to write label
>
> Stupid me, I forgot that the softraid device was still attached.
>
> 12Tb, 14Tb and 15Tb works as well, 16 seems to be where it breaks.

Okay, this makes more sense:

#define SR_CRYPTO_MAXKEYS 32 /* max keys per volume */
#define SR_CRYPTO_KEY_BLKSHIFT 30 /* 0.5TB per key */

32 * 0.5TB == 16TB

That said, the original design of softraid crypto was to use 0.5TB per volume
key, however there has been a very long standing bug where it only uses the
first key for the entire disk. Unfortunately, when the bug was found it was
impossible to change this since it would break anyone who had a volume larger
than 0.5TB. The plan was to address this when the crypto metadata was
redesigned, which is still yet to happen (and fixing it also means there is
another bug that has to be addressed first...)

Something is obviously still checking/hitting this limit though and is
triggering the failure. There are probably a couple of things to fix here - the
error message from bioctl should at least tell you what the issue is instead
of "unknown error". It is also possible to remove the 16TB restriction (which
I thought was ineffective) since there is really no technical limit - it does
however potentially make key guessing attacks easier (which is why the
intention was to use multiple keys per volume)...

And overall, I guess we need to look at bumping the limit since people are now
hitting it (unfortunately, I don't have access to appropriate hardware for
testing though :)

No comments:

Post a Comment