Add patch to fix list corruption from pinctrl (rhbz 1051918)

This commit is contained in:
Josh Boyer 2014-02-12 13:46:50 -05:00
parent 54301896e7
commit f9e0ff0ada
2 changed files with 46 additions and 0 deletions

View File

@ -779,6 +779,9 @@ Patch25189: tick-Clear-broadcast-pending-bit-when-switching-to-oneshot.patch
#rhbz 1045755
Patch25195: cgroup-fixes.patch
#rhbz 1051918
Patch25198: pinctrl-protect-pinctrl_list-add.patch
# END OF PATCH DEFINITIONS
%endif
@ -1497,6 +1500,10 @@ ApplyPatch tick-Clear-broadcast-pending-bit-when-switching-to-oneshot.patch
#rhbz 1045755
ApplyPatch cgroup-fixes.patch
#rhbz 1051918
ApplyPatch pinctrl-protect-pinctrl_list-add.patch
# END OF PATCH APPLICATIONS
%endif
@ -2310,6 +2317,7 @@ fi
%changelog
* Wed Feb 12 2014 Josh Boyer <jwboyer@fedoraproject.org>
- Add patch to fix list corruption from pinctrl (rhbz 1051918)
- Fix cgroup destroy oops (rhbz 1045755)
- Fix backtrace in amd_e400_idle (rhbz 1031296)
- CVE-2014-1874 SELinux: local denial of service (rhbz 1062356 1062507)

View File

@ -0,0 +1,38 @@
From 7b320cb1ed2dbd2c5f2a778197baf76fd6bf545a Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Tue, 4 Feb 2014 09:07:09 +0100
Subject: [PATCH] pinctrl: protect pinctrl_list add
We have few fedora bug reports about list corruption on pinctrl,
for example:
https://bugzilla.redhat.com/show_bug.cgi?id=1051918
Most likely corruption happen due lack of protection of pinctrl_list
when adding new nodes to it. Patch corrects that.
Fixes: 42fed7ba44e ("pinctrl: move subsystem mutex to pinctrl_dev struct")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 5ee61a4..cab020a 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -851,7 +851,9 @@ static struct pinctrl *create_pinctrl(struct device *dev)
kref_init(&p->users);
/* Add the pinctrl handle to the global list */
+ mutex_lock(&pinctrl_list_mutex);
list_add_tail(&p->node, &pinctrl_list);
+ mutex_unlock(&pinctrl_list_mutex);
return p;
}
--
1.8.5.3