public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Possible bug in UBIFS function ubifs_finddir
@ 2011-06-16 11:13 Rod Boyce
  2011-06-18  9:51 ` [U-Boot] [Patch] For " Rod Boyce
  0 siblings, 1 reply; 9+ messages in thread
From: Rod Boyce @ 2011-06-16 11:13 UTC (permalink / raw)
  To: u-boot

All,

Hello again it has been a while since I was here.
I am working on u-boot once again and think I may have found a bug in the
UBIFS sub-system.

The function is ubifs_finddir and the issue is that there seems to be a
free of a pointer in a structure that has already been freed.  This is
causing the free function to rightly crash.

The code is in the error path of the ubifs_finddir at the end of the
function line 363:

	if (file)
		free(file);
	if (dentry)
		free(dentry);
	if (dir)
		free(dir);

	if (file->private_data)
		kfree(file->private_data);
	file->private_data = NULL;
	file->f_pos = 2;

The issue is that we are free'ing the file pointer at the top of this
block and then trying to free the private_data element after the base
pointer.  I will fix and send a patch but before I do I just wanted to
make sure I was not missing the obvious.
Has this been discussed before and is there already a patch?

Regards,
Rod Boyce

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

end of thread, other threads:[~2011-08-19 15:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-16 11:13 [U-Boot] Possible bug in UBIFS function ubifs_finddir Rod Boyce
2011-06-18  9:51 ` [U-Boot] [Patch] For " Rod Boyce
2011-06-29  8:34   ` Stefan Roese
2011-06-29 11:42     ` Detlev Zundel
2011-06-29 11:35   ` Detlev Zundel
2011-07-25 21:57   ` Wolfgang Denk
2011-07-28 13:27   ` [U-Boot] [PATCH] ubifs: Fix bad free() sequence in ubifs_finddir() Wolfgang Denk
2011-07-28 14:09     ` Rod Boyce
2011-08-19 15:22     ` Stefan Roese

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