On Sun, 14 Aug 2005, Chuck Ebbert wrote:
>
> The first thing drivers/char/mem.c:read_kmem does is convert the
> loff_t it gets as the offset for reading into an unsigned int. This
> patch makes the kmem driver's llseek operator do that up-front, so
> that fs/read_write.c:rw_verify_area doesn't return -EINVAL when
> we try to read from higher addresses.
Why would rw_verify_area() return -EINVAL? It does
if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
goto Einval;
but pos and "loff_t" is 64-bit, and if the thing is negative in 64 bits,
then that thing really _should_ fail.
Yes, the thing needs to be opened with O_LARGEFILE and you need to use
"llseek()" to seek into it, but once you do that, everything should be
fine.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|