Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150117803
D55702.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55702.diff
View Options
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c
--- a/sys/security/mac/mac_framework.c
+++ b/sys/security/mac/mac_framework.c
@@ -417,7 +417,7 @@
* policies. Gross hack below enables doing it in a cheap manner.
*/
-#define FPO(f) (offsetof(struct mac_policy_ops, mpo_##f) / sizeof(uintptr_t))
+#define FPO(f) (offsetof(struct mac_policy_ops, mpo_##f) / sizeof(void *))
struct mac_policy_fastpath_elem {
int count;
@@ -488,12 +488,12 @@
mac_policy_fastpath_register(struct mac_policy_conf *mpc)
{
struct mac_policy_fastpath_elem *mpfe;
- uintptr_t **ops;
+ const void * const *ops;
int i;
mac_policy_xlock_assert();
- ops = (uintptr_t **)mpc->mpc_ops;
+ ops = (const void * const *)mpc->mpc_ops;
for (i = 0; i < nitems(mac_policy_fastpath_array); i++) {
mpfe = &mac_policy_fastpath_array[i];
if (ops[mpfe->offset] != NULL)
@@ -505,12 +505,12 @@
mac_policy_fastpath_unregister(struct mac_policy_conf *mpc)
{
struct mac_policy_fastpath_elem *mpfe;
- uintptr_t **ops;
+ const void * const *ops;
int i;
mac_policy_xlock_assert();
- ops = (uintptr_t **)mpc->mpc_ops;
+ ops = (const void * const *)mpc->mpc_ops;
for (i = 0; i < nitems(mac_policy_fastpath_array); i++) {
mpfe = &mac_policy_fastpath_array[i];
if (ops[mpfe->offset] != NULL)
diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h
--- a/sys/security/mac/mac_policy.h
+++ b/sys/security/mac/mac_policy.h
@@ -1070,9 +1070,9 @@
* structure, as its layout is statically compiled into all policies.
*/
struct mac_policy_conf {
- char *mpc_name; /* policy name */
- char *mpc_fullname; /* policy full name */
- struct mac_policy_ops *mpc_ops; /* policy operations */
+ const char *mpc_name; /* policy name */
+ const char *mpc_fullname; /* policy full name */
+ const struct mac_policy_ops *mpc_ops; /* policy operations */
int mpc_loadtime_flags; /* flags */
int *mpc_field_off; /* security field */
int mpc_runtime_flags; /* flags */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 12:57 PM (19 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30587560
Default Alt Text
D55702.diff (1 KB)
Attached To
Mode
D55702: kern: mac: sprinkle a bit of const correctness
Attached
Detach File
Event Timeline
Log In to Comment