summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-02-20 06:46:12 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2023-02-27 18:35:28 -0800
commitae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e (patch)
treec6be34e2933c06ce4ae1a972be5ff25f4600644f /fs/f2fs
parent981ee95cc1f5905ae4936b0dd501085909cdc14f (diff)
downloadlinux-stable-ae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e.tar.gz
linux-stable-ae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e.tar.bz2
linux-stable-ae3419fbac845b4d3f3a9fae4cc80c68d82cdf6e.zip
vc_screen: don't clobber return value in vcs_read
Commit 226fae124b2d ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF") moved the call to vcs_vc() into the loop. While doing this it also moved the unconditional assignment of ret = -ENXIO; This unconditional assignment was valid outside the loop but within it it clobbers the actual value of ret. To avoid this only assign "ret = -ENXIO" when actually needed. [ Also, the 'goto unlock_out" needs to be just a "break", so that it does the right thing when it exits on later iterations when partial success has happened - Linus ] Reported-by: Storm Dragon <stormdragon2976@gmail.com> Link: https://lore.kernel.org/lkml/Y%2FKS6vdql2pIsCiI@hotmail.com/ Fixes: 226fae124b2d ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/lkml/64981d94-d00c-4b31-9063-43ad0a384bde@t-8ch.de/ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/f2fs')
0 files changed, 0 insertions, 0 deletions