remarkable-linux/net
Subash Abhinov Kasiviswanathan e0a1cec3db netfilter: ipv6: nf_defrag: Pass on packets to stack per RFC2460
[ Upstream commit 83f1999cae ]

ipv6_defrag pulls network headers before fragment header. In case of
an error, the netfilter layer is currently dropping these packets.
This results in failure of some IPv6 standards tests which passed on
older kernels due to the netfilter framework using cloning.

The test case run here is a check for ICMPv6 error message replies
when some invalid IPv6 fragments are sent. This specific test case is
listed in https://www.ipv6ready.org/docs/Core_Conformance_Latest.pdf
in the Extension Header Processing Order section.

A packet with unrecognized option Type 11 is sent and the test expects
an ICMP error in line with RFC2460 section 4.2 -

11 - discard the packet and, only if the packet's Destination
     Address was not a multicast address, send an ICMP Parameter
     Problem, Code 2, message to the packet's Source Address,
     pointing to the unrecognized Option Type.

Since netfilter layer now drops all invalid IPv6 frag packets, we no
longer see the ICMP error message and fail the test case.

To fix this, save the transport header. If defrag is unable to process
the packet due to RFC2460, restore the transport header and allow packet
to be processed by stack. There is no change for other packet
processing paths.

Tested by confirming that stack sends an ICMP error when it receives
these packets. Also tested that fragmented ICMP pings succeed.

v1->v2: Instead of cloning always, save the transport_header and
restore it in case of this specific error. Update the title and
commit message accordingly.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26 11:02:04 +02:00
..
6lowpan
9p 9p/trans_virtio: discard zero-length reply 2018-02-22 15:42:30 +01:00
802
8021q vlan: also check phy_driver ts_info for vlan's real device 2018-04-12 12:32:24 +02:00
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Fix connection if directed advertising and privacy is used 2018-04-19 08:56:19 +02:00
bpf
bridge netfilter: bridge: ebt_among: add more missing match size checks 2018-04-08 14:26:29 +02:00
caif
can
ceph
core net: fool proof dev_valid_name() 2018-04-12 12:32:25 +02:00
dcb
dccp dccp: check sk for closed state in dccp_sendmsg() 2018-03-31 18:10:40 +02:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-02-25 11:07:52 +01:00
dns_resolver
dsa net: dsa: Discard frames from unused ports 2018-04-24 09:36:39 +02:00
ethernet
hsr
ieee802154 ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event() 2018-03-31 18:10:40 +02:00
ife
ipv4 route: check sysctl_fib_multipath_use_neigh earlier than hash 2018-04-12 12:32:27 +02:00
ipv6 netfilter: ipv6: nf_defrag: Pass on packets to stack per RFC2460 2018-04-26 11:02:04 +02:00
ipx
iucv net/iucv: Free memory obtained by kzalloc 2018-03-31 18:10:41 +02:00
kcm kcm: lock lower socket in kcm_attach 2018-03-31 18:10:40 +02:00
key
l2tp l2tp: fix missing print session offset info 2018-04-12 12:32:12 +02:00
l3mdev
lapb
llc
mac80211 mac80211: Fix setting TX power on monitor interfaces 2018-04-12 12:32:15 +02:00
mac802154
mpls mpls, nospec: Sanitize array index in mpls_label_ok() 2018-02-22 15:42:28 +01:00
ncsi
netfilter netfilter: ipset: Missing nfnl_lock()/nfnl_unlock() is added to ip_set_net_exit() 2018-04-19 08:56:15 +02:00
netlabel
netlink netlink: make sure nladdr has correct size in netlink_connect() 2018-04-12 12:32:23 +02:00
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds rds: MP-RDS may use an invalid c_path 2018-04-19 08:56:15 +02:00
rfkill
rose
rxrpc rxrpc: Fix send in rxrpc_send_data_packet() 2018-03-08 22:41:12 -08:00
sched net/sched: fix NULL dereference on the error path of tcf_skbmod_init() 2018-04-12 12:32:26 +02:00
sctp sctp: sctp_sockaddr_af must check minimal addr length for AF_INET6 2018-04-12 12:32:24 +02:00
smc net/smc: fix NULL pointer dereference on sock_create_kern() error path 2018-03-15 10:54:28 +01:00
strparser strparser: Fix sign of err codes 2018-04-12 12:32:26 +02:00
sunrpc rpc_pipefs: fix double-dput() 2018-04-24 09:36:38 +02:00
switchdev
tipc tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path 2018-03-03 10:24:30 +01:00
tls
unix
vmw_vsock VSOCK: fix outdated sk_state value in hvs_release() 2018-02-25 11:07:59 +01:00
wimax
wireless nl80211: Check for the required netlink attribute presence 2018-03-03 10:24:34 +01:00
x25
xfrm xfrm: Refuse to insert 32 bit userspace socket policies on 64 bit systems 2018-04-08 14:26:29 +02:00
compat.c
Kconfig
Makefile
socket.c kmemcheck: remove annotations 2018-02-22 15:42:23 +01:00
sysctl_net.c