]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
cfg80211: fix page refcount issue in A-MSDU decap
authorFelix Fietkau <nbd@nbd.name>
Mon, 13 Jan 2020 18:21:07 +0000 (19:21 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:26:24 +0000 (16:26 +0100)
BugLink: https://bugs.launchpad.net/bugs/1861090
commit 81c044fc3bdc5b7be967cd3682528ea94b58c06a upstream.

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: 2b67f944f88c ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/wireless/util.c

index 5b4ed5bbc542555a4ebd4e8fcfbb6dccf10e9f3f..8481e9ac33da5c71652186e8110b92e025eedae4 100644 (file)
@@ -564,7 +564,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page,
        struct skb_shared_info *sh = skb_shinfo(skb);
        int page_offset;
 
-       page_ref_inc(page);
+       get_page(page);
        page_offset = ptr - page_address(page);
        skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
 }