Skip to contentSkip to conversation

possible proc inode numbers overflow?

Q Kirill Korotaev 2 participants 2 messages Sep 24, 2004

lore
Share & tools
lore
#0 lore raw

fs/proc/generic.c:

#define PROC_DYNAMIC_FIRST 0xF0000000UL
static unsigned int get_inode_number(void)

{
	...
        inum = (i & MAX_ID_MASK) + PROC_DYNAMIC_FIRST;

        /* inum will never be more than 0xf0ffffff, so no check
         * for overflow.
         */
	...
}

is it really correct? Looks like MAX_ID_MASK = 0x7FFFFFFF and PROC_DYNAMIC_FIRST is 0xF0000000.

So at least the comment is wrong?

Kirill

#1 lore raw
Quoted 12 lines · Kirill Korotaev

fs/proc/generic.c:
#define PROC_DYNAMIC_FIRST 0xF0000000UL
static unsigned int get_inode_number(void)

{
	...
        inum = (i & MAX_ID_MASK) + PROC_DYNAMIC_FIRST;

        /* inum will never be more than 0xf0ffffff, so no check
         * for overflow.
         */
	...
}
Quoted 3 lines

is it really correct? Looks like MAX_ID_MASK = 0x7FFFFFFF and PROC_DYNAMIC_FIRST is 0xF0000000.
So at least the comment is wrong?

The comment is wrong. Albert Cahalan and I are working on a new fix.

-- wli