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: <4B69B2BD.60909@zytor.com>
Date:	Wed, 03 Feb 2010 09:30:37 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
CC:	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf tools: using O_LARGEFILE to open perf data file
  - fix

On 02/03/2010 03:06 AM, Xiao Guangrong wrote:
>  static void get_next_page(int cpu)
>  {
> -	off64_t save_seek;
> -	off64_t ret;
> +	s64 save_seek;
> +	s64 ret;

Should be off_t (which is 64 bits with _FILE_OFFSET_BITS=64.)

>  
>  	if (!cpu_data[cpu].page)
>  		return;
> @@ -298,9 +298,9 @@ static void get_next_page(int cpu)
>  		update_cpu_data_index(cpu);
>  
>  		/* other parts of the code may expect the pointer to not move */
> -		save_seek = lseek64(input_fd, 0, SEEK_CUR);
> +		save_seek = lseek(input_fd, 0, SEEK_CUR);
>  
> -		ret = lseek64(input_fd, cpu_data[cpu].offset, SEEK_SET);
> +		ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET);
>  		if (ret < 0)
>  			die("failed to lseek");

Compare for equality against (off_t)-1 here.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ