Linux-PM Archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Sasha Levin <sashal@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Johnny Liu <johnliu@nvidia.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 5.10.y] PM / devfreq: Fix buffer overflow in trans_stat_show
Date: Mon, 29 Apr 2024 13:12:30 +0200	[thread overview]
Message-ID: <2024042922-fleshed-bonding-648d@gregkh> (raw)
In-Reply-To: <8a59f3b2-48b0-4a62-ab54-61f8d6068cbc@siemens.com>

On Sun, Apr 28, 2024 at 10:28:42AM +0200, Jan Kiszka wrote:
> From: Christian Marangi <ansuelsmth@gmail.com>
> 
> [ Upstream commit 08e23d05fa6dc4fc13da0ccf09defdd4bbc92ff4 ]
> 
> Fix buffer overflow in trans_stat_show().
> 
> Convert simple snprintf to the more secure scnprintf with size of
> PAGE_SIZE.
> 
> Add condition checking if we are exceeding PAGE_SIZE and exit early from
> loop. Also add at the end a warning that we exceeded PAGE_SIZE and that
> stats is disabled.
> 
> Return -EFBIG in the case where we don't have enough space to write the
> full transition table.
> 
> Also document in the ABI that this function can return -EFBIG error.
> 
> Link: https://lore.kernel.org/all/20231024183016.14648-2-ansuelsmth@gmail.com/
> Cc: stable@vger.kernel.org
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218041
> Fixes: e552bbaf5b98 ("PM / devfreq: Add sysfs node for representing frequency transition information.")
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Original found by someone at Nvidia. But this backport is based on the 
> 5.15 commit (796d3fad8c35ee9df9027899fb90ceaeb41b958f) where only a 
> conflict in sysfs-class-devfreq needed manual resolution.

Now queued up, thanks.

greg k-h

      reply	other threads:[~2024-04-29 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28  8:28 [PATCH 5.10.y] PM / devfreq: Fix buffer overflow in trans_stat_show Jan Kiszka
2024-04-29 11:12 ` Greg Kroah-Hartman [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=2024042922-fleshed-bonding-648d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ansuelsmth@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=jan.kiszka@siemens.com \
    --cc=johnliu@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).