lkml.org 
[lkml]   [2010]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/8] char: synclink: fix information leak to userland
On Sun, Oct 17, 2010 at 07:38:39PM +0400, Vasiliy Kulikov wrote:
> On Sun, Oct 17, 2010 at 17:34 +0200, Jiri Slaby wrote:
> > On 10/17/2010 04:41 PM, Vasiliy Kulikov wrote:
> > > Structure new_line is copied to userland with some padding fields unitialized.
> > > It leads to leaking of stack memory.
> >
> > I think your tool has a bug. I must admit I fail to see the padding
> > which would cause leaks. Could you elaborate?
>
> I didn't use any tool except "grep copy_to_user" :)
>

It seems like you should be able to use pahole to make a list of
structs with padding and then a checker script to find places where
information is leaked.

Also someone complained to me about when I added a memset() in a fast
path. The thought was that it might be faster to just initialize it
instead like:

struct foo bar = {};

In my case just using the initializer made the code cleaner so I did it,
but neither of us actually benchmarked it.

regards,
dan carpenter


\
 
 \ /
  Last update: 2010-10-17 19:39    [W:1.155 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site