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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457088659-12321-1-git-send-email-sudipm.mukherjee@gmail.com>
Date:	Fri,  4 Mar 2016 16:20:59 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	linux-kernel@...r.kernel.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	<stable@...r.kernel.org>
Subject: [PATCH] parport: register driver later

If the parport bus is not yet registered and any device using parallel
port tries to register with the bus we get a stackdump with a message
of Kernel bug.

Reported-by: Fengguang Wu <fengguang.wu@...el.com>
Tested-by: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: <stable@...r.kernel.org> # 4.2+ 
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
---

We should actually have some deferred probe here. But considering that
you will be closing your trees soon so a quick fix to solve the problem
for now. We will revisit this when we remove the old api (hopefully v4.7).

 drivers/parport/share.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 3308427..176b2b6 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -273,6 +273,9 @@ int __parport_register_driver(struct parport_driver *drv, struct module *owner,
 		/* using device model */
 		int ret;
 
+		if (!parport_bus_type.p)
+			return -EAGAIN;
+
 		/* initialize common driver fields */
 		drv->driver.name = drv->name;
 		drv->driver.bus = &parport_bus_type;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ