From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Xinming Hu <huxm@marvell.com>,
Amitkumar Karwar <akarwar@marvell.com>,
Kalle Valo <kvalo@codeaurora.org>
Subject: [PATCH 4.9 028/103] mwifiex: remove redundant dma padding in AMSDU
Date: Thu, 11 May 2017 16:11:57 +0200 [thread overview]
Message-ID: <20170511141212.870537195@linuxfoundation.org> (raw)
In-Reply-To: <20170511141210.778405364@linuxfoundation.org>
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xinming Hu <huxm@marvell.com>
commit 5f0a221f59ad6b72202ef9c6e232086de8c336f2 upstream.
We already ensure 64 bytes alignment and add padding if required
during skb_aggr allocation.
Alignment and padding in mwifiex_11n_form_amsdu_txpd() is redundant.
We may end up accessing more data than allocated size with this.
This patch fixes following issue by removing redundant padding.
[ 370.241338] skbuff: skb_over_panic: text:ffffffffc046946a len:3550
put:72 head:ffff880000110000 data:ffff8800001100e4 tail:0xec2 end:0xec0 dev:<NULL>
[ 370.241374] ------------[ cut here ]------------
[ 370.241382] kernel BUG at net/core/skbuff.c:104!
370.244032] Call Trace:
[ 370.244041] [<ffffffff8c3df5ec>] skb_put+0x44/0x45
[ 370.244055] [<ffffffffc046946a>]
mwifiex_11n_aggregate_pkt+0x1e9/0xa50 [mwifiex]
[ 370.244067] [<ffffffffc0467c16>] mwifiex_wmm_process_tx+0x44a/0x6b7
[mwifiex]
[ 370.244074] [<ffffffffc0411eb8>] ? 0xffffffffc0411eb8
[ 370.244084] [<ffffffffc046116b>] mwifiex_main_process+0x476/0x5a5
[mwifiex]
[ 370.244098] [<ffffffffc0461298>] mwifiex_main_process+0x5a3/0x5a5
[mwifiex]
[ 370.244113] [<ffffffff8be7e9ff>] process_one_work+0x1a4/0x309
[ 370.244123] [<ffffffff8be7f4ca>] worker_thread+0x20c/0x2ee
[ 370.244130] [<ffffffff8be7f2be>] ? rescuer_thread+0x383/0x383
[ 370.244136] [<ffffffff8be7f2be>] ? rescuer_thread+0x383/0x383
[ 370.244143] [<ffffffff8be83742>] kthread+0x11c/0x124
[ 370.244150] [<ffffffff8be83626>] ? kthread_parkme+0x24/0x24
[ 370.244157] [<ffffffff8c4da1ef>] ret_from_fork+0x3f/0x70
[ 370.244168] [<ffffffff8be83626>] ? kthread_parkme+0x24/0x24
Fixes: 84b313b35f8158d ("mwifiex: make tx packet 64 byte DMA aligned")
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/marvell/mwifiex/11n_aggr.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
@@ -101,13 +101,6 @@ mwifiex_11n_form_amsdu_txpd(struct mwifi
{
struct txpd *local_tx_pd;
struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
- unsigned int pad;
- int headroom = (priv->adapter->iface_type ==
- MWIFIEX_USB) ? 0 : INTF_HEADER_LEN;
-
- pad = ((void *)skb->data - sizeof(*local_tx_pd) -
- headroom - NULL) & (MWIFIEX_DMA_ALIGN_SZ - 1);
- skb_push(skb, pad);
skb_push(skb, sizeof(*local_tx_pd));
@@ -121,12 +114,10 @@ mwifiex_11n_form_amsdu_txpd(struct mwifi
local_tx_pd->bss_num = priv->bss_num;
local_tx_pd->bss_type = priv->bss_type;
/* Always zero as the data is followed by struct txpd */
- local_tx_pd->tx_pkt_offset = cpu_to_le16(sizeof(struct txpd) +
- pad);
+ local_tx_pd->tx_pkt_offset = cpu_to_le16(sizeof(struct txpd));
local_tx_pd->tx_pkt_type = cpu_to_le16(PKT_TYPE_AMSDU);
local_tx_pd->tx_pkt_length = cpu_to_le16(skb->len -
- sizeof(*local_tx_pd) -
- pad);
+ sizeof(*local_tx_pd));
if (tx_info->flags & MWIFIEX_BUF_FLAG_TDLS_PKT)
local_tx_pd->flags |= MWIFIEX_TXPD_FLAGS_TDLS_PACKET;
@@ -190,7 +181,11 @@ mwifiex_11n_aggregate_pkt(struct mwifiex
ra_list_flags);
return -1;
}
- skb_reserve(skb_aggr, MWIFIEX_MIN_DATA_HEADER_LEN);
+
+ /* skb_aggr->data already 64 byte align, just reserve bus interface
+ * header and txpd.
+ */
+ skb_reserve(skb_aggr, headroom + sizeof(struct txpd));
tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr);
memset(tx_info_aggr, 0, sizeof(*tx_info_aggr));
next prev parent reply other threads:[~2017-05-11 14:11 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 14:11 [PATCH 4.9 000/103] 4.9.28-stable review Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 001/103] 9p: fix a potential acl leak Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 002/103] drm/sti: fix GDP size to support up to UHD resolution Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 003/103] hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628 Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 004/103] tpm: fix RC value check in tpm2_seal_trusted Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 005/103] tmp: use pdev for parent device in tpm_chip_alloc Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 008/103] cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 009/103] powerpc/mm: Fixup wrong LPCR_VRMASD value Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 010/103] powerpc/powernv: Fix opal_exit tracepoint opcode Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 011/103] powerpc/ftrace: Fix confusing help text for DISABLE_MPROFILE_KERNEL Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 012/103] powerpc: Correctly disable latent entropy GCC plugin on prom_init.o Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 013/103] perf/x86/intel/pt: Add format strings for PTWRITE and power event tracing Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 014/103] power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 015/103] power: supply: bq24190_charger: Call set_mode_host() on pm_resume() Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 016/103] power: supply: bq24190_charger: Install irq_handler_thread() at end of probe() Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 017/103] power: supply: bq24190_charger: Call power_supply_changed() for relevant component Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 018/103] power: supply: bq24190_charger: Dont read fault register outside irq_handle_thread() Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 019/103] power: supply: bq24190_charger: Handle fault before status on interrupt Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 020/103] arm64: dts: r8a7795: Mark EthernetAVB device node disabled Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 021/103] arm: dts: qcom: Fix ipq board clock rates Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 022/103] arm64: Improve detection of user/non-user mappings in set_pte(_at) Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 023/103] leds: ktd2692: avoid harmless maybe-uninitialized warning Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 024/103] ARM: dts: NSP: GPIO reboot open-source Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 025/103] ARM: OMAP5 / DRA7: Fix HYP mode boot for thumb2 build Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 026/103] ARM: dts: sun7i: lamobo-r1: Fix CPU port RGMII settings Greg Kroah-Hartman
2017-05-11 14:11 ` [PATCH 4.9 027/103] mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print Greg Kroah-Hartman
2017-05-11 14:11 ` Greg Kroah-Hartman [this message]
2017-05-11 14:11 ` [PATCH 4.9 029/103] mwifiex: Avoid skipping WEP key deletion for AP Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 031/103] iwlwifi: mvm: dont restart HW if suspend fails with unified image Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 032/103] iwlwifi: mvm: overwrite skb info later Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 033/103] iwlwifi: pcie: dont increment / decrement a bool Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 035/103] iwlwifi: pcie: fix the set of DMA memory mask Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 036/103] iwlwifi: mvm: fix reorder timer re-arming Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 037/103] iwlwifi: mvm: Use aux queue for offchannel frames in dqa Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 038/103] iwlwifi: mvm/pcie: adjust A-MSDU tx_cmd length in PCIe Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 039/103] iwlwifi: mvm: fix pending frame counter calculation Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 040/103] iwlwifi: mvm: fix references to first_agg_queue in DQA mode Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 041/103] iwlwifi: mvm: synchronize firmware DMA paging memory Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 042/103] iwlwifi: mvm: writing zero bytes to debugfs causes a crash Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 043/103] x86/ioapic: Restore IO-APIC irq_chip retrigger callback Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 045/103] x86/mpx: Re-add MPX to selftests Makefile Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 046/103] clk: Make x86/ conditional on CONFIG_COMMON_CLK Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 047/103] kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 048/103] x86/platform/intel-mid: Correct MSI IRQ line for watchdog device Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 052/103] usb: dwc2: host: use msleep() for long delay Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 053/103] usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 054/103] usb: host: ohci-exynos: " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 055/103] usb: chipidea: Only read/write OTGSC from one place Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 056/103] usb: chipidea: Handle extcon events properly Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 057/103] USB: serial: keyspan_pda: fix receive sanity checks Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 058/103] USB: serial: digi_acceleport: fix incomplete rx sanity check Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 059/103] USB: serial: ssu100: fix control-message error handling Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 060/103] USB: serial: io_edgeport: fix epic-descriptor handling Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 061/103] USB: serial: ti_usb_3410_5052: fix control-message error handling Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 062/103] USB: serial: ark3116: fix open " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 063/103] USB: serial: ftdi_sio: fix latency-timer " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 064/103] USB: serial: quatech2: fix control-message " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 065/103] USB: serial: mct_u232: fix modem-status " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 066/103] USB: serial: io_edgeport: fix descriptor " Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 067/103] USB: serial: sierra: fix bogus alternate-setting assumption Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 068/103] clk: rockchip: add "," to mux_pll_src_apll_dpll_gpll_usb480m_p on rk3036 Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 069/103] phy: qcom-usb-hs: Add depends on EXTCON Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 070/103] serial: 8250_omap: Fix probe and remove for PM runtime Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 071/103] scsi: qla2xxx: Fix crash in qla2xxx_eh_abort on bad ptr Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 072/103] scsi: mac_scsi: Fix MAC_SCSI=m option when SCSI=m Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 073/103] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 074/103] scsi: smartpqi: fix time handling Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 075/103] MIPS: R2-on-R6 MULTU/MADDU/MSUBU emulation bugfix Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 076/103] brcmfmac: Ensure pointer correctly set if skb data location changes Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 077/103] brcmfmac: Make skb header writable before use Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 078/103] staging/lustre/llite: move root_squash from sysfs to debugfs Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 079/103] staging: wlan-ng: add missing byte order conversion Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 080/103] staging: emxx_udc: remove incorrect __init annotations Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 081/103] ALSA: hda - Fix deadlock of controller device lock at unbinding Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 082/103] sparc64: fix fault handling in NGbzero.S and GENbzero.S Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 083/103] macsec: dynamically allocate space for sglist Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 084/103] tcp: do not underestimate skb->truesize in tcp_trim_head() Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 085/103] bpf: enhance verifier to understand stack pointer arithmetic Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 086/103] bpf, arm64: fix jit branch offset related to ldimm64 Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 087/103] tcp: fix wraparound issue in tcp_lp Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 088/103] net: ipv6: Do not duplicate DAD on link up Greg Kroah-Hartman
2017-05-11 14:12 ` [PATCH 4.9 090/103] tcp: do not inherit fastopen_req from parent Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 091/103] ipv4, ipv6: ensure raw socket message is big enough to hold an IP header Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 092/103] rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 093/103] ipv6: initialize route null entry in addrconf_init() Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 094/103] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 095/103] bnxt_en: allocate enough space for ->ntp_fltr_bmap Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 096/103] bpf: dont let ldimm64 leak map addresses on unprivileged Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 097/103] net: mdio-mux: bcm-iproc: call mdiobus_free() in error path Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 098/103] f2fs: sanity check segment count Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 099/103] xen: Revert commits da72ff5bfcb0 and 72a9b186292d Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 100/103] wlcore: Pass win_size taken from ieee80211_sta to FW Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 101/103] wlcore: Add RX_BA_WIN_SIZE_CHANGE_EVENT event Greg Kroah-Hartman
2017-05-11 14:13 ` [PATCH 4.9 103/103] block: get rid of blk_integrity_revalidate() Greg Kroah-Hartman
2017-05-11 21:09 ` [PATCH 4.9 000/103] 4.9.28-stable review Guenter Roeck
2017-05-12 6:20 ` Greg Kroah-Hartman
2017-05-12 15:24 ` Shuah Khan
2017-05-13 2:47 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170511141212.870537195@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akarwar@marvell.com \
--cc=huxm@marvell.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).