lkml.org 
[lkml]   [2012]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC v2 1/7] integrity: added digest calculation function
From
On Mon, Aug 20, 2012 at 5:59 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Wed, 15 Aug 2012 21:43:06 +0300, Dmitry Kasatkin <dmitry.kasatkin@intel.com> wrote:
>> + } else {
>> + struct {
>> + struct shash_desc shash;
>> + char ctx[crypto_shash_descsize(tfm)];
>> + } desc;
>
> Linus had a rant a while ago about using variable-sized stack vars in
> the kernel (can't find a reference right now, sorry).
>
> The problem is that either you know there's a limit to
> crypto_shash_descsize(), in which case you can just use this here, or
> you don't know, in which case, this risks a stack oveflow.
>
> Cheers,
> Rusty.

Well... descriptor size is a algo specific but constant... just
sizeof(some struct).
So there is no possibility to force overflow unless someone implement
some algo driver which
uses too big descriptor size.

- Dmitry


\
 
 \ /
  Last update: 2012-08-22 19:01    [W:0.097 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site