mirror_zfs/cmd
Richard Yao b01615d5ac Constify structures containing function pointers
The PaX team modified the kernel's modpost to report writeable function
pointers as section mismatches because they are potential exploit
targets. We could ignore the warnings, but their presence can obscure
actual issues. Proper const correctness can also catch programming
mistakes.

Building the kernel modules against a PaX/GrSecurity patched Linux 3.4.2
kernel reports 133 section mismatches prior to this patch. This patch
eliminates 130 of them. The quantity of writeable function pointers
eliminated by constifying each structure is as follows:

vdev_opts_t             52
zil_replay_func_t       24
zio_compress_info_t     24
zio_checksum_info_t     9
space_map_ops_t         7
arc_byteswap_func_t     5

The remaining 3 writeable function pointers cannot be addressed by this
patch. 2 of them are in zpl_fs_type. The kernel's sget function requires
that this be non-const. The final writeable function pointer is created
by SPL_SHRINKER_DECLARE. The kernel's set_shrinker() and
remove_shrinker() functions also require that this be non-const.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1300
2013-03-04 08:49:32 -08:00
..
fsck_zfs Add /sbin/fsck.zfs helper 2013-01-09 16:54:58 -08:00
mount_zfs Report realpath() canonicalization error 2013-01-09 16:54:58 -08:00
vdev_id vdev_id: improve keyword parsing flexibility 2013-01-25 13:44:32 -08:00
zdb Illumos #3397, #3398 2013-01-11 16:42:50 -08:00
zfs Illumos #1884, #3028, #3048, #3049, #3060, #3061, #3093 2013-01-11 09:17:19 -08:00
zhack Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
zinject Remove autotools products 2012-08-27 11:47:44 -07:00
zpios Remove autotools products 2012-08-27 11:47:44 -07:00
zpool Fix hot spares 2013-03-01 13:31:02 -08:00
zstreamdump Add zstreamdump .gitignore 2012-09-06 14:23:11 -07:00
ztest Constify structures containing function pointers 2013-03-04 08:49:32 -08:00
zvol_id Remove autotools products 2012-08-27 11:47:44 -07:00
Makefile.am Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00