Advertisement
arter97

Untitled

Jan 9th, 2024
1,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.61 KB | None | 0 0
  1. diff --git a/kernel/selinux/sepolicy.c b/kernel/selinux/sepolicy.c
  2. index fd40cd2..69697ba 100644
  3. --- a/kernel/selinux/sepolicy.c
  4. +++ b/kernel/selinux/sepolicy.c
  5. @@ -80,7 +80,7 @@ static bool add_typeattribute(struct policydb *db, const char *type,
  6.  
  7.  // htable is a struct instead of pointer above 5.8.0:
  8.  // https://elixir.bootlin.com/linux/v5.8-rc1/source/security/selinux/ss/symtab.h
  9. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
  10. +#if 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
  11.  #define ksu_hashtab_for_each(htab, cur)                                        \
  12.     ksu_hash_for_each(htab.htable, htab.size, cur)
  13.  #else
  14. @@ -90,7 +90,7 @@ static bool add_typeattribute(struct policydb *db, const char *type,
  15.  
  16.  // symtab_search is introduced on 5.9.0:
  17.  // https://elixir.bootlin.com/linux/v5.9-rc1/source/security/selinux/ss/symtab.h
  18. -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
  19. +#if 0 // LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
  20.  #define symtab_search(s, name) hashtab_search((s)->table, name)
  21.  #define symtab_insert(s, name, datum) hashtab_insert((s)->table, name, datum)
  22.  #endif
  23. @@ -468,7 +468,7 @@ static bool add_type_rule(struct policydb *db, const char *s, const char *t,
  24.  // 5.9.0 : static inline int hashtab_insert(struct hashtab *h, void *key, void
  25.  // *datum, struct hashtab_key_params key_params) 5.8.0: int
  26.  // hashtab_insert(struct hashtab *h, void *k, void *d);
  27. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
  28. +#if 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
  29.  static u32 filenametr_hash(const void *k)
  30.  {
  31.     const struct filename_trans_key *ft = k;
  32. @@ -535,7 +535,7 @@ static bool add_filename_trans(struct policydb *db, const char *s,
  33.         return false;
  34.     }
  35.  
  36. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
  37. +#if 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
  38.     struct filename_trans_key key;
  39.     key.ttype = tgt->value;
  40.     key.tclass = cls->value;
  41. @@ -543,7 +543,7 @@ static bool add_filename_trans(struct policydb *db, const char *s,
  42.  
  43.     struct filename_trans_datum *last = NULL;
  44.  
  45. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
  46. +#if 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
  47.     struct filename_trans_datum *trans =
  48.         policydb_filenametr_search(db, &key);
  49.  #else
  50. @@ -651,7 +651,7 @@ static bool add_type(struct policydb *db, const char *type_name, bool attr)
  51.         return false;
  52.     }
  53.  
  54. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
  55. +#if 1 //LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
  56.     size_t new_size = sizeof(struct ebitmap) * db->p_types.nprim;
  57.     struct ebitmap *new_type_attr_map_array =
  58.         (krealloc(db->type_attr_map_array, new_size, GFP_ATOMIC));
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement