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: <87zgvmccg2.ffs@nanos.tec.linutronix.de>
Date:   Sat, 19 Jun 2021 13:37:33 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Marc Zyngier <maz@...nel.org>, linux-kernel@...r.kernel.org
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Ley Foon Tan <ley.foon.tan@...el.com>,
        Chris Zankel <chris@...kel.net>,
        Max Filippov <jcmvbkbc@...il.com>,
        Vineet Gupta <vgupta@...opsys.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Robert Jarzmik <robert.jarzmik@...e.fr>,
        Russell King <linux@...linux.org.uk>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Rob Clark <robdclark@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Lee Jones <lee.jones@...aro.org>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        kernel-team@...roid.com
Subject: Re: [PATCH 20/39] irqdomain: Protect the linear revmap with RCU

On Thu, May 20 2021 at 17:37, Marc Zyngier wrote:
>  static void irq_domain_clear_mapping(struct irq_domain *domain,
> @@ -902,12 +901,12 @@ unsigned int irq_find_mapping(struct irq_domain *domain,
>  		return 0;
>  	}
>  
> +	rcu_read_lock();
>  	/* Check if the hwirq is in the linear revmap. */
>  	if (hwirq < domain->revmap_size)
> -		return domain->revmap[hwirq]->irq;
> -
> -	rcu_read_lock();
> -	data = radix_tree_lookup(&domain->revmap_tree, hwirq);
> +		data = rcu_dereference(domain->revmap[hwirq]);
> +	else
> +		data = radix_tree_lookup(&domain->revmap_tree, hwirq);
>  	rcu_read_unlock();
>  	return data ? data->irq : 0;

This is wrong and was wrong before. This wants to be:

     irq = data ? data->irq : 0;
     rcu_read_unlock();
     return irq;

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ