Merge "netfilter: x_tables: make sure e->next_offset covers remaining blob size"
This commit is contained in:
commit
719ab54868
|
@ -568,7 +568,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
|
|||
unsigned 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(struct compat_arpt_entry *e,
|
|||
|
||||
duprintf("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;
|
||||
}
|
||||
|
|
|
@ -730,7 +730,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
|
|||
unsigned 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;
|
||||
}
|
||||
|
@ -1489,7 +1490,8 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
|
|||
|
||||
duprintf("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;
|
||||
}
|
||||
|
|
|
@ -741,7 +741,8 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
|
|||
unsigned 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;
|
||||
}
|
||||
|
@ -1501,7 +1502,8 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
|
|||
|
||||
duprintf("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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue