Code:
#define MAX_PASS_LEN 10
struct device_pass_s {
char pass[MAX_PASS_LEN];
};
/* then the ioctl call should be the following */
struct device_pass_s pass = {
.pass = "mypass"
};
ioctl(fd, SPASS, &pass);
/* in kernel code */
ioctl_handler(.... unsigned long arg) {
struct device_pass_s pass;
copy_from_user(&pass, (void *) arg, sizeof(struct device_pass_s));
/* not sure about copy_from_user, haven't used that for quite some time, you might check if arg isnt' declared as unsigned long __user arg where __user (or sth similar) would indicate that the memory range is userspace */
}