Skip to content

Commit 81c044f

Browse files
nbd168jmberg-intel
authored andcommitted
cfg80211: fix page refcount issue in A-MSDU decap
The fragments attached to a skb can be part of a compound page. In that case, page_ref_inc will increment the refcount for the wrong page. Fix this by using get_page instead, which calls page_ref_inc on the compound head and also checks for overflow. Fixes: 2b67f94 ("cfg80211: reuse existing page fragments in A-MSDU rx") Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://lore.kernel.org/r/20200113182107.20461-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 24953de commit 81c044f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/wireless/util.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page,
564564
struct skb_shared_info *sh = skb_shinfo(skb);
565565
int page_offset;
566566

567-
page_ref_inc(page);
567+
get_page(page);
568568
page_offset = ptr - page_address(page);
569569
skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
570570
}

0 commit comments

Comments
 (0)