linux/include
Xin Long 707cd7de3f sctp: fix the check for _sctp_walk_params and _sctp_walk_errors
commit 6b84202c94 upstream.

Commit b1f5bfc27a ("sctp: don't dereference ptr before leaving
_sctp_walk_{params, errors}()") tried to fix the issue that it
may overstep the chunk end for _sctp_walk_{params, errors} with
'chunk_end > offset(length) + sizeof(length)'.

But it introduced a side effect: When processing INIT, it verifies
the chunks with 'param.v == chunk_end' after iterating all params
by sctp_walk_params(). With the check 'chunk_end > offset(length)
+ sizeof(length)', it would return when the last param is not yet
accessed. Because the last param usually is fwdtsn supported param
whose size is 4 and 'chunk_end == offset(length) + sizeof(length)'

This is a badly issue even causing sctp couldn't process 4-shakes.
Client would always get abort when connecting to server, due to
the failure of INIT chunk verification on server.

The patch is to use 'chunk_end <= offset(length) + sizeof(length)'
instead of 'chunk_end < offset(length) + sizeof(length)' for both
_sctp_walk_params and _sctp_walk_errors.

Fixes: b1f5bfc27a ("sctp: don't dereference ptr before leaving _sctp_walk_{params, errors}()")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-11-11 13:33:09 +00:00
..
acpi ACPICA: Tables: Enable default 64-bit FADT addresses favor 2015-07-15 10:01:11 +01:00
asm-generic asm-generic: make get_user() clear the destination on errors 2016-11-20 01:17:26 +00:00
clocksource drivers: clocksource: add support for ARM architected timer event stream 2013-09-26 09:48:00 +01:00
crypto crypto: ahash - Fix EINPROGRESS notification callback 2017-06-05 21:17:22 +01:00
drm drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces 2017-07-18 18:40:26 +01:00
dt-bindings pinctrl: dra: dt-bindings: Fix output pull up/down 2014-11-27 11:22:05 +00:00
keys KEYS: Separate the kernel signature checking keyring from module signing 2013-09-25 17:17:01 +01:00
kvm arm/arm64: KVM: Require in-kernel vgic for the arch timers 2015-05-20 13:25:52 +01:00
linux workqueue: implicit ordered attribute should be overridable 2017-11-11 13:33:08 +00:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media media: vb2: fix VBI/poll regression 2014-10-09 12:23:49 -07:00
memory ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
misc [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
net sctp: fix the check for _sctp_walk_params and _sctp_walk_errors 2017-11-11 13:33:09 +00:00
pcmcia pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 2013-03-15 12:26:03 -07:00
ras edac: add support for error type "Info" 2013-02-21 14:16:27 -03:00
rdma IB/cma: Fix reference count leak when no ipv4 addresses are set 2017-11-11 13:33:05 +00:00
rxrpc atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state 2017-10-12 15:27:58 +01:00
sound ALSA: rawmidi: Make snd_rawmidi_transmit() race-free 2016-02-25 00:18:43 +00:00
target target: Make EXTENDED_COPY 0xe4 failure return COPY TARGET DEVICE NOT REACHABLE 2017-02-23 03:54:18 +00:00
trace tracing: Add #undef to fix compile error 2017-07-18 18:40:06 +01:00
uapi v4l2-dv-timings.h: fix polarity for 4k formats 2017-10-12 15:28:16 +01:00
video Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-06-12 11:32:30 -07:00
xen xen: Add RING_COPY_REQUEST() 2016-01-25 10:43:42 +00:00
Kbuild UAPI: remove empty Kbuild files 2013-04-30 17:04:09 -07:00