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:   Mon, 02 Jul 2018 14:23:42 +0800
From:   Huaisheng Ye <yehs2007@...o.com>
To:     "\"Al Viro\"" <viro@...IV.linux.org.uk>
Cc:     <dan.j.williams@...el.com>, <dave.jiang@...el.com>,
        <willy@...radead.org>, <ross.zwisler@...ux.intel.com>,
        <vishal.l.verma@...el.com>, <jack@...e.com>, <chengnt@...ovo.com>,
        <linux-nvdimm@...ts.01.org>, <linux-kernel@...r.kernel.org>,
        <linux-ext4@...r.kernel.org>, "\"Huaisheng Ye\"" <yehs1@...ovo.com>
Subject: Re: [PATCH 2/3] fs/ext2/inode: Fix a type cast error for fsdax

 ---- On Mon, 02 Jul 2018 03:26:00 +0800 Al Viro <viro@...IV.linux.org.uk> wrote ---- 
 > On Sun, Jul 01, 2018 at 02:18:47PM +0800, Huaisheng Ye wrote: 
 > > From: Huaisheng Ye <yehs1@...ovo.com> 
 > >  
 > > The type of offset within struct iomap is loff_t, which represents 
 > > file offset of mapping. 
 > >  
 > > In ext2_iomap_begin, iomap->offset shall be given a type cast as 
 > > loff_t instead of u64. 
 >  
 > Why is it an error?  loff_t is uniformly typedefed to long long. 
 > In which case the second variant is different from the first one 
 > *and* does not step into nasal demon territory?

Sorry for my inaccuracy.
The type of iomap->offset is loff_t, is it better to cast first_block
to loff_t, then do the left shift operation?
 
 >  
 > > -    iomap->offset = (u64)first_block << blkbits; 
 > > +    iomap->offset = (loff_t)first_block << blkbits; 
 > 

---
Cheers,
Huaisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ