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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200306071122.71838-1-suqiang4@huawei.com>
Date:   Fri, 6 Mar 2020 15:11:22 +0800
From:   Qiang Su <suqiang4@...wei.com>
To:     <gregkh@...uxfoundation.org>, <suqiang4@...wei.com>
CC:     <linux-kernel@...r.kernel.org>, <leeyou.li@...wei.com>,
        <nixiaoming@...wei.com>
Subject: [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig

Now each uio device can only support 5 memory entry. It is
far from enough for some big system. On the other hand, the
hard-coded style is not flexible.
Consider the marco is used as array index, so we set a range
for the config in menuconfig. The range is set as 1 to 512.
The default value is still 5 to keep consistent with current
code.

Signed-off-by: Qiang Su <suqiang4@...wei.com>
---
 drivers/uio/Kconfig        | 9 +++++++++
 include/linux/uio_driver.h | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 202ee81cfc2b..31c53f1dd86a 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -165,4 +165,13 @@ config UIO_HV_GENERIC
 	  to network and storage devices from userspace.
 
 	  If you compile this as a module, it will be called uio_hv_generic.
+
+config UIO_MAX_UIO_MAPS
+	depends on UIO
+	int "Maximum of memory nodes each uio device support(1-512)"
+	range 1 512
+	default 5
+	help
+	  make the max number of uio device configurable.
+
 endif
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 01081c4726c0..efdf8f6bf8bf 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -44,7 +44,7 @@ struct uio_mem {
 	struct uio_map		*map;
 };
 
-#define MAX_UIO_MAPS	5
+#define MAX_UIO_MAPS	CONFIG_MAX_UIO_MAPS
 
 struct uio_portio;
 
-- 
2.12.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ