* + pps-do-not-crash-when-failed-to-register.patch added to -mm tree
@ 2016-07-14 22:09 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2016-07-14 22:09 UTC (permalink / raw)
To: jslaby, giometti, stable, mm-commits
The patch titled
Subject: pps: do not crash when failed to register
has been added to the -mm tree. Its filename is
pps-do-not-crash-when-failed-to-register.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/pps-do-not-crash-when-failed-to-register.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/pps-do-not-crash-when-failed-to-register.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Jiri Slaby <jslaby@suse.cz>
Subject: pps: do not crash when failed to register
With this command sequence:
modprobe plip
modprobe pps_parport
rmmod pps_parport
the partport_pps modules causes this crash:
===
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffffa110301d>] parport_detach+0x1d/0x60 [pps_parport]
Oops: 0000 [#1] SMP
...
Call Trace:
[<ffffffffa036a185>] parport_unregister_driver+0x65/0xc0 [parport]
[<ffffffff810ff667>] SyS_delete_module+0x187/0x210
===
1) plip is loaded and takes the parport device for exclusive use:
plip0: Parallel port at 0x378, using IRQ 7.
2) pps_parport then fails to grab the device:
pps_parport: parallel port PPS client
parport0: cannot grant exclusive access for device pps_parport
pps_parport: couldn't register with parport0
3) rmmod of pps_parport is then killed because it tries to access
pardev->name, but pardev (taken from port->cad) is NULL.
So add a check for NULL in the test there too.
Link: http://lkml.kernel.org/r/20160714115245.12651-1-jslaby@suse.cz
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/pps/clients/pps_parport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/pps/clients/pps_parport.c~pps-do-not-crash-when-failed-to-register drivers/pps/clients/pps_parport.c
--- a/drivers/pps/clients/pps_parport.c~pps-do-not-crash-when-failed-to-register
+++ a/drivers/pps/clients/pps_parport.c
@@ -195,7 +195,7 @@ static void parport_detach(struct parpor
struct pps_client_pp *device;
/* FIXME: oooh, this is ugly! */
- if (strcmp(pardev->name, KBUILD_MODNAME))
+ if (!pardev || strcmp(pardev->name, KBUILD_MODNAME))
/* not our port */
return;
_
Patches currently in -mm which might be from jslaby@suse.cz are
pps-do-not-crash-when-failed-to-register.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-14 22:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 22:09 + pps-do-not-crash-when-failed-to-register.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).