Re: [REVIEW][PATCH 1/3] vfs: In d_path don't call d_dname on a mountpoint

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

 



Al Viro wrote:
> On Sat, Nov 30, 2013 at 05:02:26PM +0000, Al Viro wrote:
> 
> > FWIW, the other callers of prepend_path() boil down to /proc/mountinfo
> > handling, apparmour d_namespace_path() (separate handling of MNT_INTERNAL,
> > __d_path() or d_absolute_path() for the rest) and tomoyo_get_absolute_path()
> > (this one directly calls ->d_dname() itself).
> 
> While we are at it, what's the origin of if (buflen >= 256) checks in
> tomoyo_get_absolute_path() and tomoyo_get_dentry_path()?  The minimal
> buflen value they can be called with is PAGE_SIZE - 1.

This is a sanity check in case the caller by error called
tomoyo_get_absolute_path() or tomoyo_get_local_path() with buflen < 2, for
they might accesses buffer[buflen - 2].

But "PAGE_SIZE <= buf_len <= (UINT_MAX + 1) / 2" will be true because doing
buf_len <<= 1 will not make buf_len == 0 since kmalloc((UINT_MAX + 1) / 2)
will return NULL. Therefore, we can ignore/kill "if (buflen >= 256)" check.

Regards.
--
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