New Defects reported by Coverity Scan for linux-next weekly scan (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've got this complaint from coverity:

----- Forwarded message from scan-admin@xxxxxxxxxxxx -----

________________________________________________________________________________________________________
*** CID 1600337:    (UNINIT)
/fs/attr.c: 311 in setattr_copy_mgtime()
305     	else if (ia_valid & ATTR_ATIME)
306     		inode_set_atime_to_ts(inode, now);
307     
308     	if (ia_valid & ATTR_MTIME_SET)
309     		inode_set_mtime_to_ts(inode, attr->ia_mtime);
310     	else if (ia_valid & ATTR_MTIME)
>>>     CID 1600337:    (UNINIT)
>>>     Using uninitialized value "now" when calling "inode_set_mtime_to_ts".
311     		inode_set_mtime_to_ts(inode, now);
312     }
313     
314     /**
315      * setattr_copy - copy simple metadata updates into the generic inode
316      * @idmap:	idmap of the mount the inode was found from
/fs/attr.c: 306 in setattr_copy_mgtime()
300     		WARN_ON_ONCE(ia_valid & ATTR_MTIME);
301     	}
302     
303     	if (ia_valid & ATTR_ATIME_SET)
304     		inode_set_atime_to_ts(inode, attr->ia_atime);
305     	else if (ia_valid & ATTR_ATIME)
>>>     CID 1600337:    (UNINIT)
>>>     Using uninitialized value "now" when calling "inode_set_atime_to_ts".
306     		inode_set_atime_to_ts(inode, now);
307     
308     	if (ia_valid & ATTR_MTIME_SET)
309     		inode_set_mtime_to_ts(inode, attr->ia_mtime);
310     	else if (ia_valid & ATTR_MTIME)
311     		inode_set_mtime_to_ts(inode, now);

Now we WARN if ATTR_MTIME is set without ATTR_CTIME but still it might be
good to place some sane value in 'now' so that we don't set the timestamp
to garbage and more importantly setting ATTR_ATIME without ATTR_CTIME looks
as a possible thing?

								Honza


-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux