Patch "netfilter: x_tables: make sure e->next_offset covers remaining blob size" 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: make sure e->next_offset covers remaining blob size
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-make-sure-e-next_offset-covers-remaining-blob-size.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
6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91Mon Sep 17 00:00:00 2001
From: Florian Westphal <[email protected]>
Date: Tue, 22 Mar 2016 18:02:50 +0100
Subject: netfilter: x_tables: make sure e->next_offset covers remaining blob size
From: Florian Westphal <[email protected]>
commit 6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91 upstream.
Otherwise this function may read data beyond the ruleset blob.
--- net/ipv4/netfilter/arp_tables.c | 6 ++++-- net/ipv4/netfilter/ip_tables.c | 6 ++++-- net/ipv6/netfilter/ip6_tables.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-)
net/ipv4/netfilter/arp_tables.c +4 -2
@@ -568,7 +568,8 @@ static inline int check_entry_size_and_hunsigned int h;if ((unsigned long )e % __alignof__(struct arpt_entry ) !=0 || - (unsigned char *)e +sizeof (struct arpt_entry ) >= limit) { + (unsigned char *)e +sizeof (struct arpt_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p\n" , e);return -EINVAL ; }
@@ -1224,7 +1225,8 @@ check_compat_entry_size_and_hooks(structduprintf ("check_compat_entry_size_and_hooks %p\n" , e);if ((unsigned long )e % __alignof__(struct compat_arpt_entry ) !=0 || - (unsigned char *)e +sizeof (struct compat_arpt_entry ) >= limit) { + (unsigned char *)e +sizeof (struct compat_arpt_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p, limit = %p\n" , e, limit);return -EINVAL ; }
net/ipv4/netfilter/ip_tables.c +4 -2
@@ -731,7 +731,8 @@ check_entry_size_and_hooks(struct ipt_enunsigned int h;if ((unsigned long )e % __alignof__(struct ipt_entry ) !=0 || - (unsigned char *)e +sizeof (struct ipt_entry ) >= limit) { + (unsigned char *)e +sizeof (struct ipt_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p\n" , e);return -EINVAL ; }
@@ -1490,7 +1491,8 @@ check_compat_entry_size_and_hooks(structduprintf ("check_compat_entry_size_and_hooks %p\n" , e);if ((unsigned long )e % __alignof__(struct compat_ipt_entry ) !=0 || - (unsigned char *)e +sizeof (struct compat_ipt_entry ) >= limit) { + (unsigned char *)e +sizeof (struct compat_ipt_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p, limit = %p\n" , e, limit);return -EINVAL ; }
net/ipv6/netfilter/ip6_tables.c +4 -2
@@ -742,7 +742,8 @@ check_entry_size_and_hooks(struct ip6t_eunsigned int h;if ((unsigned long )e % __alignof__(struct ip6t_entry ) !=0 || - (unsigned char *)e +sizeof (struct ip6t_entry ) >= limit) { + (unsigned char *)e +sizeof (struct ip6t_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p\n" , e);return -EINVAL ; }
@@ -1502,7 +1503,8 @@ check_compat_entry_size_and_hooks(structduprintf ("check_compat_entry_size_and_hooks %p\n" , e);if ((unsigned long )e % __alignof__(struct compat_ip6t_entry ) !=0 || - (unsigned char *)e +sizeof (struct compat_ip6t_entry ) >= limit) { + (unsigned char *)e +sizeof (struct compat_ip6t_entry ) >= limit || + (unsigned char *)e + e->next_offset > limit) {duprintf ("Bad offset %p, limit = %p\n" , e, limit);return -EINVAL ; }
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/netfilter-x_tables-make-sure-e-next_offset-covers-remaining-blob-size.patch queue-3.14/netfilter-x_tables-fix-unconditional-helper.patch