<br><br>On Friday, July 31, 2020, Greg Kroah-Hartman <<a href="mailto:gregkh@linuxfoundation.org">gregkh@linuxfoundation.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jul 31, 2020 at 07:33:06AM +0200, Greg Kroah-Hartman wrote:<br>
> On Fri, Jul 31, 2020 at 07:53:01AM +0300, Leon Romanovsky wrote:<br>
> > On Thu, Jul 30, 2020 at 03:20:26PM -0400, Peilin Ye wrote:<br>
> > > rds_notify_queue_get() is potentially copying uninitialized kernel stack<br>
> > > memory to userspace since the compiler may leave a 4-byte hole at the end<br>
> > > of `cmsg`.<br>
> > ><br>
> > > In 2016 we tried to fix this issue by doing `= { 0 };` on `cmsg`, which<br>
> > > unfortunately does not always initialize that 4-byte hole. Fix it by using<br>
> > > memset() instead.<br>
> > <br>
> > Of course, this is the difference between "{ 0 }" and "{}" initializations.<br>
> <br>
> Really?  Neither will handle structures with holes in it, try it and<br>
> see.</blockquote><div><br></div><div>{} is a GCC extension, but I never thought it works differently. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
And if true, where in the C spec does it say that?<br>
<br>
thanks,<br>
<br>
greg k-h<br>
</blockquote><br><br>-- <br>With Best Regards,<br>Andy Shevchenko<br><br><br>