lkml.org 
[lkml]   [2009]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateFri, 31 Jul 2009 14:31:51 -0700 (PDT)
FromLinus Torvalds <>
SubjectRe: [PATCH] information leak in sigaltstack


On Fri, 31 Jul 2009, Linus Torvalds wrote:
>
> Now, you'd end up with a memset() in that case (since it certainly won't
> match the offsetof), but my point is, the conditional really looks very
> arbitrary and rather strange. I'd rather see it unconditional, even if it
> costs three unnecessary writes or whatever.

.. and if we really do want the conditional, maybe just make it something
like

/*
* ss_flags is often generally 'int', and may cause
* holes in the structure due to alignment.
*/
if (alignof(oss.ss_flags) != alignof(oss))
memset(&oss, 0, sizeof(oss));
instead? That would seem to be less subtle, and more to-the-point.

Linus


\
 
 \ /
  Last update: 2009-10-18 23:28    [from the cache]
©2003-2010