]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[IA64] correct file descriptor reference counting in perfmon (CVE-2006-3741)
authorStephane Eranian <eranian@hpl.hp.com>
Tue, 17 Oct 2006 12:50:56 +0000 (14:50 +0200)
committerAdrian Bunk <bunk@stusta.de>
Tue, 17 Oct 2006 12:50:56 +0000 (14:50 +0200)
Fix a bug in sys_perfmonctl() whereby it was not correctly
decrementing the file descriptor reference count.

Signed-off-by: Stephane Eranian <eranian@hpl.hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
arch/ia64/kernel/perfmon.c

index 9c5194b385dab33ce122152ee665306fe2cbf761..9b42b02b85ed2910a65aa4e648f4f2a577138ead 100644 (file)
@@ -4937,13 +4937,15 @@ abort_locked:
        if (likely(ctx)) {
                DPRINT(("context unlocked\n"));
                UNPROTECT_CTX(ctx, flags);
-               fput(file);
        }
 
        /* copy argument back to user, if needed */
        if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT;
 
 error_args:
+       if (file)
+               fput(file);
+
        kfree(args_k);
 
        DPRINT(("cmd=%s ret=%ld\n", PFM_CMD_NAME(cmd), ret));