Patch "netfilter: x_tables: xt_compat_match_from_user doesn't need a retval" has been added to the 3.14-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
netfilter: x_tables: xt_compat_match_from_user doesn't need a retval
to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
netfilter-x_tables-xt_compat_match_from_user-doesn-t-need-a-retval.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
0188346f21e6546498c2a0f84888797ad4063fc5Mon Sep 17 00:00:00 2001
From: Florian Westphal <[email protected]>
Date: Fri, 1 Apr 2016 14:17:33 +0200
Subject: netfilter: x_tables: xt_compat_match_from_user doesn't need a retval
From: Florian Westphal <[email protected]>
commit 0188346f21e6546498c2a0f84888797ad4063fc5 upstream.
Always returned 0.
--- include/linux/netfilter/x_tables.h | 2 +- net/ipv4/netfilter/arp_tables.c | 17 +++++------------ net/ipv4/netfilter/ip_tables.c | 26 +++++++++----------------- net/ipv6/netfilter/ip6_tables.c | 27 +++++++++------------------ net/netfilter/x_tables.c | 5 ++--- 5 files changed, 26 insertions(+), 51 deletions(-)
include/linux/netfilter/x_tables.h +1 -1
@@ -425,7 +425,7 @@ void xt_compat_init_offsets(u_int8_t af,int xt_compat_calc_jump (u_int8_t af,unsigned int offset);int xt_compat_match_offset (const struct xt_match *match); -int xt_compat_match_from_user (struct xt_entry_match *m,void **dstptr, +void xt_compat_match_from_user (struct xt_entry_match *m,void **dstptr,unsigned int *size);int xt_compat_match_to_user (const struct xt_entry_match *m,void __user **dstptr,unsigned int *size);
net/ipv4/netfilter/arp_tables.c +5 -12
@@ -1300,7 +1300,7 @@ out:return ret; } -static int +static void compat_copy_entry_from_user (struct compat_arpt_entry *e,void **dstptr,unsigned int *size,struct xt_table_info *newinfo,unsigned char *base)
@@ -1309,9 +1309,8 @@ compat_copy_entry_from_user(struct compastruct xt_target *target;struct arpt_entry *de;unsigned int origsize; -int ret, h; +int h; - ret =0 ; origsize = *size; de = (struct arpt_entry *)*dstptr;memcpy (de, e,sizeof (struct arpt_entry ));
@@ -1332,7 +1331,6 @@ compat_copy_entry_from_user(struct compaif ((unsigned char *)de - base < newinfo->underflow[h]) newinfo->underflow[h] -= origsize - *size; } -return ret; } static int translate_compat_table(struct xt_table_info **pinfo,
@@ -1411,16 +1409,11 @@ static int translate_compat_table(struct entry1 = newinfo->entries[raw_smp_processor_id ()]; pos = entry1; size = compatr->size; - xt_entry_foreach(iter0, entry0, compatr->size) { - ret =compat_copy_entry_from_user (iter0, &pos, &size, - newinfo, entry1); -if (ret !=0 ) -break ; - } + xt_entry_foreach(iter0, entry0, compatr->size) +compat_copy_entry_from_user (iter0, &pos, &size, + newinfo, entry1);xt_compat_flush_offsets (NFPROTO_ARP );xt_compat_unlock (NFPROTO_ARP ); -if (ret) - goto free_newinfo; ret = -ELOOP ;if (!mark_source_chains (newinfo, compatr->valid_hooks, entry1))
net/ipv4/netfilter/ip_tables.c +9 -17
@@ -1565,7 +1565,7 @@ release_matches:return ret; } -static int +static void compat_copy_entry_from_user (struct compat_ipt_entry *e,void **dstptr,unsigned int *size,struct xt_table_info *newinfo,unsigned char *base)
@@ -1574,10 +1574,9 @@ compat_copy_entry_from_user(struct compastruct xt_target *target;struct ipt_entry *de;unsigned int origsize; -int ret, h; +int h;struct xt_entry_match *ematch; - ret =0 ; origsize = *size; de = (struct ipt_entry *)*dstptr;memcpy (de, e,sizeof (struct ipt_entry ));
@@ -1586,11 +1585,9 @@ compat_copy_entry_from_user(struct compa *dstptr +=sizeof (struct ipt_entry ); *size +=sizeof (struct ipt_entry ) -sizeof (struct compat_ipt_entry ); - xt_ematch_foreach(ematch, e) { - ret =xt_compat_match_from_user (ematch, dstptr, size); -if (ret !=0 ) -return ret; - } + xt_ematch_foreach(ematch, e) +xt_compat_match_from_user (ematch, dstptr, size); + de->target_offset = e->target_offset - (origsize - *size); t =compat_ipt_get_target (e); target = t->u.kernel.target;
@@ -1603,7 +1600,6 @@ compat_copy_entry_from_user(struct compaif ((unsigned char *)de - base < newinfo->underflow[h]) newinfo->underflow[h] -= origsize - *size; } -return ret; } static int
@@ -1719,16 +1715,12 @@ translate_compat_table(struct net *net, entry1 = newinfo->entries[raw_smp_processor_id ()]; pos = entry1; size = compatr->size; - xt_entry_foreach(iter0, entry0, compatr->size) { - ret =compat_copy_entry_from_user (iter0, &pos, &size, - newinfo, entry1); -if (ret !=0 ) -break ; - } + xt_entry_foreach(iter0, entry0, compatr->size) +compat_copy_entry_from_user (iter0, &pos, &size, + newinfo, entry1); +xt_compat_flush_offsets (AF_INET );xt_compat_unlock (AF_INET ); -if (ret) - goto free_newinfo; ret = -ELOOP ;if (!mark_source_chains (newinfo, compatr->valid_hooks, entry1))
net/ipv6/netfilter/ip6_tables.c +9 -18
@@ -1577,7 +1577,7 @@ release_matches:return ret; } -static int +static void compat_copy_entry_from_user (struct compat_ip6t_entry *e,void **dstptr,unsigned int *size,struct xt_table_info *newinfo,unsigned char *base)
@@ -1585,10 +1585,9 @@ compat_copy_entry_from_user(struct compastruct xt_entry_target *t;struct ip6t_entry *de;unsigned int origsize; -int ret, h; +int h;struct xt_entry_match *ematch; - ret =0 ; origsize = *size; de = (struct ip6t_entry *)*dstptr;memcpy (de, e,sizeof (struct ip6t_entry ));
@@ -1597,11 +1596,9 @@ compat_copy_entry_from_user(struct compa *dstptr +=sizeof (struct ip6t_entry ); *size +=sizeof (struct ip6t_entry ) -sizeof (struct compat_ip6t_entry ); - xt_ematch_foreach(ematch, e) { - ret =xt_compat_match_from_user (ematch, dstptr, size); -if (ret !=0 ) -return ret; - } + xt_ematch_foreach(ematch, e) +xt_compat_match_from_user (ematch, dstptr, size); + de->target_offset = e->target_offset - (origsize - *size); t =compat_ip6t_get_target (e);xt_compat_target_from_user (t, dstptr, size);
@@ -1613,7 +1610,6 @@ compat_copy_entry_from_user(struct compaif ((unsigned char *)de - base < newinfo->underflow[h]) newinfo->underflow[h] -= origsize - *size; } -return ret; } static int compat_check_entry(struct ip6t_entry *e, struct net *net,
@@ -1728,17 +1724,12 @@ translate_compat_table(struct net *net, } entry1 = newinfo->entries[raw_smp_processor_id ()]; pos = entry1; - size = compatr->size; - xt_entry_foreach(iter0, entry0, compatr->size) { - ret =compat_copy_entry_from_user (iter0, &pos, &size, - newinfo, entry1); -if (ret !=0 ) -break ; - } + xt_entry_foreach(iter0, entry0, compatr->size) +compat_copy_entry_from_user (iter0, &pos, &size, + newinfo, entry1); +xt_compat_flush_offsets (AF_INET6 );xt_compat_unlock (AF_INET6 ); -if (ret) - goto free_newinfo; ret = -ELOOP ;if (!mark_source_chains (newinfo, compatr->valid_hooks, entry1))
net/netfilter/x_tables.c +2 -3
@@ -545,8 +545,8 @@ int xt_compat_match_offset(const struct }EXPORT_SYMBOL_GPL (xt_compat_match_offset); -int xt_compat_match_from_user (struct xt_entry_match *m,void **dstptr, -unsigned int *size) +void xt_compat_match_from_user (struct xt_entry_match *m,void **dstptr, +unsigned int *size) {const struct xt_match *match = m->u.kernel.match;struct compat_xt_entry_match *cm = (struct compat_xt_entry_match *)m;
@@ -568,7 +568,6 @@ int xt_compat_match_from_user(struct xt_ *size += off; *dstptr += msize; -return 0 ; }EXPORT_SYMBOL_GPL (xt_compat_match_from_user);
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/netfilter-x_tables-validate-targets-of-jumps.patch queue-3.14/netfilter-arp_tables-simplify-translate_compat_table-args.patch queue-3.14/netfilter-x_tables-validate-e-target_offset-early.patch queue-3.14/netfilter-x_tables-assert-minimum-target-size.patch queue-3.14/netfilter-ip6_tables-simplify-translate_compat_table-args.patch queue-3.14/netfilter-x_tables-check-for-bogus-target-offset.patch queue-3.14/netfilter-x_tables-add-compat-version-of-xt_check_entry_offsets.patch queue-3.14/netfilter-x_tables-don-t-reject-valid-target-size-on-some-architectures.patch queue-3.14/netfilter-x_tables-check-standard-target-size-too.patch queue-3.14/netfilter-x_tables-xt_compat_match_from_user-doesn-t-need-a-retval.patch queue-3.14/netfilter-x_tables-do-compat-validation-via-translate_table.patch queue-3.14/netfilter-x_tables-add-and-use-xt_check_entry_offsets.patch queue-3.14/netfilter-x_tables-don-t-move-to-non-existent-next-rule.patch queue-3.14/netfilter-x_tables-kill-check_entry-helper.patch queue-3.14/netfilter-x_tables-validate-all-offsets-and-sizes-in-a-rule.patch queue-3.14/netfilter-x_tables-make-sure-e-next_offset-covers-remaining-blob-size.patch queue-3.14/netfilter-ip_tables-simplify-translate_compat_table-args.patch queue-3.14/netfilter-x_tables-fix-unconditional-helper.patch