]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
Linux kernels (at least up until 2.6.27) are lacking compat sys_ustat
authorBarry Naujok <bnaujok@sgi.com>
Tue, 2 Dec 2008 03:03:12 +0000 (03:03 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Tue, 2 Dec 2008 03:03:12 +0000 (03:03 +0000)
commitdc1e5c5f9d4a375f45c5757a5fda853cc54c3837
treeaa91a5a8dce4b2eabd014e00acba724c6fa0e06b
parenta4237d89e7a782b2a258f8bdbc03741be0a25eb8
Linux kernels (at least up until 2.6.27) are lacking compat sys_ustat
handlers on some platforms (notably PPC) so that if called from 32 bits
on a 64-bit kernel, the kernel will copy out too much (32 bytes onto a
20-byte structure):

[root@xero xfstests]# xfs_logprint /dev/loop0
xfs_logprint:
*** stack smashing detected ***: xfs_logprint terminated
Aborted

This will be fixed upstream, but for the benefit of older kernels we
may want to guard against this by padding the structure we pass into
the syscall.   We don't care about the values anyway, just the return
value.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Merge of master-melb:xfs-cmds:32618a by kenmcd.

  Pad ustat struct to avoid stack corruption
libxfs/linux.c