Re: Unnecessary overhead with stack protector.

Eric Sandeen
2009-10-21T19:09:50Z

Eric Sandeen wrote:
> Arjan van de Ven wrote:

...

>> do you have any indication that SP actually increases the stack
>> footprint by that much? it's only a few bytes....
>>
>>
>
> Here's a sample of some of the largest xfs stack users,
> and the effect stack-protector had on them. This was just
> done with objdump -d xfs.ko | scripts/checkstack.pl; I don't
> know if there's extra runtime stack overhead w/ stackprotector?
>
> -Eric
>
> function nostack stackprot delta delta %
> xfs_bmapi 376 408 32 9%
> xfs_bulkstat 328 344 16 5%
> _xfs_trans_commit 296 312 16 5%
> xfs_iomap_write_delay 264 280 16 6%
> xfs_file_ioctl 248 312 64 26%
> xfs_symlink 248 264 16 6%
> xfs_bunmapi 232 280 48 21%
> xlog_do_recovery_pass 232 248 16 7%
> xfs_trans_unreserve_and_mod_sb 224 240 16 7%
> xfs_bmap_del_extent 216 248 32 15%
> xfs_cluster_write 216 232 16 7%
> xfs_file_compat_ioctl 216 296 80 37%
> xfs_attr_set_int 200 216 16 8%
> xfs_bmap_add_extent_delay_real 200 248 48 24%
>

but maybe more to Dave's original point, xfs on x86_64 in my tree had
243 functions with minimal stack usage of 8 bytes. w/
CC_STACKPROTECTOR_ALL in force, I end up with these sizes for those
functions:

count bytes
3 16
236 24
1 32
5 40

8->24 bytes is pretty significant too, w/ a 200% increase, if you add a
few up...

-Eric