question about the function rw_verify_area

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

   Since the kernel 2.6.10 the rw_verify_area checks if the position in
the file is not a negative value. 

   When I try to read by /dev/kmem a virtual memory address (which can
be negative) I have a problem because the rw_verify_area failed.

   I modified the code to do the check only if we try to read a filed
other than /dev/kmem (major=1, minor=2) and it's work.

   Why this check has been added ? Is it possible to detect that the
file can be read virtual memory address which can be negative ?

   My first fix is

   if (!(imajor(inode) == 1 && iminor(inode) == 2))
   {
         if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
                goto Einval;    
    
   }

   Is it a better way to do this ? 

Thanks
Jean-Bernard DAMIANO


-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux