public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBIFS: a pair of orphan bugs
@ 2013-01-28  1:28 Adam Thomas
  2013-01-28  1:28 ` [PATCH 1/2] UBIFS: fix use of freed ubifs_orphan objects Adam Thomas
  2013-01-28  1:28 ` [PATCH 2/2] UBIFS: fix double free of " Adam Thomas
  0 siblings, 2 replies; 9+ messages in thread
From: Adam Thomas @ 2013-01-28  1:28 UTC (permalink / raw)
  To: linux-mtd

Hello linux-mtd,

I recently encountered some UBIFS inconsistencies and tracked it back
to a pair of bugs in orphan delete. There is an assumption in
ubifs_delete_orphan that if the orphan cnext is NULL then it is not on
the cnext list, but that is incorrect for the last orphan on the cnext
list, which results in modifying freed memory. The same assumption is
made for the dnext list, which results in a double free. I am
including two patches that fix these issues by adding flags to
ubifs_orphan for pending commit and pending delete that are used
instead of checking cnext and dnext.

The cnext bug specifically was the cause of the inconsistencies I
encountered and is easy to reproduce. For example, repeatedly
untarring a root filesystem tarball and then removing those files
almost always results in inconsistencies in around 10 iterations. I do
not have a repro case for the dnext bug, I discovered that one due to
its similarity to the cnext list.

Thanks,
-Adam

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

end of thread, other threads:[~2013-02-04 10:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28  1:28 UBIFS: a pair of orphan bugs Adam Thomas
2013-01-28  1:28 ` [PATCH 1/2] UBIFS: fix use of freed ubifs_orphan objects Adam Thomas
2013-02-01 13:23   ` Adrian Hunter
2013-02-02 22:32     ` Adam Thomas
2013-02-02 22:32       ` [PATCH v2 " Adam Thomas
2013-02-04 10:31         ` Artem Bityutskiy
2013-01-28  1:28 ` [PATCH 2/2] UBIFS: fix double free of " Adam Thomas
2013-02-01 13:23   ` Adrian Hunter
2013-02-02 22:35     ` [PATCH v2 " Adam Thomas

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