android_kernel_xiaomi_sm8350/net
Patrick McHardy 46c5ea3c9a [NETFILTER] x_tables: fix compat related crash on non-x86
When iptables userspace adds an ipt_standard_target, it calculates the size
of the entire entry as:

sizeof(struct ipt_entry) + XT_ALIGN(sizeof(struct ipt_standard_target))

ipt_standard_target looks like this:

  struct xt_standard_target
  {
        struct xt_entry_target target;
        int verdict;
  };

xt_entry_target contains a pointer, so when compiled for 64 bit the
structure gets an extra 4 byte of padding at the end. On 32 bit
architectures where iptables aligns to 8 byte it will also have 4
byte padding at the end because it is only 36 bytes large.

The compat_ipt_standard_fn in the kernel adjusts the offsets by

  sizeof(struct ipt_standard_target) - sizeof(struct compat_ipt_standard_target),

which will always result in 4, even if the structure from userspace
was already padded to a multiple of 8. On x86 this works out by
accident because userspace only aligns to 4, on all other
architectures this is broken and causes incorrect adjustments to
the size and following offsets.

Thanks to Linus for lots of debugging help and testing.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-05-01 20:48:32 -07:00
..
802 [SNAP]: Remove leftover unused hdr variable 2006-03-20 22:45:37 -08:00
8021q [NET]: Replace skb_pull/skb_postpull_rcsum with skb_pull_rcsum 2006-03-20 22:43:56 -08:00
appletalk [NET]: Fix ipx/econet/appletalk/irda ioctl crashes 2006-03-28 17:02:43 -08:00
atm [ATM] clip: add module info 2006-04-14 16:01:26 -07:00
ax25 [AX.25]: Fix potencial memory hole. 2006-03-19 13:20:06 -08:00
bluetooth [BLUETOOTH] sco: Possible double free. 2006-04-09 22:25:29 -07:00
bridge [BRIDGE]: allow full size vlan packets 2006-04-26 02:39:19 -07:00
core Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2006-04-20 15:26:25 -07:00
dccp [DCCP]: Fix leak in net/dccp/ipv4.c 2006-04-11 17:21:06 -07:00
decnet [DECNET]: Fix refcount 2006-03-29 13:57:31 -08:00
econet [ECONET]: Convert away from SOCKOPS_WRAPPED 2006-03-28 17:02:43 -08:00
ethernet [NET] ethernet: Fix first packet goes out with MAC 00:00:00:00:00:00 2006-02-23 16:18:01 -08:00
ieee80211 [PATCH] softmac: fix SIOCSIWAP 2006-04-24 15:20:23 -04:00
ipv4 [NETFILTER] x_tables: fix compat related crash on non-x86 2006-05-01 20:48:32 -07:00
ipv6 [IPV6]: Fix race in route selection. 2006-04-29 18:33:22 -07:00
ipx [NET]: Fix ipx/econet/appletalk/irda ioctl crashes 2006-03-28 17:02:43 -08:00
irda [NET]: Fix ipx/econet/appletalk/irda ioctl crashes 2006-03-28 17:02:43 -08:00
key [NET] sem2mutex: net/ 2006-03-20 22:33:17 -08:00
lapb
llc [LLC]: Use pskb_trim_rcsum() in llc_fixup_skb(). 2006-04-19 15:37:13 -07:00
netfilter [NETFILTER]: x_tables: move table->lock initialization 2006-04-24 17:27:33 -07:00
netlink [NETLINK]: cleanup unused macro in net/netlink/af_netlink.c 2006-04-29 18:33:13 -07:00
netrom [PATCH] capable/capability.h (net/) 2006-01-11 18:42:14 -08:00
packet [NET]: Fix some whitespace issues in af_packet.c 2006-01-23 16:28:02 -08:00
rose [PATCH] capable/capability.h (net/) 2006-01-11 18:42:14 -08:00
rxrpc [PATCH] fix 'defined but not used' warning in net/rxrpc/main.c::rxrpc_initialise 2006-03-25 08:22:52 -08:00
sched [PKT_SCHED] netem: fix loss 2006-04-29 18:33:12 -07:00
sctp [PATCH] for_each_possible_cpu: network codes 2006-04-11 06:18:31 -07:00
sunrpc SUNRPC: Dead code in net/sunrpc/auth_gss/auth_gss.c 2006-04-19 13:06:49 -04:00
tipc [NET]: Remove redundant NULL checks before [kv]free 2006-04-18 15:57:55 -07:00
unix [PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications 2006-03-25 08:22:56 -08:00
wanrouter [WAN]: Remove broken and unmaintained Sangoma drivers. 2006-04-11 17:28:33 -07:00
x25 [X25]: fix for spinlock recurse and spinlock lockup with timer handler 2006-04-29 18:33:11 -07:00
xfrm [XFRM]: fix incorrect xfrm_policy_afinfo_lock use 2006-04-29 18:33:21 -07:00
compat.c [NETFILTER]: iptables 32bit compat layer 2006-04-01 02:25:19 -08:00
Kconfig Merge branch 'master' 2006-02-07 01:47:12 -05:00
Makefile [TIPC] Initial merge 2006-01-12 14:06:31 -08:00
nonet.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
socket.c [NET]: sockfd_lookup_light() returns random error for -EBADFD 2006-04-19 15:25:02 -07:00
sysctl_net.c
TUNABLE