github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/fs_ioctl_autofs.txt (about)

     1  # Copyright 2021 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/linux/fs.h>
     5  include <uapi/linux/auto_fs.h>
     6  include <uapi/linux/auto_dev-ioctl.h>
     7  
     8  # Root directory ioctls.
     9  
    10  # TODO: connect this with wait queues, once we have descriptions for them.
    11  type autofs_wqt_t intptr
    12  autofs_exp_how = AUTOFS_EXP_NORMAL, AUTOFS_EXP_IMMEDIATE, AUTOFS_EXP_LEAVES, AUTOFS_EXP_FORCED
    13  
    14  ioctl$AUTOFS_IOC_READY(fd fd, cmd const[AUTOFS_IOC_READY], arg autofs_wqt_t)
    15  ioctl$AUTOFS_IOC_FAIL(fd fd, cmd const[AUTOFS_IOC_FAIL], arg autofs_wqt_t)
    16  ioctl$AUTOFS_IOC_CATATONIC(fd fd, cmd const[AUTOFS_IOC_CATATONIC], arg const[0])
    17  ioctl$AUTOFS_IOC_PROTOVER(fd fd, cmd const[AUTOFS_IOC_PROTOVER], arg ptr[out, int32])
    18  ioctl$AUTOFS_IOC_PROTOSUBVER(fd fd, cmd const[AUTOFS_IOC_PROTOSUBVER], arg ptr[out, int32])
    19  ioctl$AUTOFS_IOC_SETTIMEOUT(fd fd, cmd const[AUTOFS_IOC_PROTOSUBVER], arg ptr[in, int64])
    20  ioctl$AUTOFS_IOC_ASKUMOUNT(fd fd, cmd const[AUTOFS_IOC_ASKUMOUNT], arg ptr[out, int32])
    21  ioctl$AUTOFS_IOC_EXPIRE(fd fd, cmd const[AUTOFS_IOC_EXPIRE], arg ptr[in, autofs_packet_expire])
    22  ioctl$AUTOFS_IOC_EXPIRE_MULTI(fd fd, cmd const[AUTOFS_IOC_EXPIRE_MULTI], arg ptr[in, flags[autofs_exp_how, int32]])
    23  
    24  define AUTOFS_NAME_MAX	NAME_MAX + 1
    25  
    26  autofs_packet_hdr {
    27  	proto_version	int32
    28  	type		int32
    29  }
    30  
    31  autofs_packet_expire {
    32  	hdr	autofs_packet_hdr
    33  	len	len[name, int32]
    34  	name	string[filename, AUTOFS_NAME_MAX]
    35  }
    36  
    37  # Communication via /dev/autofs.
    38  
    39  args_protover {
    40  	version	int32
    41  }
    42  
    43  args_protosubver {
    44  	sub_version	int32
    45  }
    46  
    47  args_openmount {
    48  	devid	int32
    49  }
    50  
    51  args_ready {
    52  	token	int32
    53  }
    54  
    55  args_fail {
    56  	token	int32
    57  	status	int32
    58  }
    59  
    60  args_setpipefd {
    61  	pipefd	fd
    62  }
    63  
    64  args_timeout {
    65  	timeout	int64
    66  }
    67  
    68  args_requester {
    69  	uid	uid
    70  	gid	gid
    71  }
    72  
    73  args_expire {
    74  	how	flags[autofs_exp_how, int32]
    75  }
    76  
    77  args_askumount {
    78  	may_umount	int32
    79  }
    80  
    81  autofs_type = AUTOFS_TYPE_ANY, AUTOFS_TYPE_INDIRECT, AUTOFS_TYPE_DIRECT, AUTOFS_TYPE_OFFSET
    82  
    83  args_ismountpoint {
    84  	type	flags[autofs_type, int32]
    85  	devid	int32	(out_overlay)
    86  	magic	int32
    87  }
    88  
    89  # autofs_dev_ioctl struct has a union of command-specific structs, so we must pad it to
    90  # the maximum size.
    91  type autofs_dev_ioctl_base[NESTED] {
    92  	ver_major	const[AUTOFS_DEV_IOCTL_VERSION_MAJOR, int32]
    93  	ver_minor	const[AUTOFS_DEV_IOCTL_VERSION_MINOR, int32]
    94  	size		len[parent, int32]
    95  	ioctlfd		fd
    96  	content		NESTED
    97  } [size[AUTOFS_DEV_IOCTL_SIZE]]
    98  
    99  type autofs_dev_ioctl[NESTED] {
   100  	base	autofs_dev_ioctl_base[NESTED]
   101  	path	filename
   102  }
   103  
   104  ioctl$AUTOFS_DEV_IOCTL_VERSION(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_VERSION], arg ptr[inout, autofs_dev_ioctl[void]])
   105  ioctl$AUTOFS_DEV_IOCTL_PROTOVER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_PROTOVER], arg ptr[inout, autofs_dev_ioctl[args_protover]])
   106  ioctl$AUTOFS_DEV_IOCTL_PROTOSUBVER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_PROTOSUBVER], arg ptr[inout, autofs_dev_ioctl[args_protosubver]])
   107  ioctl$AUTOFS_DEV_IOCTL_OPENMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_OPENMOUNT], arg ptr[inout, autofs_dev_ioctl[args_openmount]])
   108  ioctl$AUTOFS_DEV_IOCTL_CLOSEMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_CLOSEMOUNT], arg ptr[inout, autofs_dev_ioctl[void]])
   109  ioctl$AUTOFS_DEV_IOCTL_READY(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_READY], arg ptr[inout, autofs_dev_ioctl[args_ready]])
   110  ioctl$AUTOFS_DEV_IOCTL_FAIL(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_FAIL], arg ptr[inout, autofs_dev_ioctl[args_fail]])
   111  ioctl$AUTOFS_DEV_IOCTL_SETPIPEFD(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_SETPIPEFD], arg ptr[inout, autofs_dev_ioctl[args_setpipefd]])
   112  ioctl$AUTOFS_DEV_IOCTL_CATATONIC(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_CATATONIC], arg ptr[inout, autofs_dev_ioctl[void]])
   113  ioctl$AUTOFS_DEV_IOCTL_TIMEOUT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_TIMEOUT], arg ptr[inout, autofs_dev_ioctl[args_timeout]])
   114  ioctl$AUTOFS_DEV_IOCTL_REQUESTER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_REQUESTER], arg ptr[inout, autofs_dev_ioctl[args_requester]])
   115  ioctl$AUTOFS_DEV_IOCTL_EXPIRE(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_EXPIRE], arg ptr[inout, autofs_dev_ioctl[args_expire]])
   116  ioctl$AUTOFS_DEV_IOCTL_ASKUMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_ASKUMOUNT], arg ptr[inout, autofs_dev_ioctl[args_askumount]])
   117  ioctl$AUTOFS_DEV_IOCTL_ISMOUNTPOINT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_ISMOUNTPOINT], arg ptr[inout, autofs_dev_ioctl[args_ismountpoint]])