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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon,  7 Nov 2016 15:56:37 -0500
From:   Chris Metcalf <cmetcalf@...lanox.com>
To:     linux-kernel@...r.kernel.org,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Chris Metcalf <cmetcalf@...lanox.com>
Subject: [PATCH] tile-srom: allow the driver to be built as a module

The code was already configured that way, but the Kconfig
file didn't support requesting it.

A buglet caused a null pointer deref when unloading the
module, but this commit also corrects that issue.

Signed-off-by: Chris Metcalf <cmetcalf@...lanox.com>
---
This is in response to Paul's patch (see the in-reply-to) suggesting
we remove the module infrastructure from the code instead.

I can push this via the tile tree since it's a tile-only device,
or Greg, if you'd prefer to take it via your tree, that's fine too.

 drivers/char/Kconfig     | 2 +-
 drivers/char/tile-srom.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index dcc09739a54e..70124ca5c33d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -578,7 +578,7 @@ config DEVPORT
 source "drivers/s390/char/Kconfig"
 
 config TILE_SROM
-	bool "Character-device access via hypervisor to the Tilera SPI ROM"
+	tristate "Character-device access via hypervisor to the Tilera SPI ROM"
 	depends on TILE
 	default y
 	---help---
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c
index 398800edb2cc..3d4cca64b2d4 100644
--- a/drivers/char/tile-srom.c
+++ b/drivers/char/tile-srom.c
@@ -312,7 +312,8 @@ ATTRIBUTE_GROUPS(srom_dev);
 
 static char *srom_devnode(struct device *dev, umode_t *mode)
 {
-	*mode = S_IRUGO | S_IWUSR;
+	if (mode)
+		*mode = 0644;
 	return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev));
 }
 
-- 
2.7.2

Powered by blists - more mailing lists