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] [day] [month] [year] [list]
Message-ID: <CACRpkdZg7C9figdwiP5Lu9f_=EzWJgVdf7x8d=xCBUBzcZ44Lg@mail.gmail.com>
Date:	Mon, 12 Jan 2015 00:53:26 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Jim Lin <jilin@...dia.com>
Cc:	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] pinctrl: Fix two deadlocks

On Thu, Jan 8, 2015 at 1:25 PM, Jim Lin <jilin@...dia.com> wrote:

> This patch is to fix two deadlock cases.
> Deadlock 1:
> CPU #1
>  pinctrl_register-> pinctrl_get ->
>  create_pinctrl
>  (Holding lock pinctrl_maps_mutex)
>  -> get_pinctrl_dev_from_devname
>  (Trying to acquire lock pinctrldev_list_mutex)
> CPU #0
>  pinctrl_unregister
>  (Holding lock pinctrldev_list_mutex)
>  -> pinctrl_put ->> pinctrl_free ->
>  pinctrl_dt_free_maps -> pinctrl_unregister_map
>  (Trying to acquire lock pinctrl_maps_mutex)
>
> Simply to say
> CPU#1 is holding lock A and trying to acquire lock B,
> CPU#0 is holding lock B and trying to acquire lock A.
>
> Deadlock 2:
> CPU #3
>  pinctrl_register-> pinctrl_get ->
>  create_pinctrl
>  (Holding lock pinctrl_maps_mutex)
>  -> get_pinctrl_dev_from_devname
>  (Trying to acquire lock pinctrldev_list_mutex)
> CPU #2
>  pinctrl_unregister
>  (Holding lock pctldev->mutex)
>  -> pinctrl_put ->> pinctrl_free ->
>  pinctrl_dt_free_maps -> pinctrl_unregister_map
>  (Trying to acquire lock pinctrl_maps_mutex)
> CPU #0
>  tegra_gpio_request
>  (Holding lock pinctrldev_list_mutex)
>  -> pinctrl_get_device_gpio_range
>  (Trying to acquire lock pctldev->mutex)
>
> Simply to say
> CPU#3 is holding lock A and trying to acquire lock D,
> CPU#2 is holding lock B and trying to acquire lock A,
> CPU#0 is holding lock D and trying to acquire lock B.
>
> Signed-off-by: Jim Lin <jilin@...dia.com>

Impressive and good catch. Applied to fixes and tagged for stable!

Yours,
Linus Walleij
--
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