Dmitry Kasatkin
2014-09-08 09:15:53 UTC
This SOB chain is completely ass backwards. See Documentation/...
"The Signed-off-by: tag indicates that the signer was involved in t=development of the patch, or that he/she was in the patch's deliver=
path."
All three of us were involved. Does that not satisfy this rule?
No. Read #12All three of us were involved. Does that not satisfy this rule?
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right=
pass it on as an open-source patch.
Written-by: Behan
Passed-on-by: Mark
Passed-on-by: Jan
That would be correct if you sent the patch to Mark, Mark sent it to
Jan and Jan finally submitted it to LKML.
I suppose "Reviewed-by" is probably more appropriate for the last 2Written-by: Behan
Passed-on-by: Mark
Passed-on-by: Jan
That would be correct if you sent the patch to Mark, Mark sent it to
Jan and Jan finally submitted it to LKML.
then. Will fix.
- struct {
- struct shash_desc shash;
- char ctx[crypto_shash_descsize(tfm)];
- } desc;
+ char desc[sizeof(struct shash_desc) +
+ crypto_shash_descsize(tfm)] CRYPTO_MINALIGN_ATTR;
+ struct shash_desc *shash =3D (struct shash_desc *)desc;
That anon struct should have never happened in the first place.- struct shash_desc shash;
- char ctx[crypto_shash_descsize(tfm)];
- } desc;
+ char desc[sizeof(struct shash_desc) +
+ crypto_shash_descsize(tfm)] CRYPTO_MINALIGN_ATTR;
+ struct shash_desc *shash =3D (struct shash_desc *)desc;
kernel, and
appears to be fundamental to the crypto system. I was advised *not*
to change
it, so we haven't.
I agree that it's not a good practice.
Not
your problem, but you are not making it any better. You replace op=
your problem, but you are not making it any better. You replace op=
coded crap with even more unreadable crap.
Whats wrong with
SHASH_DESC_ON_STACK(shash, tfm);
Nothing is wrong with that. I would have actually preferred that.Whats wrong with
SHASH_DESC_ON_STACK(shash, tfm);
But it would
have fundamentally changed a lot more code.
#define SHASH_DESC_ON_STACK(shash, tfm) \
char __shash[sizeof(.....)]; \
struct shash_desc *shash =3D (struct shash_desc *) __shash
requiring more fundamental than open coding the same thing a gazilli=
times. You still need to change ALL usage sides of the anon struct.
So in fact you could avoid the whole code change by making it
SHASH_DESC_ON_STACK(desc, tfm);
and do the anon struct or a proper struct magic in the macro.
I see. I thought you meant a more fundamental change to the cryptoSo in fact you could avoid the whole code change by making it
SHASH_DESC_ON_STACK(desc, tfm);
and do the anon struct or a proper struct magic in the macro.
system API. My misunderstanding.
Ironically we tried to stay away from macros since the last time we
tried to replace VLAIS using macros (we've attempted patches to remov=
VLAIS a few times) we were told *not* to hide the implementation with
macro magic. Though, to be fair, we were using more pointer math in
our other macro-based effort, and the non-crypto uses of VLAIS are a
lot more complex to replace.
Like I said I'm actually a fan of hiding ugliness in macros. Will fix=
=2Emacro magic. Though, to be fair, we were using more pointer math in
our other macro-based effort, and the non-crypto uses of VLAIS are a
lot more complex to replace.
Like I said I'm actually a fan of hiding ugliness in macros. Will fix=
Again, thanks for the feedback,
Behan
Hi,Behan
Despite if it is crap or not, it was said already in this thread,
following "design pattern" is heavily used through out the kernel - by
crypto core itself and by many widely used clients.
struct {
struct shash_desc shash;
char ctx[crypto_shash_descsize(tfm)];
} desc;
My question why do you want to change this particular piece of code?
What about rest of the kernel?
To solve your problem you probably need to change everything.
If we are going to change it and introduce any macros, it is better to
do with the guidance from crypto folks.
I added CC:linux-***@vger.kernel.org mailing list and Herbert Xu,
crypto maintainer.
- Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-securit=
y-module" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html