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: <49D1F01C.7020307@panasas.com>
Date:	Tue, 31 Mar 2009 13:27:40 +0300
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Avishay Traeger <avishay@...il.com>, Jeff Garzik <jeff@...zik.org>,
	Evgeniy Polyakov <zbr@...emap.net>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	open-osd <osd-dev@...n-osd.org>,
	Marcin Slusarz <marcin.slusarz@...il.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	James Bottomley <James.Bottomley@...senPartnership.com>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Subject: Re: [PATCH 4/8 ver5] exofs: address_space_operations

On 03/31/2009 01:15 PM, Andrew Morton wrote:
> On Tue, 31 Mar 2009 12:04:36 +0300 Boaz Harrosh <bharrosh@...asas.com> wrote:
> 
>>>> +static int write_exec(struct page_collect *pcol)
>>>> +{
>>>> +	struct exofs_i_info *oi = exofs_i(pcol->inode);
>>>> +	struct osd_obj_id obj = {pcol->sbi->s_pid,
>>>> +					pcol->inode->i_ino + EXOFS_OBJ_OFF};
>>>> +	struct osd_request *or = NULL;
>>>> +	struct page_collect *pcol_copy = NULL;
>>>> +	loff_t i_start = pcol->pg_first << PAGE_CACHE_SHIFT;
>>> bug.  On 32-bit this shift will overflow prior to getting promoted to
>>> 64-bit.  Do:
>>>
>>> 	loff_t i_start = (loff_t)pcol->pg_first << PAGE_CACHE_SHIFT;
>>>
>> In that case I might make pcol->pg_first loff_t.
> 
> That would work.
> 
>> Why is inode->i_index not an loff_t then?
> 
> hm, what's i_index?
> 

sorry, I meant page index

>> Page-index <=> byte-offset, is done all the time 12 bits does not
>> make a difference.
> 
> Page indices are 32-bit on 32-bit CPUs.  File offsets are 64-bit.  We
> are careful to avoid the above overflow bug whenever the conversion
> from page index to file size is made.  Try
> 
> 	fgrep '(loff_t)' mm/*.c
> 

right! which means that Linux does not support 64 bit offsets on
32 bit, but only 44 bits. But I guess exofs will not change that.

Boaz
--
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