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]
Date:   Thu, 1 Jun 2017 13:29:38 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Jiri Olsa <jolsa@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, kernel-team@....com,
        David Ahern <dsahern@...il.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 1/2] perf tools: Decompress kernel module when reading
 DSO data

On Thu, Jun 01, 2017 at 06:06:04PM +0900, Namhyung Kim wrote:

SNIP

> -	}
> -
> -	unlink(tmpbuf);
> -
> -out:
> -	free(m.ext);
> -	return fd;
> -}
> -
>  bool symsrc__possibly_runtime(struct symsrc *ss)
>  {
>  	return ss->dynsym || ss->opdsec;
> @@ -702,9 +668,13 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
>  	int fd;
>  
>  	if (dso__needs_decompress(dso)) {
> -		fd = decompress_kmodule(dso, name, type);
> +		char buf[32];
> +
> +		fd = dso__decompress_kmodule(dso, name, buf, sizeof(buf));
>  		if (fd < 0)
>  			return -1;
> +
> +		unlink(buf);

I wonder we could make this more clear and add:

  dso__decompress_kmodule_fd
  dso__decompress_kmodule_path

_fd version would remove the file and _path version would close the descriptor

in any case, could you please split the change so the
changes to decompress_kmodule are apparent?

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ