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

Submitted by Konstantin Khorenko on Dec. 8, 2016, 1:25 p.m.

Details

Message ID 201612081325.uB8DPP4e003124@finist_cl7.x64_64.work.ct
State New
Series "seccomp, ptrace: Fix typo in filter fetching"
Headers show

Commit Message

Konstantin Khorenko Dec. 8, 2016, 1:25 p.m.
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@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@openvz.org>
    Acked-by: Andrey Vagin <avagin@openvz.org>
    
     kernel/seccomp.c |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
---
 kernel/seccomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);