2 * Copyright (c) 2004-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #include <linux/compat.h>
19 #include <linux/init.h>
20 #include <linux/ioctl.h>
21 #include <linux/syscalls.h>
22 #include <linux/types.h>
24 #include <asm/uaccess.h>
30 #include "xfs_trans.h"
34 #include "xfs_dmapi.h"
35 #include "xfs_mount.h"
36 #include "xfs_bmap_btree.h"
37 #include "xfs_attr_sf.h"
38 #include "xfs_dir2_sf.h"
39 #include "xfs_vnode.h"
40 #include "xfs_dinode.h"
41 #include "xfs_inode.h"
42 #include "xfs_itable.h"
43 #include "xfs_error.h"
44 #include "xfs_dfrag.h"
45 #include "xfs_vnodeops.h"
46 #include "xfs_fsops.h"
47 #include "xfs_alloc.h"
48 #include "xfs_rtalloc.h"
50 #include "xfs_ioctl.h"
51 #include "xfs_ioctl32.h"
53 #define _NATIVE_IOC(cmd, type) \
54 _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
56 #ifdef BROKEN_X86_ALIGNMENT
58 xfs_compat_flock64_copyin(
60 compat_xfs_flock64_t __user *arg32)
62 if (get_user(bf->l_type, &arg32->l_type) ||
63 get_user(bf->l_whence, &arg32->l_whence) ||
64 get_user(bf->l_start, &arg32->l_start) ||
65 get_user(bf->l_len, &arg32->l_len) ||
66 get_user(bf->l_sysid, &arg32->l_sysid) ||
67 get_user(bf->l_pid, &arg32->l_pid) ||
68 copy_from_user(bf->l_pad, &arg32->l_pad, 4*sizeof(u32)))
69 return -XFS_ERROR(EFAULT);
74 xfs_compat_ioc_fsgeometry_v1(
76 compat_xfs_fsop_geom_v1_t __user *arg32)
78 xfs_fsop_geom_t fsgeo;
81 error = xfs_fs_geometry(mp, &fsgeo, 3);
84 /* The 32-bit variant simply has some padding at the end */
85 if (copy_to_user(arg32, &fsgeo, sizeof(struct compat_xfs_fsop_geom_v1)))
86 return -XFS_ERROR(EFAULT);
91 xfs_compat_growfs_data_copyin(
92 struct xfs_growfs_data *in,
93 compat_xfs_growfs_data_t __user *arg32)
95 if (get_user(in->newblocks, &arg32->newblocks) ||
96 get_user(in->imaxpct, &arg32->imaxpct))
97 return -XFS_ERROR(EFAULT);
102 xfs_compat_growfs_rt_copyin(
103 struct xfs_growfs_rt *in,
104 compat_xfs_growfs_rt_t __user *arg32)
106 if (get_user(in->newblocks, &arg32->newblocks) ||
107 get_user(in->extsize, &arg32->extsize))
108 return -XFS_ERROR(EFAULT);
113 xfs_inumbers_fmt_compat(
114 void __user *ubuffer,
115 const xfs_inogrp_t *buffer,
119 compat_xfs_inogrp_t __user *p32 = ubuffer;
122 for (i = 0; i < count; i++) {
123 if (put_user(buffer[i].xi_startino, &p32[i].xi_startino) ||
124 put_user(buffer[i].xi_alloccount, &p32[i].xi_alloccount) ||
125 put_user(buffer[i].xi_allocmask, &p32[i].xi_allocmask))
126 return -XFS_ERROR(EFAULT);
128 *written = count * sizeof(*p32);
133 #define xfs_inumbers_fmt_compat xfs_inumbers_fmt
137 xfs_ioctl32_bstime_copyin(
138 xfs_bstime_t *bstime,
139 compat_xfs_bstime_t __user *bstime32)
141 compat_time_t sec32; /* tv_sec differs on 64 vs. 32 */
143 if (get_user(sec32, &bstime32->tv_sec) ||
144 get_user(bstime->tv_nsec, &bstime32->tv_nsec))
145 return -XFS_ERROR(EFAULT);
146 bstime->tv_sec = sec32;
150 /* xfs_bstat_t has differing alignment on intel, & bstime_t sizes everywhere */
152 xfs_ioctl32_bstat_copyin(
154 compat_xfs_bstat_t __user *bstat32)
156 if (get_user(bstat->bs_ino, &bstat32->bs_ino) ||
157 get_user(bstat->bs_mode, &bstat32->bs_mode) ||
158 get_user(bstat->bs_nlink, &bstat32->bs_nlink) ||
159 get_user(bstat->bs_uid, &bstat32->bs_uid) ||
160 get_user(bstat->bs_gid, &bstat32->bs_gid) ||
161 get_user(bstat->bs_rdev, &bstat32->bs_rdev) ||
162 get_user(bstat->bs_blksize, &bstat32->bs_blksize) ||
163 get_user(bstat->bs_size, &bstat32->bs_size) ||
164 xfs_ioctl32_bstime_copyin(&bstat->bs_atime, &bstat32->bs_atime) ||
165 xfs_ioctl32_bstime_copyin(&bstat->bs_mtime, &bstat32->bs_mtime) ||
166 xfs_ioctl32_bstime_copyin(&bstat->bs_ctime, &bstat32->bs_ctime) ||
167 get_user(bstat->bs_blocks, &bstat32->bs_size) ||
168 get_user(bstat->bs_xflags, &bstat32->bs_size) ||
169 get_user(bstat->bs_extsize, &bstat32->bs_extsize) ||
170 get_user(bstat->bs_extents, &bstat32->bs_extents) ||
171 get_user(bstat->bs_gen, &bstat32->bs_gen) ||
172 get_user(bstat->bs_projid, &bstat32->bs_projid) ||
173 get_user(bstat->bs_dmevmask, &bstat32->bs_dmevmask) ||
174 get_user(bstat->bs_dmstate, &bstat32->bs_dmstate) ||
175 get_user(bstat->bs_aextents, &bstat32->bs_aextents))
176 return -XFS_ERROR(EFAULT);
180 /* XFS_IOC_FSBULKSTAT and friends */
183 xfs_bstime_store_compat(
184 compat_xfs_bstime_t __user *p32,
185 const xfs_bstime_t *p)
190 if (put_user(sec32, &p32->tv_sec) ||
191 put_user(p->tv_nsec, &p32->tv_nsec))
192 return -XFS_ERROR(EFAULT);
196 /* Return 0 on success or positive error (to xfs_bulkstat()) */
198 xfs_bulkstat_one_fmt_compat(
199 void __user *ubuffer,
202 const xfs_bstat_t *buffer)
204 compat_xfs_bstat_t __user *p32 = ubuffer;
206 if (ubsize < sizeof(*p32))
207 return XFS_ERROR(ENOMEM);
209 if (put_user(buffer->bs_ino, &p32->bs_ino) ||
210 put_user(buffer->bs_mode, &p32->bs_mode) ||
211 put_user(buffer->bs_nlink, &p32->bs_nlink) ||
212 put_user(buffer->bs_uid, &p32->bs_uid) ||
213 put_user(buffer->bs_gid, &p32->bs_gid) ||
214 put_user(buffer->bs_rdev, &p32->bs_rdev) ||
215 put_user(buffer->bs_blksize, &p32->bs_blksize) ||
216 put_user(buffer->bs_size, &p32->bs_size) ||
217 xfs_bstime_store_compat(&p32->bs_atime, &buffer->bs_atime) ||
218 xfs_bstime_store_compat(&p32->bs_mtime, &buffer->bs_mtime) ||
219 xfs_bstime_store_compat(&p32->bs_ctime, &buffer->bs_ctime) ||
220 put_user(buffer->bs_blocks, &p32->bs_blocks) ||
221 put_user(buffer->bs_xflags, &p32->bs_xflags) ||
222 put_user(buffer->bs_extsize, &p32->bs_extsize) ||
223 put_user(buffer->bs_extents, &p32->bs_extents) ||
224 put_user(buffer->bs_gen, &p32->bs_gen) ||
225 put_user(buffer->bs_projid, &p32->bs_projid) ||
226 put_user(buffer->bs_dmevmask, &p32->bs_dmevmask) ||
227 put_user(buffer->bs_dmstate, &p32->bs_dmstate) ||
228 put_user(buffer->bs_aextents, &p32->bs_aextents))
229 return XFS_ERROR(EFAULT);
231 *ubused = sizeof(*p32);
236 xfs_bulkstat_one_compat(
237 xfs_mount_t *mp, /* mount point for filesystem */
238 xfs_ino_t ino, /* inode number to get data for */
239 void __user *buffer, /* buffer to place output in */
240 int ubsize, /* size of buffer */
241 void *private_data, /* my private data */
242 xfs_daddr_t bno, /* starting bno of inode cluster */
243 int *ubused, /* bytes used by me */
244 void *dibuff, /* on-disk inode buffer */
245 int *stat) /* BULKSTAT_RV_... */
247 return xfs_bulkstat_one_int(mp, ino, buffer, ubsize,
248 xfs_bulkstat_one_fmt_compat, bno,
249 ubused, dibuff, stat);
252 /* copied from xfs_ioctl.c */
254 xfs_compat_ioc_bulkstat(
257 compat_xfs_fsop_bulkreq_t __user *p32)
260 xfs_fsop_bulkreq_t bulkreq;
261 int count; /* # of records returned */
262 xfs_ino_t inlast; /* last inode number */
266 /* done = 1 if there are more stats to get and if bulkstat */
267 /* should be called again (unused here, but used in dmapi) */
269 if (!capable(CAP_SYS_ADMIN))
270 return -XFS_ERROR(EPERM);
272 if (XFS_FORCED_SHUTDOWN(mp))
273 return -XFS_ERROR(EIO);
275 if (get_user(addr, &p32->lastip))
276 return -XFS_ERROR(EFAULT);
277 bulkreq.lastip = compat_ptr(addr);
278 if (get_user(bulkreq.icount, &p32->icount) ||
279 get_user(addr, &p32->ubuffer))
280 return -XFS_ERROR(EFAULT);
281 bulkreq.ubuffer = compat_ptr(addr);
282 if (get_user(addr, &p32->ocount))
283 return -XFS_ERROR(EFAULT);
284 bulkreq.ocount = compat_ptr(addr);
286 if (copy_from_user(&inlast, bulkreq.lastip, sizeof(__s64)))
287 return -XFS_ERROR(EFAULT);
289 if ((count = bulkreq.icount) <= 0)
290 return -XFS_ERROR(EINVAL);
292 if (bulkreq.ubuffer == NULL)
293 return -XFS_ERROR(EINVAL);
295 if (cmd == XFS_IOC_FSINUMBERS_32) {
296 error = xfs_inumbers(mp, &inlast, &count,
297 bulkreq.ubuffer, xfs_inumbers_fmt_compat);
298 } else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE_32) {
301 error = xfs_bulkstat_one_compat(mp, inlast, bulkreq.ubuffer,
302 sizeof(compat_xfs_bstat_t),
303 NULL, 0, NULL, NULL, &res);
304 } else if (cmd == XFS_IOC_FSBULKSTAT_32) {
305 error = xfs_bulkstat(mp, &inlast, &count,
306 xfs_bulkstat_one_compat, NULL,
307 sizeof(compat_xfs_bstat_t), bulkreq.ubuffer,
308 BULKSTAT_FG_QUICK, &done);
310 error = XFS_ERROR(EINVAL);
314 if (bulkreq.ocount != NULL) {
315 if (copy_to_user(bulkreq.lastip, &inlast,
317 return -XFS_ERROR(EFAULT);
319 if (copy_to_user(bulkreq.ocount, &count, sizeof(count)))
320 return -XFS_ERROR(EFAULT);
327 xfs_compat_handlereq_copyin(
328 xfs_fsop_handlereq_t *hreq,
329 compat_xfs_fsop_handlereq_t __user *arg32)
331 compat_xfs_fsop_handlereq_t hreq32;
333 if (copy_from_user(&hreq32, arg32, sizeof(compat_xfs_fsop_handlereq_t)))
334 return -XFS_ERROR(EFAULT);
336 hreq->fd = hreq32.fd;
337 hreq->path = compat_ptr(hreq32.path);
338 hreq->oflags = hreq32.oflags;
339 hreq->ihandle = compat_ptr(hreq32.ihandle);
340 hreq->ihandlen = hreq32.ihandlen;
341 hreq->ohandle = compat_ptr(hreq32.ohandle);
342 hreq->ohandlen = compat_ptr(hreq32.ohandlen);
348 * Convert userspace handle data into inode.
350 * We use the fact that all the fsop_handlereq ioctl calls have a data
351 * structure argument whose first component is always a xfs_fsop_handlereq_t,
352 * so we can pass that sub structure into this handy, shared routine.
354 * If no error, caller must always iput the returned inode.
357 xfs_vget_fsop_handlereq_compat(
359 struct inode *parinode, /* parent inode pointer */
360 compat_xfs_fsop_handlereq_t *hreq,
361 struct inode **inode)
366 xfs_handle_t *handlep;
374 * Only allow handle opens under a directory.
376 if (!S_ISDIR(parinode->i_mode))
377 return XFS_ERROR(ENOTDIR);
379 hanp = compat_ptr(hreq->ihandle);
380 hlen = hreq->ihandlen;
383 if (hlen < sizeof(handlep->ha_fsid) || hlen > sizeof(*handlep))
384 return XFS_ERROR(EINVAL);
385 if (copy_from_user(handlep, hanp, hlen))
386 return XFS_ERROR(EFAULT);
387 if (hlen < sizeof(*handlep))
388 memset(((char *)handlep) + hlen, 0, sizeof(*handlep) - hlen);
389 if (hlen > sizeof(handlep->ha_fsid)) {
390 if (handlep->ha_fid.fid_len !=
391 (hlen - sizeof(handlep->ha_fsid) -
392 sizeof(handlep->ha_fid.fid_len)) ||
393 handlep->ha_fid.fid_pad)
394 return XFS_ERROR(EINVAL);
398 * Crack the handle, obtain the inode # & generation #
400 xfid = (struct xfs_fid *)&handlep->ha_fid;
401 if (xfid->fid_len == sizeof(*xfid) - sizeof(xfid->fid_len)) {
403 igen = xfid->fid_gen;
405 return XFS_ERROR(EINVAL);
409 * Get the XFS inode, building a Linux inode to go with it.
411 error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
415 return XFS_ERROR(EIO);
416 if (ip->i_d.di_gen != igen) {
417 xfs_iput_new(ip, XFS_ILOCK_SHARED);
418 return XFS_ERROR(ENOENT);
421 xfs_iunlock(ip, XFS_ILOCK_SHARED);
428 xfs_compat_attrlist_by_handle(
431 struct inode *parinode)
434 attrlist_cursor_kern_t *cursor;
435 compat_xfs_fsop_attrlist_handlereq_t al_hreq;
439 if (!capable(CAP_SYS_ADMIN))
440 return -XFS_ERROR(EPERM);
441 if (copy_from_user(&al_hreq, arg,
442 sizeof(compat_xfs_fsop_attrlist_handlereq_t)))
443 return -XFS_ERROR(EFAULT);
444 if (al_hreq.buflen > XATTR_LIST_MAX)
445 return -XFS_ERROR(EINVAL);
448 * Reject flags, only allow namespaces.
450 if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE))
451 return -XFS_ERROR(EINVAL);
453 error = xfs_vget_fsop_handlereq_compat(mp, parinode, &al_hreq.hreq,
458 kbuf = kmalloc(al_hreq.buflen, GFP_KERNEL);
462 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
463 error = xfs_attr_list(XFS_I(inode), kbuf, al_hreq.buflen,
464 al_hreq.flags, cursor);
468 if (copy_to_user(compat_ptr(al_hreq.buffer), kbuf, al_hreq.buflen))
480 xfs_compat_attrmulti_by_handle(
483 struct inode *parinode)
486 compat_xfs_attr_multiop_t *ops;
487 compat_xfs_fsop_attrmulti_handlereq_t am_hreq;
489 unsigned int i, size;
492 if (!capable(CAP_SYS_ADMIN))
493 return -XFS_ERROR(EPERM);
494 if (copy_from_user(&am_hreq, arg,
495 sizeof(compat_xfs_fsop_attrmulti_handlereq_t)))
496 return -XFS_ERROR(EFAULT);
498 error = xfs_vget_fsop_handlereq_compat(mp, parinode, &am_hreq.hreq,
504 size = am_hreq.opcount * sizeof(compat_xfs_attr_multiop_t);
505 if (!size || size > 16 * PAGE_SIZE)
509 ops = kmalloc(size, GFP_KERNEL);
514 if (copy_from_user(ops, compat_ptr(am_hreq.ops), size))
517 attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL);
523 for (i = 0; i < am_hreq.opcount; i++) {
524 ops[i].am_error = strncpy_from_user(attr_name,
525 compat_ptr(ops[i].am_attrname),
527 if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
529 if (ops[i].am_error < 0)
532 switch (ops[i].am_opcode) {
534 ops[i].am_error = xfs_attrmulti_attr_get(inode,
536 compat_ptr(ops[i].am_attrvalue),
537 &ops[i].am_length, ops[i].am_flags);
540 ops[i].am_error = xfs_attrmulti_attr_set(inode,
542 compat_ptr(ops[i].am_attrvalue),
543 ops[i].am_length, ops[i].am_flags);
546 ops[i].am_error = xfs_attrmulti_attr_remove(inode,
547 attr_name, ops[i].am_flags);
550 ops[i].am_error = EINVAL;
554 if (copy_to_user(compat_ptr(am_hreq.ops), ops, size))
555 error = XFS_ERROR(EFAULT);
574 struct inode *inode = filp->f_path.dentry->d_inode;
575 xfs_mount_t *mp = ip->i_mount;
578 xfs_itrace_entry(XFS_I(inode));
580 case XFS_IOC_DIOINFO:
581 case XFS_IOC_FSGEOMETRY:
582 case XFS_IOC_FSGETXATTR:
583 case XFS_IOC_FSSETXATTR:
584 case XFS_IOC_FSGETXATTRA:
585 case XFS_IOC_FSSETDM:
586 case XFS_IOC_GETBMAP:
587 case XFS_IOC_GETBMAPA:
588 case XFS_IOC_GETBMAPX:
589 /* case XFS_IOC_FSSETDM_BY_HANDLE: not handled */
590 case XFS_IOC_FSCOUNTS:
591 case XFS_IOC_SET_RESBLKS:
592 case XFS_IOC_GET_RESBLKS:
593 case XFS_IOC_FSGROWFSDATA:
594 case XFS_IOC_FSGROWFSLOG:
595 case XFS_IOC_FSGROWFSRT:
598 case XFS_IOC_GOINGDOWN:
599 case XFS_IOC_ERROR_INJECTION:
600 case XFS_IOC_ERROR_CLEARALL:
603 case XFS_IOC_GETXFLAGS_32:
604 case XFS_IOC_SETXFLAGS_32:
605 case XFS_IOC_GETVERSION_32:
606 cmd = _NATIVE_IOC(cmd, long);
608 case XFS_IOC_SWAPEXT: {
609 struct xfs_swapext sxp;
610 struct compat_xfs_swapext __user *sxu = arg;
612 /* Bulk copy in up to the sx_stat field, then grab bstat */
613 if (copy_from_user(&sxp, sxu,
614 offsetof(xfs_swapext_t, sx_stat)) ||
615 xfs_ioctl32_bstat_copyin(&sxp.sx_stat, &sxu->sx_stat))
616 return -XFS_ERROR(EFAULT);
617 error = xfs_swapext(&sxp);
620 #ifdef BROKEN_X86_ALIGNMENT
621 /* xfs_flock_t has wrong u32 vs u64 alignment */
622 case XFS_IOC_ALLOCSP_32:
623 case XFS_IOC_FREESP_32:
624 case XFS_IOC_ALLOCSP64_32:
625 case XFS_IOC_FREESP64_32:
626 case XFS_IOC_RESVSP_32:
627 case XFS_IOC_UNRESVSP_32:
628 case XFS_IOC_RESVSP64_32:
629 case XFS_IOC_UNRESVSP64_32: {
630 struct xfs_flock64 bf;
632 if (xfs_compat_flock64_copyin(&bf, arg))
633 return -XFS_ERROR(EFAULT);
634 cmd = _NATIVE_IOC(cmd, struct xfs_flock64);
635 return xfs_ioc_space(ip, inode, filp, ioflags, cmd, &bf);
637 case XFS_IOC_FSGEOMETRY_V1_32:
638 return xfs_compat_ioc_fsgeometry_v1(mp, arg);
639 case XFS_IOC_FSGROWFSDATA_32: {
640 struct xfs_growfs_data in;
642 if (xfs_compat_growfs_data_copyin(&in, arg))
643 return -XFS_ERROR(EFAULT);
644 error = xfs_growfs_data(mp, &in);
647 case XFS_IOC_FSGROWFSRT_32: {
648 struct xfs_growfs_rt in;
650 if (xfs_compat_growfs_rt_copyin(&in, arg))
651 return -XFS_ERROR(EFAULT);
652 error = xfs_growfs_rt(mp, &in);
655 #else /* These are handled fine if no alignment issues */
656 case XFS_IOC_ALLOCSP:
659 case XFS_IOC_UNRESVSP:
660 case XFS_IOC_ALLOCSP64:
661 case XFS_IOC_FREESP64:
662 case XFS_IOC_RESVSP64:
663 case XFS_IOC_UNRESVSP64:
664 case XFS_IOC_FSGEOMETRY_V1:
667 case XFS_IOC_FSBULKSTAT_32:
668 case XFS_IOC_FSBULKSTAT_SINGLE_32:
669 case XFS_IOC_FSINUMBERS_32:
670 return xfs_compat_ioc_bulkstat(mp, cmd, arg);
671 case XFS_IOC_FD_TO_HANDLE_32:
672 case XFS_IOC_PATH_TO_HANDLE_32:
673 case XFS_IOC_PATH_TO_FSHANDLE_32: {
674 struct xfs_fsop_handlereq hreq;
676 if (xfs_compat_handlereq_copyin(&hreq, arg))
677 return -XFS_ERROR(EFAULT);
678 cmd = _NATIVE_IOC(cmd, struct xfs_fsop_handlereq);
679 return xfs_find_handle(cmd, &hreq);
681 case XFS_IOC_OPEN_BY_HANDLE_32: {
682 struct xfs_fsop_handlereq hreq;
684 if (xfs_compat_handlereq_copyin(&hreq, arg))
685 return -XFS_ERROR(EFAULT);
686 return xfs_open_by_handle(mp, &hreq, filp, inode);
688 case XFS_IOC_READLINK_BY_HANDLE_32: {
689 struct xfs_fsop_handlereq hreq;
691 if (xfs_compat_handlereq_copyin(&hreq, arg))
692 return -XFS_ERROR(EFAULT);
693 return xfs_readlink_by_handle(mp, &hreq, inode);
695 case XFS_IOC_ATTRLIST_BY_HANDLE_32:
696 return xfs_compat_attrlist_by_handle(mp, arg, inode);
697 case XFS_IOC_ATTRMULTI_BY_HANDLE_32:
698 return xfs_compat_attrmulti_by_handle(mp, arg, inode);
700 return -XFS_ERROR(ENOIOCTLCMD);
703 error = xfs_ioctl(ip, filp, ioflags, cmd, arg);
708 xfs_file_compat_ioctl(
713 struct inode *inode = filp->f_path.dentry->d_inode;
715 return xfs_compat_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p);
719 xfs_file_compat_invis_ioctl(
724 struct inode *inode = filp->f_path.dentry->d_inode;
726 return xfs_compat_ioctl(XFS_I(inode), filp, IO_INVIS, cmd,