statvfs is broken in uclibc/head

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Mon Jan 21 11:26:11 UTC 2013


On 21 January 2013 10:41, Bernhard Reutner-Fischer
<rep.dot.nop at gmail.com> wrote:
> On 20 January 2013 03:51, Anthony G. Basile <basile at opensource.dyc.edu> wrote:
>> Hi Bernhard,
>>
>> Following your "statfs: support f_frsize" commit a couple of days ago,
>> statvfs is broken.  Here's a little poc:
>>
>> #include <sys/statvfs.h>
>> int main() {
>>         struct statvfs mystat;
>>         statvfs("/usr/portage/distfiles", &mystat);
>>         return 0;
>> }
>>
>> which dies with
>>
>> *** stack smashing detected ***: ./poc terminated
>> Killed
>>
>> Looks like buf->__f_spare is not getting properly zeroed at line 48 of
>> libc/misc/statfs/internal_statvfs.c.  Reverting to 6 ints fixes it:
>
> except that the struct is 5 nowadays, not 6. I'll play with the alignment..

It helps if one uses the correct field (and reference..).

Fixed on master, thanks!


More information about the uClibc mailing list