From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: raoxu <raoxu@uniontech.com>
Cc: andreas.noever@gmail.com, westeri@kernel.org,
YehezkelShB@gmail.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thunderbolt: debugfs: fix margining error counter buffer leak
Date: Thu, 4 Jun 2026 07:00:32 +0200 [thread overview]
Message-ID: <20260604050032.GG2990@black.igk.intel.com> (raw)
In-Reply-To: <5DD51F2D1DD8155C+20260603095957.1126008-1-raoxu@uniontech.com>
On Wed, Jun 03, 2026 at 05:59:57PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@uniontech.com>
>
> When USB4 lane margining debugfs write support is enabled,
> margining_error_counter_write() copies the user input with
> validate_and_copy_from_user(). This allocates a temporary page that is
> only needed while parsing the requested error counter mode.
>
> The function currently returns without freeing that page. This leaks one
> page per write to the error_counter debugfs file, including successful
> writes and writes that later fail while taking the domain lock or because
> software margining is not enabled.
>
> Free the temporary page once parsing has completed, and also before
> returning from the invalid-input path.
>
> Fixes: 10904df3f20c ("thunderbolt: Improve software receiver lane margining")
> Signed-off-by: Xu Rao <raoxu@uniontech.com>
Applied to thunderbolt.git/next, thanks!
prev parent reply other threads:[~2026-06-04 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 9:59 [PATCH] thunderbolt: debugfs: fix margining error counter buffer leak raoxu
2026-06-04 5:00 ` Mika Westerberg [this message]
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=20260604050032.GG2990@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=raoxu@uniontech.com \
--cc=westeri@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