TAKE - xfsprogs: pad ustat struct for mount check to avoid corruption
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.
Date: Tue Dec 2 12:17:58 EST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xcmds-clean Inspected by: Eric Sandeen <[email protected]>
The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb
Modid: master-melb:xfs-cmds:32618a xfsprogs/libxfs/linux.c - 1.19 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/libxfs/linux.c.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h
- Pad ustat struct to avoid stack corruption
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs