summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/auth.c
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2020-12-30 06:56:04 -0800
committerRichard Weinberger <richard@nod.at>2021-02-12 21:53:22 +0100
commit19646447ad3a680d2ab08c097585b7d96a66126b (patch)
tree4a0bf44a6db2070ca475fbc5de4b8b36d7dc37b0 /fs/ubifs/auth.c
parent3b638f997a3551b922dee5d8371208c9017ab7f9 (diff)
downloadlinux-19646447ad3a680d2ab08c097585b7d96a66126b.tar.gz
linux-19646447ad3a680d2ab08c097585b7d96a66126b.tar.bz2
linux-19646447ad3a680d2ab08c097585b7d96a66126b.zip
jffs2: fix use after free in jffs2_sum_write_data()
clang static analysis reports this problem fs/jffs2/summary.c:794:31: warning: Use of memory after it is freed c->summary->sum_list_head = temp->u.next; ^~~~~~~~~~~~ In jffs2_sum_write_data(), in a loop summary data is handles a node at a time. When it has written out the node it is removed the summary list, and the node is deleted. In the corner case when a JFFS2_FEATURE_RWCOMPAT_COPY is seen, a call is made to jffs2_sum_disable_collecting(). jffs2_sum_disable_collecting() deletes the whole list which conflicts with the loop's deleting the list by parts. To preserve the old behavior of stopping the write midway, bail out of the loop after disabling summary collection. Fixes: 6171586a7ae5 ("[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.") Signed-off-by: Tom Rix <trix@redhat.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/auth.c')
0 files changed, 0 insertions, 0 deletions