aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-02-12 03:51:43 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:27 -0500
commit215122e1110f97a3f478829049b9840cf8fdde57 (patch)
treed0da44b5e8fc9836dc4e3e5745234fa01f6a87d8 /fs
parent6ab8eb1cffcc5640ca5b07c2a0ddfaa8fbbcc754 (diff)
[PATCH] register_chrdev_region() don't hand out the LOCAL/EXPERIMENTAL majors
As pointed out in http://bugzilla.kernel.org/show_bug.cgi?id=7922, dynamic chardev major allocation can hand out majors which LANANA has defined as being for local/experimental use. Cc: Torben Mathiasen <device@lanana.org> Cc: Greg KH <greg@kroah.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Tomas Klas <tomas.klas@mepatek.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/char_dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index a885f46ca001..e6194e2b9bb9 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -108,6 +108,13 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
108 /* temporary */ 108 /* temporary */
109 if (major == 0) { 109 if (major == 0) {
110 for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) { 110 for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) {
111 /*
112 * Disallow the LANANA-assigned LOCAL/EXPERIMENTAL
113 * majors
114 */
115 if ((60 <= i && i <= 63) || (120 <= i && i <= 127) ||
116 (240 <= i && i <= 254))
117 continue;
111 if (chrdevs[i] == NULL) 118 if (chrdevs[i] == NULL)
112 break; 119 break;
113 } 120 }