From: lily <floridsleeves@gmail.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] fs/coredump: check return value of dump_emit()
Date: Mon, 22 Aug 2022 22:54:37 -0700 [thread overview]
Message-ID: <20220823055437.1450407-1-floridsleeves@gmail.com> (raw)
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
reply other threads:[~2022-08-23 5:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220823055437.1450407-1-floridsleeves@gmail.com \
--to=floridsleeves@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®