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] [day] [month] [year] [list]
Message-ID: <48916A0F.1000500@cn.fujitsu.com>
Date:	Thu, 31 Jul 2008 15:30:23 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
CC:	Miklos Szeredi <miklos@...redi.hu>, viro@...IV.linux.org.uk,
	akpm@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 2/4] vfs: filp is never NULL in do_generic_file_read()

KOSAKI Motohiro wrote:
>>  	*ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
>> -	if (filp)
>> -		file_accessed(filp);
>> +	file_accessed(filp);
>>  }
>>  
>>  int file_read_actor(read_descriptor_t *desc, struct page *page,
> 
> if filp is never NULL, BUG_ON is better?
> 

static inline void file_accessed(struct file *file)
{
	if (!(file->f_flags & O_NOATIME))
		...
}

So if filp is NULL, we'll get a noisy NULL dereference bug immediately,
so BUG_ON() is not needed.


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