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: <527D16C1.3070206@gmail.com>
Date:	Fri, 08 Nov 2013 09:52:17 -0700
From:	David Ahern <dsahern@...il.com>
To:	Jiri Olsa <jolsa@...hat.com>
CC:	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	mingo@...nel.org, Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Mike Galbraith <efault@....de>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 2/2] perf record: mmap output file - v4

On 11/8/13, 2:34 AM, Jiri Olsa wrote:
>> +	if (ftruncate(fd, len) != 0)
>> +		pr_err("ftruncate failed\n");
>
> I think we should fail here and dont let the finishing
> code run on probably corrupted file.
>
> the code that process build IDs could even get stuck

Yes, I'll fix that in v5.

It also got me to thinking about failure scenarios -- like out of space. 
I was looking at this path using a size-limited tmpfs (max 1M) and 
writing perf.data into it.

Today (without this mmap output page) if the write() fails due to lack 
of space then perf emits the message:
   failed to write perf data, error: No space left on device

and stops — killing the workload too. Trying to read and process the 
perf.data file fails with a SIGBUS error.  I just sent a patch this 
addresses that problem.

Using that patch as a start point and moving to mmap-based output if the 
filesystem runs out of space the memcpy generates a SIGBUS and we need 
to jump out of the memcpy. The attached fixes that problem.

Any objections to using a sigjmp? Other option is to die in the signal 
handler.  That option is harder to clean up.

David




View attachment "perf-record-handle-mmap-write-failure.patch" of type "text/plain" (2022 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ