Skip to contentSkip to conversation

fs/coredump: check return value of dump_emit()

PATCH New lily 1 participant 1 message Aug 23, 2022 VFS

lore
Share & tools
lore

lily

author
#0 lore raw

PATCH 1/1 fs/coredump: check return value of dump_emit()

Check dump_emit() return value to see whether it fails

---
 fs/coredump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/coredump.c +2 -1
index 9f4aae202109..4f51bdcecc5e 100644
@@ -762,7 +762,8 @@ void do_coredump(const kernel_siginfo_t *siginfo)
 		 */
 		if (cprm.to_skip) {
 			cprm.to_skip--;
-			dump_emit(&cprm, "", 1);
+			if (!dump_emit(&cprm, "", 1))
+				goto close_fail;
 		}
 		file_end_write(cprm.file);
 		free_vma_snapshot(&cprm);
Signature · 1 line
2.25.1