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]
Date:	Mon,  9 Sep 2013 20:01:01 +0200
From:	Tom Gundersen <teg@...m.no>
To:	linux-modules@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Tom Gundersen <teg@...m.no>,
	Kay Sievers <kay@...y.org>,
	Lucas De Marchi <lucas.demarchi@...fusion.mobi>
Subject: [PATCH] depmod: warn on invalid devname specification

During the last merge window (3.12) a couple of modules gained devname
aliases, but without the necessary major and minor information. These were
then silently ignored when generating modules.devname.

Complain loudly to avoid such errors sneaking in undetected in the future:

    depmod: ERROR: Module 'zram' has devname (zram) but lacks major and minor information. Ignoring.
    depmod: ERROR: Module 'uhid' has devname (uhid) but lacks major and minor information. Ignoring.

Cc: Kay Sievers <kay@...y.org>
Cc: Lucas De Marchi <lucas.demarchi@...fusion.mobi>
---
 tools/depmod.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/depmod.c b/tools/depmod.c
index 985cf3a..5855b2a 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2120,11 +2120,18 @@ static int output_devname(struct depmod *depmod, FILE *out)
 				minor = min;
 			}
 
-			if (type != '\0' && devname != NULL) {
+			if (type != '\0' && devname != NULL)
+				break;
+		}
+
+		if (devname != NULL) {
+			if (type != '\0')
 				fprintf(out, "%s %s %c%u:%u\n", mod->modname,
 					devname, type, major, minor);
-				break;
-			}
+			else
+				ERR("Module '%s' has devname (%s) but "
+				    "lacks major and minor information. "
+				    "Ignoring.\n", mod->modname, devname);
 		}
 	}
 
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ