From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C461C433ED for ; Fri, 9 Apr 2021 19:31:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 019CB61042 for ; Fri, 9 Apr 2021 19:31:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234761AbhDITbh (ORCPT ); Fri, 9 Apr 2021 15:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234507AbhDITbg (ORCPT ); Fri, 9 Apr 2021 15:31:36 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72A00C061762 for ; Fri, 9 Apr 2021 12:31:22 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lUwqd-009aTJ-Ow; Fri, 09 Apr 2021 21:31:19 +0200 Message-ID: <82a7c6c9bcbe923906276e8aa26a9a783598a0d7.camel@sipsolutions.net> Subject: Re: Memory leak in ieee80211_rx_napi() From: Johannes Berg To: Larry Finger Cc: linux-wireless , Pkshih Date: Fri, 09 Apr 2021 21:31:19 +0200 In-Reply-To: (sfid-20210409_172345_954618_8D29770B) References: (sfid-20210409_172345_954618_8D29770B) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Larry, > What setting or lack of, would cause ieee80211_rx_napi() to leak the skb that it > is given? The documentation states that once this call is made, mac80211 owns > this buffer. Does this mean that it will also be freed? Eventually, yes. But it might go onto a NAPI GRO list, etc. Perhaps it might even look like it's leaked if it's on such a list if you didn't implement NAPI properly as polling, but just call ieee80211_rx_napi() with a non-NULL napi struct pointer. That said, of course there might be bugs in mac80211 where it actually leaks the skb. How are you determining that it's being leaked? johannes