WSL2-Linux-Kernel/drivers/w1
Marcin Jurkowski 9d1817cab2 w1: fix oops when w1_search is called from netlink connector
On Sat, Mar 02, 2013 at 10:45:10AM +0100, Sven Geggus wrote:
> This is the bad commit I found doing git bisect:
> 04f482faf5 is the first bad commit
> commit 04f482faf5
> Author: Patrick McHardy <kaber@trash.net>
> Date:   Mon Mar 28 08:39:36 2011 +0000

Good job. I was too lazy to bisect for bad commit;)

Reading the code I found problematic kthread_should_stop call from netlink
connector which causes the oops. After applying a patch, I've been testing
owfs+w1 setup for nearly two days and it seems to work very reliable (no
hangs, no memleaks etc).
More detailed description and possible fix is given below:

Function w1_search can be called from either kthread or netlink callback.
While the former works fine, the latter causes oops due to kthread_should_stop
invocation.

This patch adds a check if w1_search is serving netlink command, skipping
kthread_should_stop invocation if so.

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Josh Boyer <jwboyer@gmail.com>
Tested-by: Sven Geggus <lists@fuchsschwanzdomain.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@vger.kernel.org> # 3.0+
2013-03-12 16:20:46 -07:00
..
masters w1-gpio: fix unused variable warning 2013-03-12 16:20:46 -07:00
slaves w1: add support for DS2413 Dual Channel Addressable Switch 2013-02-27 19:10:23 -08:00
Kconfig Kconfig: replace "--- help ---" with "---help---" 2012-05-07 15:01:22 +02:00
Makefile [PATCH] better CONFIG_W1_SLAVE_DS2433_CRC handling 2006-12-07 08:39:43 -08:00
w1.c w1: fix oops when w1_search is called from netlink connector 2013-03-12 16:20:46 -07:00
w1.h W1: split master mutex to avoid deadlocks. 2012-06-13 16:38:40 -07:00
w1_family.c drivers/w1: Add export.h for EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:32:00 -04:00
w1_family.h w1: add support for DS2413 Dual Channel Addressable Switch 2013-02-27 19:10:23 -08:00
w1_int.c w1: Fix a typo in 'hardware' word 2012-06-18 16:41:06 -07:00
w1_int.h MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00
w1_io.c w1: Disable irqs during 1-wire bus operations, extend 1-wire reset pulse 2012-04-11 16:44:10 -07:00
w1_log.h MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00
w1_netlink.c MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00
w1_netlink.h MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00