-
John Engel authored
Here's a patch to fix a bug in compat_sys_fcntl64 in fs/compat.c. The bug occurs with a 32 bit app that calls fcntl and checking for a lock near the end of a file. struct flock sflp; sflp.l_start = 2147483345; sflp.l_len = 302; /* 2147483345 + 302 == 2147483647 (this should not overflow 31 bits) */ /* 2^31 == 2147483648 */ fcntl_stat = fcntl(fd, F_GETLK, &sflp); The patch also contains a fix to handle l_len < 0 which is now defined in POSIX 1003.1-2001 from the fcntl man page. Signed-off-by: John Engel <jhe@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
4e14dc19