mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] fs/coredump: check return value of dump_emit()
@ 2022-08-23  5:54 lily
  0 siblings, 0 replies; only message in thread
From: lily @ 2022-08-23  5:54 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel; +Cc: viro, Li Zhong

Check dump_emit() return value to see whether it fails

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 fs/coredump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index 9f4aae202109..4f51bdcecc5e 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-23  5:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23  5:54 [PATCH v1] fs/coredump: check return value of dump_emit() lily

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

all inboxes | Powered by JetHome®