lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Oct 2010 13:02:57 -0700
From:	Matt Helsley <matthltc@...ibm.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jason Baron <jbaron@...hat.com>, linux-kernel@...r.kernel.org,
	David Miller <davem@...emloft.net>,
	Mike Galbraith <efault@....de>,
	Matt Helsley <matthltc@...ibm.com>
Subject: Re: [RFC][PATCH 1/7] perf: Fix task refcount issues

On Thu, Oct 14, 2010 at 10:34:05PM +0200, Peter Zijlstra wrote:
> Currently it looks like find_lively_task_by_vpid() takes a task ref
> and relies on find_get_context() to drop it.
> 
> The problem is that perf_event_create_kernel_counter() shouldn't be
> dropping task refs.

Doh.

Looks good.

Acked-by: Matt Helsley <matthltc@...ibm.com>

> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Matt Helsley <matthltc@...ibm.com>
> ---
>  kernel/perf_event.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/kernel/perf_event.c
> ===================================================================
> --- linux-2.6.orig/kernel/perf_event.c
> +++ linux-2.6/kernel/perf_event.c
> @@ -2124,11 +2124,9 @@ find_get_context(struct pmu *pmu, struct
>  		}
>  	}
> 
> -	put_task_struct(task);
>  	return ctx;
> 
>  errout:
> -	put_task_struct(task);
>  	return ERR_PTR(err);
>  }
> 
> @@ -5536,7 +5534,7 @@ SYSCALL_DEFINE5(perf_event_open,
>  	ctx = find_get_context(pmu, task, cpu);
>  	if (IS_ERR(ctx)) {
>  		err = PTR_ERR(ctx);
> -		goto err_group_fd;
> +		goto err_task;
>  	}
> 
>  	/*
> @@ -5632,6 +5630,9 @@ SYSCALL_DEFINE5(perf_event_open,
> 
>  err_context:
>  	put_ctx(ctx);
> +err_task:
> +	if (task)
> +		put_task_struct(task);
>  err_group_fd:
>  	fput_light(group_file, fput_needed);
>  	free_event(event);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ