[Devel] [PATCH rh7] seccomp, ptrace: Fix typo in filter fetching

Cyrill Gorcunov gorcunov at virtuozzo.com
Tue Dec 6 06:59:30 PST 2016


In commit 42b65fd18057d64410a0519962cd0650c762c99f there
is a typo: we need to copy the complete filter chain
not only first number.

https://jira.sw.ru/browse/PSBM-55593

CC: Andrey Vagin <avagin at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---

I am continue investigating the problem since tests
are not yet passed but this fix may be applied independently.

 kernel/seccomp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pcs7.git/kernel/seccomp.c
===================================================================
--- linux-pcs7.git.orig/kernel/seccomp.c
+++ linux-pcs7.git/kernel/seccomp.c
@@ -566,7 +566,7 @@ long seccomp_get_filter(struct task_stru
 	get_seccomp_filter(task);
 	spin_unlock_irq(&task->sighand->siglock);
 
-	if (copy_to_user(data, filter->insns, filter->len))
+	if (copy_to_user(data, filter->insns, filter->len * sizeof(filter->insns[0])))
 		ret = -EFAULT;
 
 	put_seccomp_filter(task);


More information about the Devel mailing list