From: Dan Carpenter <error27@gmail.com>
To: Cong Nguyen <congnt264@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: fix xmit_frame/xmit_buf leaks on mgnt-frame error paths
Date: Wed, 15 Jul 2026 13:34:44 +0300 [thread overview]
Message-ID: <aldiRDQTQd0eN4SD@stanley.mountain> (raw)
In-Reply-To: <20260714163525.175763-1-congnt264@gmail.com>
On Tue, Jul 14, 2026 at 11:35:25PM +0700, Cong Nguyen wrote:
> issue_beacon(), issue_probersp() and issue_asocrsp() obtain a management
> xmit_frame together with its xmit_buf from the driver's fixed-size
> management-TX pools via alloc_mgtxmitframe(). On the normal path the frame
> is handed to dump_mgntframe(), which transfers ownership and eventually
> returns both objects to their pools (the frame and, for beacons, the buf
> in rtl8723bs_mgnt_xmit(); other bufs via the pending-xmitbuf/TX-completion
> path).
>
> Several error/edge paths return early after a successful
> alloc_mgtxmitframe() but before dump_mgntframe(), so ownership is never
> transferred and neither object is freed:
>
> - issue_beacon(): beacon larger than 512 bytes
> - issue_probersp(): cur_network->ie_length > MAX_IE_SZ
> - issue_probersp(): kzalloc() of the SSID scratch buffer fails
> - issue_asocrsp(): pkt_type is neither ASSOCRSP nor REASSOCRSP
>
> Because alloc_mgtxmitframe() removes the frame and buf from their free
> lists (list_del_init) without placing them on any pending list, an
> orphaned pair is on no list and referenced by nobody, so it is only
> reclaimed at driver teardown. Repeated hits progressively exhaust the
> management-TX pools until alloc_mgtxmitframe() returns NULL and the
> interface can no longer send beacons or probe/assoc responses.
>
> Free the frame and buffer on these paths, matching the existing correct
> error handling in issue_assocreq().
>
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---
Looks reasonable. Please add a Fixes tag.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
next prev parent reply other threads:[~2026-07-15 10:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 16:35 [PATCH] staging: rtl8723bs: fix xmit_frame/xmit_buf leaks on mgnt-frame error paths Cong Nguyen
2026-07-15 10:34 ` Dan Carpenter [this message]
2026-07-15 11:17 ` [PATCH v2] " Cong Nguyen
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=aldiRDQTQd0eN4SD@stanley.mountain \
--to=error27@gmail.com \
--cc=congnt264@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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