NULL loc in posix_acl_truncate

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

 



here is a bug in release-3.3:

./xinstall -c -p -r -m 555 xinstall
/pfs/manu/netbsd/usr/src/tooldir.NetBSD-6.99.4-i386/bin/i386--netbsdelf-instal
xinstall: /pfs/manu/netbsd/usr/src/tooldir.NetBSD-6.99.4-i386/bin/inst.00033a:
chmod: Permission denied

Kernel trace, client side:
    33      1 xinstall CALL  open(0xbfbfd8e0,0xa02,0x180)
    33      1 xinstall NAMI
"/pfs/manu/netbsd/usr/src/tooldir.NetBSD-6.99.4-i38
6/bin/inst.00033a"
    33      1 xinstall RET   open 3
    33      1 xinstall CALL  open(0x
(...)
    33      1 xinstall CALL  fchmod(3,0x16d)
    33      1 xinstall RET   fchmod -1 errno 13 Permission denied


I tracked this down to posix_acl_truncate() on the server, where loc->inode
and loc->pah are NULL. This code goes red and raise EACCESS:

        if (acl_permits (frame, loc->inode, POSIX_ACL_WRITE))
                goto green;
        else
                goto red;

Here is the relevant baccktrace:

#9  0xb99d1ca6 in posix_acl_truncate (frame=0xbb77f780, this=0xb9d20000, 
    loc=0xb9d41020, off=48933, xdata=0x0) at posix-acl.c:898
#10 0xb99ba4f8 in truncate_stat_cbk (frame=0xbb77f400, cookie=0xbb77f6a0, 
    this=0xb9d22000, op_ret=0, op_errno=0, buf=0xb89ffac4, xdata=0x0)
    at posix.c:204
#11 0xbbb87933 in default_stat_cbk (frame=0xbb77f6a0, cookie=0xbb77f710, 
    this=0xb9d20000, op_ret=0, op_errno=0, buf=0xb89ffac4, xdata=0x0)
    at defaults.c:47
#12 0xb99e1751 in posix_stat (frame=0xbb77f710, this=0xb9d1f000, 
    loc=0xba60091c, xdata=0x0) at posix.c:231

In frame 12, loc->inode is not NULL, and loc->path makes sense:
"<gfid:9d92d4e5-2e70-4183-ab97-39fe2b5380b3>/netbsd/usr/src/tooldir.NetBSD-6.9
9.4-i386/bin/inst.01911a"

In frame 10, loc->path and loc->inode are NULL.

In note that xlators/features/locks/src/posix.c:pl_ftruncate() sets
truncate_stat_cbk() as the callback, and not ftruncate_stat_cbk(). That later
function does not even exist. f-style functions not calling f-style callbacks
have been the root of various bugs so far, is it one more of them?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@xxxxxxxxxx



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux