>
>With the recent changes for:
>
>  PSARC 2007/064 Unified POSIX and Windows Credentials for Solaris
>  4994017 data structure sharing between rpcbind and libnsl leads to accidents
>  6549510 Need the ability to store SIDs in the Solaris cred_t
>  6549515 PSARC 2007/064: uid_t and gid_t to become unsigned
>  
>
>the opensolaris kernel now panics with a simple file copy from a pcfs
>filesystem:  cp /path/to/a/file/on/a/pcfs/filesystem /tmp, e.g.
>cp /media/MightyDrive/onnv-gate.hg /tmp


Yes, I was told about this yesterday evening late and the fix seems
fairly simple.

In reality it's a bug in pcfs, I think, as it passes a NULL cred_t pointer to
a VOP_*.  But since my putback triggered it, I will fix it and I think
I may add some defensive code to VOP_XIDMAP.

>pc_rele() calls syncpcp(), which calls fop_putpage with a NULL cred_t ?

That seems wrong too; it's the only place in the kernel which calls
VOP_PUTPAGE with a NULL cred_t.

But since these are not well-defined interfaces "what used to work
should continue to work".

So I am thinking of fixing this as follows:

------- usr/src/uts/common/fs/pcfs/pc_node.c -------

22c22
<  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
---
>  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
210,211c210
<               err = VOP_PUTPAGE(PCTOV(pcp), (offset_t)0, (uint_t)0,
<                   flags, (struct cred *)0);
---
>               err = VOP_PUTPAGE(PCTOV(pcp), 0, 0, flags, kcred);

------- usr/src/uts/common/fs/vnode.c -------

157,159c157,161
<       vfs_t *vfsp = (vp)->v_vfsp;                                     \
<       if (vfsp != NULL && (vfsp->vfs_flag & VFS_XID) == 0)            \
<               cr = crgetmapped(cr);                                   \
---
>       if (cr != NULL) {                                               \
>               vfs_t *vfsp = (vp)->v_vfsp;                             \
>               if (vfsp != NULL && (vfsp->vfs_flag & VFS_XID) == 0)    \
>                       cr = crgetmapped(cr);                           \
>               }                                                       \

(the casts in pcfs probably predate the requirement for function prototypes
and are no longer needed)

I am half of a mind to add an "ASSERT(cr != NULL)" at that point so
debug kernels will still trip over this.

Casper
_______________________________________________
ufs-discuss mailing list
[email protected]

Reply via email to