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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120914161848.GC28033@linux.vnet.ibm.com>
Date:	Fri, 14 Sep 2012 21:48:48 +0530
From:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Peter Zijlstra <peterz@...radead.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Anton Arapov <anton@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] uprobes: uprobes_treelock should not disable irqs

* Oleg Nesterov <oleg@...hat.com> [2012-08-19 18:40:37]:

> Nobody plays with uprobes_tree/uprobes_treelock in interrupt context,
> no need to disable irqs.
> 
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>

Acked-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>

> ---
>  kernel/events/uprobes.c |   21 ++++++++-------------
>  1 files changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 25c0d74..abe077e 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -413,11 +413,10 @@ static struct uprobe *__find_uprobe(struct inode *inode, loff_t offset)
>  static struct uprobe *find_uprobe(struct inode *inode, loff_t offset)
>  {
>  	struct uprobe *uprobe;
> -	unsigned long flags;
> 
> -	spin_lock_irqsave(&uprobes_treelock, flags);
> +	spin_lock(&uprobes_treelock);
>  	uprobe = __find_uprobe(inode, offset);
> -	spin_unlock_irqrestore(&uprobes_treelock, flags);
> +	spin_unlock(&uprobes_treelock);
> 
>  	return uprobe;
>  }
> @@ -464,12 +463,11 @@ static struct uprobe *__insert_uprobe(struct uprobe *uprobe)
>   */
>  static struct uprobe *insert_uprobe(struct uprobe *uprobe)
>  {
> -	unsigned long flags;
>  	struct uprobe *u;
> 
> -	spin_lock_irqsave(&uprobes_treelock, flags);
> +	spin_lock(&uprobes_treelock);
>  	u = __insert_uprobe(uprobe);
> -	spin_unlock_irqrestore(&uprobes_treelock, flags);
> +	spin_unlock(&uprobes_treelock);
> 
>  	/* For now assume that the instruction need not be single-stepped */
>  	uprobe->flags |= UPROBE_SKIP_SSTEP;
> @@ -707,11 +705,9 @@ remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vad
>   */
>  static void delete_uprobe(struct uprobe *uprobe)
>  {
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&uprobes_treelock, flags);
> +	spin_lock(&uprobes_treelock);
>  	rb_erase(&uprobe->rb_node, &uprobes_tree);
> -	spin_unlock_irqrestore(&uprobes_treelock, flags);
> +	spin_unlock(&uprobes_treelock);
>  	iput(uprobe->inode);
>  	put_uprobe(uprobe);
>  	atomic_dec(&uprobe_events);
> @@ -969,7 +965,6 @@ static void build_probe_list(struct inode *inode,
>  				struct list_head *head)
>  {
>  	loff_t min, max;
> -	unsigned long flags;
>  	struct rb_node *n, *t;
>  	struct uprobe *u;
> 
> @@ -977,7 +972,7 @@ static void build_probe_list(struct inode *inode,
>  	min = vaddr_to_offset(vma, start);
>  	max = min + (end - start) - 1;
> 
> -	spin_lock_irqsave(&uprobes_treelock, flags);
> +	spin_lock(&uprobes_treelock);
>  	n = find_node_in_range(inode, min, max);
>  	if (n) {
>  		for (t = n; t; t = rb_prev(t)) {
> @@ -995,7 +990,7 @@ static void build_probe_list(struct inode *inode,
>  			atomic_inc(&u->ref);
>  		}
>  	}
> -	spin_unlock_irqrestore(&uprobes_treelock, flags);
> +	spin_unlock(&uprobes_treelock);
>  }
> 
>  /*
> -- 
> 1.5.5.1
> 

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