lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z89J9cBUR6NCMaaj@x1>
Date: Mon, 10 Mar 2025 17:22:13 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Kan Liang <kan.liang@...ux.intel.com>,
	Yicong Yang <yangyicong@...ilicon.com>,
	James Clark <james.clark@...aro.org>,
	"Dr. David Alan Gilbert" <linux@...blig.org>,
	Levi Yun <yeoreum.yun@....com>, Ze Gao <zegao2021@...il.com>,
	Weilin Wang <weilin.wang@...el.com>, Xu Yang <xu.yang_2@....com>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	Howard Chu <howardchu95@...il.com>
Subject: Re: [PATCH v2 01/11] perf debug: Avoid stack overflow in recursive
 error message

On Fri, Feb 28, 2025 at 02:22:58PM -0800, Ian Rogers wrote:
> In debug_file, pr_warning_once is called on error. As that function
> calls debug_file the function will yield a stack overflow. Switch the
> location of the call so the recursion is avoided.
> 
> Reviewed-by: Howard Chu <howardchu95@...il.com>
> Signed-off-by: Ian Rogers <irogers@...gle.com>

Good to add this so that stable picks it:

Fixes: ec49230cf6dda704 ("perf debug: Expose debug file")

- Arnaldo

> ---
>  tools/perf/util/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
> index 995f6bb05b5f..f9ef7d045c92 100644
> --- a/tools/perf/util/debug.c
> +++ b/tools/perf/util/debug.c
> @@ -46,8 +46,8 @@ int debug_type_profile;
>  FILE *debug_file(void)
>  {
>  	if (!_debug_file) {
> -		pr_warning_once("debug_file not set");
>  		debug_set_file(stderr);
> +		pr_warning_once("debug_file not set");
>  	}
>  	return _debug_file;
>  }
> -- 
> 2.48.1.711.g2feabab25a-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ