diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-06-26 02:23:19 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-02-15 10:59:28 -0500 |
commit | 739674fb7febf116e7d647031fab16989a08a965 (patch) | |
tree | b2b0bcde6aa93dfc7a9811da7805affcef225a2a | |
parent | b402405d71beed8e4df354844353f66b4e18269f (diff) |
netfilter: xtables: constify args in compat copying functions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r-- | include/linux/netfilter/x_tables.h | 12 | ||||
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 4 | ||||
-rw-r--r-- | net/netfilter/x_tables.c | 8 | ||||
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 4 | ||||
-rw-r--r-- | net/netfilter/xt_limit.c | 4 |
8 files changed, 22 insertions, 22 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index a0a144a6c6d9..c61758f4be31 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -286,8 +286,8 @@ struct xt_match { | |||
286 | void (*destroy)(const struct xt_mtdtor_param *); | 286 | void (*destroy)(const struct xt_mtdtor_param *); |
287 | #ifdef CONFIG_COMPAT | 287 | #ifdef CONFIG_COMPAT |
288 | /* Called when userspace align differs from kernel space one */ | 288 | /* Called when userspace align differs from kernel space one */ |
289 | void (*compat_from_user)(void *dst, void *src); | 289 | void (*compat_from_user)(void *dst, const void *src); |
290 | int (*compat_to_user)(void __user *dst, void *src); | 290 | int (*compat_to_user)(void __user *dst, const void *src); |
291 | #endif | 291 | #endif |
292 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 292 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
293 | struct module *me; | 293 | struct module *me; |
@@ -328,8 +328,8 @@ struct xt_target { | |||
328 | void (*destroy)(const struct xt_tgdtor_param *); | 328 | void (*destroy)(const struct xt_tgdtor_param *); |
329 | #ifdef CONFIG_COMPAT | 329 | #ifdef CONFIG_COMPAT |
330 | /* Called when userspace align differs from kernel space one */ | 330 | /* Called when userspace align differs from kernel space one */ |
331 | void (*compat_from_user)(void *dst, void *src); | 331 | void (*compat_from_user)(void *dst, const void *src); |
332 | int (*compat_to_user)(void __user *dst, void *src); | 332 | int (*compat_to_user)(void __user *dst, const void *src); |
333 | #endif | 333 | #endif |
334 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 334 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
335 | struct module *me; | 335 | struct module *me; |
@@ -593,13 +593,13 @@ extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); | |||
593 | extern int xt_compat_match_offset(const struct xt_match *match); | 593 | extern int xt_compat_match_offset(const struct xt_match *match); |
594 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 594 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
595 | void **dstptr, unsigned int *size); | 595 | void **dstptr, unsigned int *size); |
596 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 596 | extern int xt_compat_match_to_user(const struct xt_entry_match *m, |
597 | void __user **dstptr, unsigned int *size); | 597 | void __user **dstptr, unsigned int *size); |
598 | 598 | ||
599 | extern int xt_compat_target_offset(const struct xt_target *target); | 599 | extern int xt_compat_target_offset(const struct xt_target *target); |
600 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | 600 | extern void xt_compat_target_from_user(struct xt_entry_target *t, |
601 | void **dstptr, unsigned int *size); | 601 | void **dstptr, unsigned int *size); |
602 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | 602 | extern int xt_compat_target_to_user(const struct xt_entry_target *t, |
603 | void __user **dstptr, unsigned int *size); | 603 | void __user **dstptr, unsigned int *size); |
604 | 604 | ||
605 | #endif /* CONFIG_COMPAT */ | 605 | #endif /* CONFIG_COMPAT */ |
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 72723ea1054b..2303dc92a277 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -842,7 +842,7 @@ static int copy_entries_to_user(unsigned int total_size, | |||
842 | } | 842 | } |
843 | 843 | ||
844 | #ifdef CONFIG_COMPAT | 844 | #ifdef CONFIG_COMPAT |
845 | static void compat_standard_from_user(void *dst, void *src) | 845 | static void compat_standard_from_user(void *dst, const void *src) |
846 | { | 846 | { |
847 | int v = *(compat_int_t *)src; | 847 | int v = *(compat_int_t *)src; |
848 | 848 | ||
@@ -851,7 +851,7 @@ static void compat_standard_from_user(void *dst, void *src) | |||
851 | memcpy(dst, &v, sizeof(v)); | 851 | memcpy(dst, &v, sizeof(v)); |
852 | } | 852 | } |
853 | 853 | ||
854 | static int compat_standard_to_user(void __user *dst, void *src) | 854 | static int compat_standard_to_user(void __user *dst, const void *src) |
855 | { | 855 | { |
856 | compat_int_t cv = *(int *)src; | 856 | compat_int_t cv = *(int *)src; |
857 | 857 | ||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 2057b1bb6178..2a4f745ce36e 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1047,7 +1047,7 @@ copy_entries_to_user(unsigned int total_size, | |||
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | #ifdef CONFIG_COMPAT | 1049 | #ifdef CONFIG_COMPAT |
1050 | static void compat_standard_from_user(void *dst, void *src) | 1050 | static void compat_standard_from_user(void *dst, const void *src) |
1051 | { | 1051 | { |
1052 | int v = *(compat_int_t *)src; | 1052 | int v = *(compat_int_t *)src; |
1053 | 1053 | ||
@@ -1056,7 +1056,7 @@ static void compat_standard_from_user(void *dst, void *src) | |||
1056 | memcpy(dst, &v, sizeof(v)); | 1056 | memcpy(dst, &v, sizeof(v)); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | static int compat_standard_to_user(void __user *dst, void *src) | 1059 | static int compat_standard_to_user(void __user *dst, const void *src) |
1060 | { | 1060 | { |
1061 | compat_int_t cv = *(int *)src; | 1061 | compat_int_t cv = *(int *)src; |
1062 | 1062 | ||
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 399061c3fd7d..09a5d3f7cc41 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -338,7 +338,7 @@ struct compat_ipt_ulog_info { | |||
338 | char prefix[ULOG_PREFIX_LEN]; | 338 | char prefix[ULOG_PREFIX_LEN]; |
339 | }; | 339 | }; |
340 | 340 | ||
341 | static void ulog_tg_compat_from_user(void *dst, void *src) | 341 | static void ulog_tg_compat_from_user(void *dst, const void *src) |
342 | { | 342 | { |
343 | const struct compat_ipt_ulog_info *cl = src; | 343 | const struct compat_ipt_ulog_info *cl = src; |
344 | struct ipt_ulog_info l = { | 344 | struct ipt_ulog_info l = { |
@@ -351,7 +351,7 @@ static void ulog_tg_compat_from_user(void *dst, void *src) | |||
351 | memcpy(dst, &l, sizeof(l)); | 351 | memcpy(dst, &l, sizeof(l)); |
352 | } | 352 | } |
353 | 353 | ||
354 | static int ulog_tg_compat_to_user(void __user *dst, void *src) | 354 | static int ulog_tg_compat_to_user(void __user *dst, const void *src) |
355 | { | 355 | { |
356 | const struct ipt_ulog_info *l = src; | 356 | const struct ipt_ulog_info *l = src; |
357 | struct compat_ipt_ulog_info cl = { | 357 | struct compat_ipt_ulog_info cl = { |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index dcd7825fe7b6..3ff4fd50e96e 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1079,7 +1079,7 @@ copy_entries_to_user(unsigned int total_size, | |||
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | #ifdef CONFIG_COMPAT | 1081 | #ifdef CONFIG_COMPAT |
1082 | static void compat_standard_from_user(void *dst, void *src) | 1082 | static void compat_standard_from_user(void *dst, const void *src) |
1083 | { | 1083 | { |
1084 | int v = *(compat_int_t *)src; | 1084 | int v = *(compat_int_t *)src; |
1085 | 1085 | ||
@@ -1088,7 +1088,7 @@ static void compat_standard_from_user(void *dst, void *src) | |||
1088 | memcpy(dst, &v, sizeof(v)); | 1088 | memcpy(dst, &v, sizeof(v)); |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | static int compat_standard_to_user(void __user *dst, void *src) | 1091 | static int compat_standard_to_user(void __user *dst, const void *src) |
1092 | { | 1092 | { |
1093 | compat_int_t cv = *(int *)src; | 1093 | compat_int_t cv = *(int *)src; |
1094 | 1094 | ||
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 12503199826f..69c56287d518 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -485,8 +485,8 @@ int xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, | |||
485 | } | 485 | } |
486 | EXPORT_SYMBOL_GPL(xt_compat_match_from_user); | 486 | EXPORT_SYMBOL_GPL(xt_compat_match_from_user); |
487 | 487 | ||
488 | int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr, | 488 | int xt_compat_match_to_user(const struct xt_entry_match *m, |
489 | unsigned int *size) | 489 | void __user **dstptr, unsigned int *size) |
490 | { | 490 | { |
491 | const struct xt_match *match = m->u.kernel.match; | 491 | const struct xt_match *match = m->u.kernel.match; |
492 | struct compat_xt_entry_match __user *cm = *dstptr; | 492 | struct compat_xt_entry_match __user *cm = *dstptr; |
@@ -588,8 +588,8 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, | |||
588 | } | 588 | } |
589 | EXPORT_SYMBOL_GPL(xt_compat_target_from_user); | 589 | EXPORT_SYMBOL_GPL(xt_compat_target_from_user); |
590 | 590 | ||
591 | int xt_compat_target_to_user(struct xt_entry_target *t, void __user **dstptr, | 591 | int xt_compat_target_to_user(const struct xt_entry_target *t, |
592 | unsigned int *size) | 592 | void __user **dstptr, unsigned int *size) |
593 | { | 593 | { |
594 | const struct xt_target *target = t->u.kernel.target; | 594 | const struct xt_target *target = t->u.kernel.target; |
595 | struct compat_xt_entry_target __user *ct = *dstptr; | 595 | struct compat_xt_entry_target __user *ct = *dstptr; |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 017c95966aa8..e47fb805ffb4 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -775,7 +775,7 @@ struct compat_xt_hashlimit_info { | |||
775 | compat_uptr_t master; | 775 | compat_uptr_t master; |
776 | }; | 776 | }; |
777 | 777 | ||
778 | static void hashlimit_mt_compat_from_user(void *dst, void *src) | 778 | static void hashlimit_mt_compat_from_user(void *dst, const void *src) |
779 | { | 779 | { |
780 | int off = offsetof(struct compat_xt_hashlimit_info, hinfo); | 780 | int off = offsetof(struct compat_xt_hashlimit_info, hinfo); |
781 | 781 | ||
@@ -783,7 +783,7 @@ static void hashlimit_mt_compat_from_user(void *dst, void *src) | |||
783 | memset(dst + off, 0, sizeof(struct compat_xt_hashlimit_info) - off); | 783 | memset(dst + off, 0, sizeof(struct compat_xt_hashlimit_info) - off); |
784 | } | 784 | } |
785 | 785 | ||
786 | static int hashlimit_mt_compat_to_user(void __user *dst, void *src) | 786 | static int hashlimit_mt_compat_to_user(void __user *dst, const void *src) |
787 | { | 787 | { |
788 | int off = offsetof(struct compat_xt_hashlimit_info, hinfo); | 788 | int off = offsetof(struct compat_xt_hashlimit_info, hinfo); |
789 | 789 | ||
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index 2773be6a71dd..a0ca5339af41 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c | |||
@@ -148,7 +148,7 @@ struct compat_xt_rateinfo { | |||
148 | 148 | ||
149 | /* To keep the full "prev" timestamp, the upper 32 bits are stored in the | 149 | /* To keep the full "prev" timestamp, the upper 32 bits are stored in the |
150 | * master pointer, which does not need to be preserved. */ | 150 | * master pointer, which does not need to be preserved. */ |
151 | static void limit_mt_compat_from_user(void *dst, void *src) | 151 | static void limit_mt_compat_from_user(void *dst, const void *src) |
152 | { | 152 | { |
153 | const struct compat_xt_rateinfo *cm = src; | 153 | const struct compat_xt_rateinfo *cm = src; |
154 | struct xt_rateinfo m = { | 154 | struct xt_rateinfo m = { |
@@ -162,7 +162,7 @@ static void limit_mt_compat_from_user(void *dst, void *src) | |||
162 | memcpy(dst, &m, sizeof(m)); | 162 | memcpy(dst, &m, sizeof(m)); |
163 | } | 163 | } |
164 | 164 | ||
165 | static int limit_mt_compat_to_user(void __user *dst, void *src) | 165 | static int limit_mt_compat_to_user(void __user *dst, const void *src) |
166 | { | 166 | { |
167 | const struct xt_rateinfo *m = src; | 167 | const struct xt_rateinfo *m = src; |
168 | struct compat_xt_rateinfo cm = { | 168 | struct compat_xt_rateinfo cm = { |