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: Fri, 19 Jan 2024 13:20:17 +0000
From: Ian Abbott <abbotti@....co.uk>
To: Matt Hsiao <matt.hsiao@....com>
Cc: Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org,
	Ian Abbott <abbotti@....co.uk>
Subject: [PATCH 1/2] misc: hpilo: fix inconsistent device numbers

Each iLO device is allocated `max_ccb` minor device numbers (one for
each channel).  When `ilo_probe()` calls `device_create()` in a loop,
the minor device numbers passed to `device_create()` start at 0.  For
consistency with the call to `cdev_add()`, and for consistency with the
calls to `device_destroy()` from `ilo_remove()`, the minor device
numbers passed to `device_create()` should start at the value in the
variable `start`.  Fix it.

This is a logical bug rather than an actual bug, because the number of
supported devices is `MAX_ILO_DEV` which is defined as `1`.

Fixes: 89bcb05d9bbf ("HP iLO driver")
Signed-off-by: Ian Abbott <abbotti@....co.uk>
---
 drivers/misc/hpilo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
index f1b74d3f8958..3428a0bd5550 100644
--- a/drivers/misc/hpilo.c
+++ b/drivers/misc/hpilo.c
@@ -842,7 +842,7 @@ static int ilo_probe(struct pci_dev *pdev,
 	for (minor = 0 ; minor < max_ccb; minor++) {
 		struct device *dev;
 		dev = device_create(&ilo_class, &pdev->dev,
-				    MKDEV(ilo_major, minor), NULL,
+				    MKDEV(ilo_major, start + minor), NULL,
 				    "hpilo!d%dccb%d", devnum, minor);
 		if (IS_ERR(dev))
 			dev_err(&pdev->dev, "Could not create files\n");
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ