[Devel] [PATCH RHEL7 COMMIT] ms/seccomp, ptrace: Fix typo in filter fetching

Konstantin Khorenko khorenko at virtuozzo.com
Thu Dec 8 05:25:25 PST 2016


The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.12
------>
commit 9dddf0e42078cf17623db7ae0db2774c875bcac7
Author: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Date:   Thu Dec 8 17:25:25 2016 +0400

    ms/seccomp, ptrace: Fix typo in filter fetching
    
    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
    
    To be merged into 42b65fd ("ms/seccomp, ptrace: add support for dumping seccomp
    filters").
    
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
    Acked-by: Andrey Vagin <avagin at openvz.org>
    
     kernel/seccomp.c |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
---
 kernel/seccomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 574b784..b5f6d50 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -566,7 +566,7 @@ long seccomp_get_filter(struct task_struct *task, unsigned long filter_off,
 	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