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] [day] [month] [year] [list]
Message-ID: <aMRps1jV6VHPOnT-@x1>
Date: Fri, 12 Sep 2025 15:42:59 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Yunseong Kim <ysk@...lloc.com>, Namhyung Kim <namhyung@...nel.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	Stephen Brennan <stephen.s.brennan@...cle.com>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf util: Fix compression checks returning -1 as bool

On Fri, Aug 22, 2025 at 09:34:07AM -0700, Ian Rogers wrote:
> On Fri, Aug 22, 2025 at 9:28 AM Yunseong Kim <ysk@...lloc.com> wrote:
> >
> > The lzma_is_compressed and gzip_is_compressed functions are declared
> > to return a "bool" type, but in case of an error (e.g., file open
> > failure), they incorrectly returned -1.
> >
> > A bool type is a boolean value that is either true or false.
> > Returning -1 for a bool return type can lead to unexpected behavior
> > and may violate strict type-checking in some compilers.
> >
> > Fix the return value to be false in error cases, ensuring the function
> > adheres to its declared return type improves for preventing potential
> > bugs related to type mismatch.
> >
> > Fixes: 4b57fd44b61b ("perf tools: Add lzma_is_compressed function")
> > Fixes: 88c74dc76a30 ("perf tools: Add gzip_is_compressed function")
> > Signed-off-by: Yunseong Kim <ysk@...lloc.com>
> 
> Reviewed-by: Ian Rogers <irogers@...gle.com>

Thanks, applied to perf-tools-next,

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ