Advertisement
Guest User

zfs.hardened-fix.patch

a guest
Dec 7th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.38 KB | None | 0 0
  1. diff --git a/configure b/configure
  2. index 885d5eb..4c5745b 100755
  3. --- a/configure
  4. +++ b/configure
  5. @@ -14471,7 +14471,7 @@ main (void)
  6.  {
  7.  
  8.                 int (*fsync) (struct file *, struct dentry *, int) = NULL;
  9. -               struct file_operations fops __attribute__ ((unused));
  10. +               file_operations_no_const fops __attribute__ ((unused));
  11.  
  12.                 fops.fsync = fsync;
  13.  
  14. @@ -14535,7 +14535,7 @@ main (void)
  15.  {
  16.  
  17.                 int (*fsync) (struct file *, int) = NULL;
  18. -               struct file_operations fops __attribute__ ((unused));
  19. +               file_operations_no_const fops __attribute__ ((unused));
  20.  
  21.                 fops.fsync = fsync;
  22.  
  23. @@ -14599,7 +14599,7 @@ main (void)
  24.  {
  25.  
  26.                 int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
  27. -               struct file_operations fops __attribute__ ((unused));
  28. +               file_operations_no_const fops __attribute__ ((unused));
  29.  
  30.                 fops.fsync = fsync;
  31.  
  32. @@ -14661,12 +14661,14 @@ cat >>conftest.$ac_ext <<_ACEOF
  33.  
  34.                 #include <linux/fs.h>
  35.  
  36. +typedef struct super_operations __attribute__ ((no_const)) super_operations_no_const;
  37. +
  38.  int
  39.  main (void)
  40.  {
  41.  
  42.                 void (*evict_inode) (struct inode *) = NULL;
  43. -               struct super_operations sops __attribute__ ((unused)) = {
  44. +               super_operations_no_const sops __attribute__ ((unused)) = {
  45.                         .evict_inode = evict_inode,
  46.                 };
  47.  
  48. @@ -19241,7 +19243,7 @@ main (void)
  49.  {
  50.  
  51.                 int (*fsync) (struct file *, struct dentry *, int) = NULL;
  52. -               struct file_operations fops __attribute__ ((unused));
  53. +               file_operations_no_const fops __attribute__ ((unused));
  54.  
  55.                 fops.fsync = fsync;
  56.  
  57. @@ -19305,7 +19307,7 @@ main (void)
  58.  {
  59.  
  60.                 int (*fsync) (struct file *, int) = NULL;
  61. -               struct file_operations fops __attribute__ ((unused));
  62. +               file_operations_no_const fops __attribute__ ((unused));
  63.  
  64.                 fops.fsync = fsync;
  65.  
  66. @@ -19369,7 +19371,7 @@ main (void)
  67.  {
  68.  
  69.                 int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
  70. -               struct file_operations fops __attribute__ ((unused));
  71. +               file_operations_no_const fops __attribute__ ((unused));
  72.  
  73.                 fops.fsync = fsync;
  74.  
  75. @@ -19431,12 +19433,14 @@ cat >>conftest.$ac_ext <<_ACEOF
  76.  
  77.                 #include <linux/fs.h>
  78.  
  79. +typedef struct super_operations __attribute__ ((no_const)) super_operations_no_const;
  80. +
  81.  int
  82.  main (void)
  83.  {
  84.  
  85.                 void (*evict_inode) (struct inode *) = NULL;
  86. -               struct super_operations sops __attribute__ ((unused)) = {
  87. +               super_operations_no_const sops __attribute__ ((unused)) = {
  88.                         .evict_inode = evict_inode,
  89.                 };
  90.  
  91. diff --git a/include/sys/zfs_acl.h b/include/sys/zfs_acl.h
  92. index b6ed439..7c3d85e 100644
  93. --- a/include/sys/zfs_acl.h
  94. +++ b/include/sys/zfs_acl.h
  95. @@ -139,7 +139,7 @@ typedef struct acl_ops {
  96.         int             (*ace_mask_off)(void); /* off of access mask in ace */
  97.         int             (*ace_data)(void *acep, void **datap);
  98.                             /* ptr to data if any */
  99. -} acl_ops_t;
  100. +} __attribute__((no_const)) acl_ops_t;
  101.  
  102.  /*
  103.   * A zfs_acl_t structure is composed of a list of zfs_acl_node_t's.
  104.  
  105.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement