diff options
author | Eric Paris <eparis@redhat.com> | 2009-08-07 14:53:57 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-08-09 21:00:39 -0400 |
commit | 47d439e9fb8a81a90022cfa785bf1c36c4e2aff6 (patch) | |
tree | 812ddfa575a58d8db06a3a91aab9bed8dce96420 | |
parent | a2551df7ec568d87793d2eea4ca744e86318f205 (diff) |
security: define round_hint_to_min in !CONFIG_SECURITY
Fix the header files to define round_hint_to_min() and to define
mmap_min_addr_handler() in the !CONFIG_SECURITY case.
Built and tested with !CONFIG_SECURITY
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | include/linux/security.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index 7b431155e392..57ead99d2593 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -121,6 +121,21 @@ struct request_sock; | |||
121 | #define LSM_UNSAFE_PTRACE 2 | 121 | #define LSM_UNSAFE_PTRACE 2 |
122 | #define LSM_UNSAFE_PTRACE_CAP 4 | 122 | #define LSM_UNSAFE_PTRACE_CAP 4 |
123 | 123 | ||
124 | /* | ||
125 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
126 | * low as possible but still greater than mmap_min_addr | ||
127 | */ | ||
128 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
129 | { | ||
130 | hint &= PAGE_MASK; | ||
131 | if (((void *)hint != NULL) && | ||
132 | (hint < mmap_min_addr)) | ||
133 | return PAGE_ALIGN(mmap_min_addr); | ||
134 | return hint; | ||
135 | } | ||
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | ||
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
138 | |||
124 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
125 | 140 | ||
126 | struct security_mnt_opts { | 141 | struct security_mnt_opts { |
@@ -149,21 +164,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
149 | opts->num_mnt_opts = 0; | 164 | opts->num_mnt_opts = 0; |
150 | } | 165 | } |
151 | 166 | ||
152 | /* | ||
153 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
154 | * low as possible but still greater than mmap_min_addr | ||
155 | */ | ||
156 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
157 | { | ||
158 | hint &= PAGE_MASK; | ||
159 | if (((void *)hint != NULL) && | ||
160 | (hint < mmap_min_addr)) | ||
161 | return PAGE_ALIGN(mmap_min_addr); | ||
162 | return hint; | ||
163 | } | ||
164 | |||
165 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | ||
166 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
167 | /** | 167 | /** |
168 | * struct security_operations - main security structure | 168 | * struct security_operations - main security structure |
169 | * | 169 | * |