alistair23-linux/fs/ubifs
Julia Lawall 7074e5eb23 UBIFS: remove invalid reference to list iterator variable
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure.  Thus this value should not be used after
the end of the iterator.  Replace a field access from orphan by NULL in two
places.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier c;
expression E;
iterator name list_for_each_entry;
statement S;
@@

list_for_each_entry(c,...) { ... when != break;
                                 when forall
                                 when strict
}
...
(
c = E
|
*c
)
// </smpl>

Artem: fortunately, this did not cause any issues because we iterate the orphan
list using the elements count, so we never dereferenced the corrupted pointer.
This is why I do not send this patch to -stable. But otherwise - well spotted!

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-07-20 10:27:25 +03:00
..
budget.c
commit.c UBIFS: get rid of dbg_err 2012-05-16 20:11:23 +03:00
compress.c
debug.c UBIFS: add debugfs knob to switch to R/O mode 2012-07-20 10:27:25 +03:00
debug.h UBIFS: add debugfs knob to switch to R/O mode 2012-07-20 10:27:25 +03:00
dir.c UBIFS: fix compilation warning 2012-07-20 10:27:25 +03:00
file.c UBIFS: rename dumping functions 2012-05-16 19:15:56 +03:00
find.c UBIFS: fix assertion 2012-06-18 14:17:08 +03:00
gc.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
io.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
ioctl.c
journal.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
Kconfig UBIFS: remove Kconfig debugging option 2012-05-16 19:53:46 +03:00
key.h
log.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
lprops.c UBIFS: remove Kconfig debugging option 2012-05-16 19:53:46 +03:00
lpt.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
lpt_commit.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
Makefile UBIFS: remove Kconfig debugging option 2012-05-16 19:53:46 +03:00
master.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
misc.h
orphan.c UBIFS: remove invalid reference to list iterator variable 2012-07-20 10:27:25 +03:00
recovery.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
replay.c UBIFS: simplify reply code a bit 2012-07-20 10:27:25 +03:00
sb.c UBIFS: fix a bug in empty space fix-up 2012-07-20 10:13:27 +03:00
scan.c UBIFS: get rid of dbg_err 2012-05-16 20:11:23 +03:00
shrinker.c
super.c avoid iput() from flusher thread 2012-05-28 09:54:45 -07:00
tnc.c UBIFS: 2012-05-22 19:30:27 -07:00
tnc_commit.c UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
tnc_misc.c UBIFS: get rid of dbg_err 2012-05-16 20:11:23 +03:00
ubifs-media.h
ubifs.h UBI: Kill data type hint 2012-05-20 20:25:59 +03:00
xattr.c UBIFS: 2012-05-22 19:30:27 -07:00