103 static int fifo_getsecattr(struct vnode *, vsecattr_t *, int, struct cred *,
104 caller_context_t *);
105
106 /* functions local to this file */
107 static boolean_t fifo_stayfast_enter(fifonode_t *);
108 static void fifo_stayfast_exit(fifonode_t *);
109
110 /*
111 * Define the data structures external to this file.
112 */
113 extern dev_t fifodev;
114 extern struct qinit fifo_stwdata;
115 extern struct qinit fifo_strdata;
116 extern kmutex_t ftable_lock;
117
118 struct streamtab fifoinfo = { &fifo_strdata, &fifo_stwdata, NULL, NULL };
119
120 struct vnodeops *fifo_vnodeops;
121
122 const fs_operation_def_t fifo_vnodeops_template[] = {
123 VOPNAME_OPEN, { .vop_open = fifo_open },
124 VOPNAME_CLOSE, { .vop_close = fifo_close },
125 VOPNAME_READ, { .vop_read = fifo_read },
126 VOPNAME_WRITE, { .vop_write = fifo_write },
127 VOPNAME_IOCTL, { .vop_ioctl = fifo_ioctl },
128 VOPNAME_GETATTR, { .vop_getattr = fifo_getattr },
129 VOPNAME_SETATTR, { .vop_setattr = fifo_setattr },
130 VOPNAME_ACCESS, { .vop_access = fifo_access },
131 VOPNAME_CREATE, { .vop_create = fifo_create },
132 VOPNAME_FSYNC, { .vop_fsync = fifo_fsync },
133 VOPNAME_INACTIVE, { .vop_inactive = fifo_inactive },
134 VOPNAME_FID, { .vop_fid = fifo_fid },
135 VOPNAME_RWLOCK, { .vop_rwlock = fifo_rwlock },
136 VOPNAME_RWUNLOCK, { .vop_rwunlock = fifo_rwunlock },
137 VOPNAME_SEEK, { .vop_seek = fifo_seek },
138 VOPNAME_REALVP, { .vop_realvp = fifo_realvp },
139 VOPNAME_POLL, { .vop_poll = fifo_poll },
140 VOPNAME_PATHCONF, { .vop_pathconf = fifo_pathconf },
141 VOPNAME_DISPOSE, { .error = fs_error },
142 VOPNAME_SETSECATTR, { .vop_setsecattr = fifo_setsecattr },
143 VOPNAME_GETSECATTR, { .vop_getsecattr = fifo_getsecattr },
144 NULL, NULL
145 };
146
147 /*
148 * Return the fifoinfo structure.
149 */
150 struct streamtab *
151 fifo_getinfo()
152 {
153 return (&fifoinfo);
154 }
155
156 /*
157 * Trusted Extensions enforces a restrictive policy for
158 * writing via cross-zone named pipes. A privileged global
159 * zone process may expose a named pipe by loopback mounting
160 * it from a lower-level zone to a higher-level zone. The
161 * kernel-enforced mount policy for lofs mounts ensures
162 * that such mounts are read-only in the higher-level
163 * zone. But this is not sufficient to prevent writing
164 * down via fifos. This function prevents writing down
|
103 static int fifo_getsecattr(struct vnode *, vsecattr_t *, int, struct cred *,
104 caller_context_t *);
105
106 /* functions local to this file */
107 static boolean_t fifo_stayfast_enter(fifonode_t *);
108 static void fifo_stayfast_exit(fifonode_t *);
109
110 /*
111 * Define the data structures external to this file.
112 */
113 extern dev_t fifodev;
114 extern struct qinit fifo_stwdata;
115 extern struct qinit fifo_strdata;
116 extern kmutex_t ftable_lock;
117
118 struct streamtab fifoinfo = { &fifo_strdata, &fifo_stwdata, NULL, NULL };
119
120 struct vnodeops *fifo_vnodeops;
121
122 const fs_operation_def_t fifo_vnodeops_template[] = {
123 { VOPNAME_OPEN, { .vop_open = fifo_open } },
124 { VOPNAME_CLOSE, { .vop_close = fifo_close } },
125 { VOPNAME_READ, { .vop_read = fifo_read } },
126 { VOPNAME_WRITE, { .vop_write = fifo_write } },
127 { VOPNAME_IOCTL, { .vop_ioctl = fifo_ioctl } },
128 { VOPNAME_GETATTR, { .vop_getattr = fifo_getattr } },
129 { VOPNAME_SETATTR, { .vop_setattr = fifo_setattr } },
130 { VOPNAME_ACCESS, { .vop_access = fifo_access } },
131 { VOPNAME_CREATE, { .vop_create = fifo_create } },
132 { VOPNAME_FSYNC, { .vop_fsync = fifo_fsync } },
133 { VOPNAME_INACTIVE, { .vop_inactive = fifo_inactive } },
134 { VOPNAME_FID, { .vop_fid = fifo_fid } },
135 { VOPNAME_RWLOCK, { .vop_rwlock = fifo_rwlock } },
136 { VOPNAME_RWUNLOCK, { .vop_rwunlock = fifo_rwunlock } },
137 { VOPNAME_SEEK, { .vop_seek = fifo_seek } },
138 { VOPNAME_REALVP, { .vop_realvp = fifo_realvp } },
139 { VOPNAME_POLL, { .vop_poll = fifo_poll } },
140 { VOPNAME_PATHCONF, { .vop_pathconf = fifo_pathconf } },
141 { VOPNAME_DISPOSE, { .error = fs_error } },
142 { VOPNAME_SETSECATTR, { .vop_setsecattr = fifo_setsecattr } },
143 { VOPNAME_GETSECATTR, { .vop_getsecattr = fifo_getsecattr } },
144 { NULL, { NULL } }
145 };
146
147 /*
148 * Return the fifoinfo structure.
149 */
150 struct streamtab *
151 fifo_getinfo()
152 {
153 return (&fifoinfo);
154 }
155
156 /*
157 * Trusted Extensions enforces a restrictive policy for
158 * writing via cross-zone named pipes. A privileged global
159 * zone process may expose a named pipe by loopback mounting
160 * it from a lower-level zone to a higher-level zone. The
161 * kernel-enforced mount policy for lofs mounts ensures
162 * that such mounts are read-only in the higher-level
163 * zone. But this is not sufficient to prevent writing
164 * down via fifos. This function prevents writing down
|