[CRIU] [PATCH] parasite: Make sure the arguments passed do never overwrite args zone

Cyrill Gorcunov gorcunov at openvz.org
Wed Sep 19 05:01:34 EDT 2012


We do have build-time tests for that but it's not enough, better to
be on safe side and double check the arguments size.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 64cc4c6..a912d30 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -228,6 +228,8 @@ static int parasite_execute_by_pid(unsigned long cmd, struct parasite_ctl *ctl,
 	int ret;
 	user_regs_struct_t regs_orig, regs;
 
+	BUG_ON(args_size > PARASITE_ARG_SIZE);
+
 	if (ctl->pid == pid)
 		regs = ctl->regs_orig;
 	else {
-- 
1.7.7.6



More information about the CRIU mailing list