Commit cc996099 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Al Viro

[PATCH] proc: inode number fixlet

Ouch, if number taken from IDA is too big, the intent was to signal an
error, not check for overflow and still do overflowing addition.

One still needs 2^28 proc entries to notice this.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 6450f651
...@@ -330,6 +330,7 @@ static unsigned int get_inode_number(void) ...@@ -330,6 +330,7 @@ static unsigned int get_inode_number(void)
spin_lock(&proc_inum_lock); spin_lock(&proc_inum_lock);
ida_remove(&proc_inum_ida, i); ida_remove(&proc_inum_ida, i);
spin_unlock(&proc_inum_lock); spin_unlock(&proc_inum_lock);
return 0;
} }
return PROC_DYNAMIC_FIRST + i; return PROC_DYNAMIC_FIRST + i;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment