projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a41691
)
chardev: add additional check for minor range overlap
author
Chengguang Xu
<cgxu519@gmx.com>
Fri, 15 Feb 2019 12:27:11 +0000
(20:27 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 2 Apr 2019 15:49:58 +0000
(17:49 +0200)
Current overlap checking cannot correctly handle
a case which is baseminor < existing baseminor &&
baseminor + minorct > existing baseminor + minorct.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/char_dev.c
patch
|
blob
|
history
diff --git
a/fs/char_dev.c
b/fs/char_dev.c
index
a279c58
..
8a63cfa
100644
(file)
--- a/
fs/char_dev.c
+++ b/
fs/char_dev.c
@@
-159,6
+159,12
@@
__register_chrdev_region(unsigned int major, unsigned int baseminor,
ret = -EBUSY;
goto out;
}
+
+ if (new_min < old_min && new_max > old_max) {
+ ret = -EBUSY;
+ goto out;
+ }
+
}
cd->next = *cp;