2122 SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *,dir_name, 2123 char __user *, type, unsigned long, flags, void __user *,data) 2124 { 2125 int ret; 2126 char *kernel_type; 2127 char *kernel_dir; 2128 char *kernel_dev; 2129 unsigned long data_page; 2130 2131 ret = copy_mount_string(type, &kernel_type); 2132 if (ret < 0) 2133 goto out_type; 2134 2135 kernel_dir = getname(dir_name); 2136 if (IS_ERR(kernel_dir)) { 2137 ret = PTR_ERR(kernel_dir); 2138 goto out_dir; 2139 } 2140 2141 ret = copy_mount_string(dev_name, &kernel_dev); 2142 if (ret < 0) 2143 goto out_dev; 2144 2145 ret = copy_mount_options(data, &data_page); 2146 if (ret < 0) 2147 goto out_data; 2148 2149 ret = do_mount(kernel_dev, kernel_dir, kernel_type, flags, 2150 (void *) data_page); 2151 2152 free_page(data_page); 2153 out_data: 2154 kfree(kernel_dev); 2155 out_dev: 2156 putname(kernel_dir); 2157 out_dir: 2158 kfree(kernel_type); 2159 out_type: 2160 return ret; 2161 }
|