[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <FC373DE9-6D6B-40C5-ACED-C07B1B524469@goldelico.com>
Date: Thu, 14 Jun 2018 14:12:14 +0200
From: "H. Nikolaus Schaller" <hns@...delico.com>
To: Tony Lindgren <tony@...mide.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Discussions about the Letux Kernel
<letux-kernel@...nphoenux.org>, kernel@...a-handheld.com
Subject: Re: BUG: drivers/pinctrl/core: races in pinctrl_groups and deferred probing
Hi Tony,
> Am 14.06.2018 um 14:01 schrieb Tony Lindgren <tony@...mide.com>:
>
> * H. Nikolaus Schaller <hns@...delico.com> [180613 12:41]:
>>
>> Now if I look into pinctrl_generic_add_group() and pinctrl_generic_get_group_name(),
>> pctldev->num_groups++ is not protected if pinctrl_generic_add_group() may be called by
>> two threads in parallel for the same pctldev. Hence a second thread may try to insert
>> a different node into the radix tree at the same selector index. This fails but there
>> is no error check - and the second entry is completely missing (but probably assumed to
>> be there).
>
> Sounds like pinctrl-single.c is missing mutex around calls to
> pinctrl_generic_add_group()?
Yes, that could be. I didn't research the call path, just the one of
devm_pinctrl_get(). That uses a mutex in
https://elixir.bootlin.com/linux/v4.17.1/source/drivers/pinctrl/core.c#L1021
Maybe a similar mutex is missing elsewhere.
BR,
Nikolaus
Powered by blists - more mailing lists