]> git.baikalelectronics.ru Git - kernel.git/commit
brcmfmac: Don't grow SKB by negative size
authorDaniel Stone <daniels@collabora.com>
Wed, 26 Jul 2017 11:24:10 +0000 (12:24 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Jul 2017 11:02:16 +0000 (14:02 +0300)
commit038a4520e2b6ba8045ec207e82b47c94add4183f
treed95ab3fd79451caa17ec36932d99e6dbf5d5e648
parente751e7a3852b9c684be8f32d96b52ae78ac84fe9
brcmfmac: Don't grow SKB by negative size

The commit to rework the headroom check in start_xmit() now calls
pxskb_expand_head() unconditionally if the header is CoW. Unfortunately,
it does so with the delta between the extant headroom and the header
length, which may be negative if there is already sufficient headroom.

pskb_expand_head() does allow for size being 0, in which case it just
copies, so clamp the header delta to zero.

Opening Chrome (and all my tabs) on a PCIE device was enough to reliably
hit this.

Fixes: 0e18af710058 ("brcmfmac: rework headroom check in .start_xmit()")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Cc: Hante Meuleman <hante.meuleman@broadcom.com>
Cc: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Cc: Franky Lin <franky.lin@broadcom.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c