public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* filldir[64] oddness
@ 2006-03-09  4:27 Dave Jones
  2006-03-09  4:32 ` David S. Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Dave Jones @ 2006-03-09  4:27 UTC (permalink / raw)
  To: Linux Kernel

I'm puzzled by an aparent use of uninitialised memory
that coverity's checker picked up.

fs/readdir.c

#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))

140  	static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
141  			   ino_t ino, unsigned int d_type)
142  	{
143  		struct linux_dirent __user * dirent;
144  		struct getdents_callback * buf = (struct getdents_callback *) __buf
145  		int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);

How come that NAME_OFFSET isn't causing an oops when
it dereferences stackjunk->d_name ?

		Dave

-- 
http://www.codemonkey.org.uk

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-03-10  1:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-09  4:27 filldir[64] oddness Dave Jones
2006-03-09  4:32 ` David S. Miller
2006-03-09  4:38   ` Dave Jones
2006-03-09  4:40   ` Al Viro
2006-03-09 17:02     ` Bryan O'Sullivan
2006-03-09 17:07       ` Dave Jones
2006-03-09 17:15         ` Bryan O'Sullivan
2006-03-09 17:27           ` Dave Jones
2006-03-10  1:41       ` Kyle Moffett
2006-03-10  1:44         ` Al Viro
2006-03-09  4:33 ` Vadim Lobanov
2006-03-09  4:34 ` Stephen Rothwell
2006-03-09  4:38 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox