if(copy_from_user((void*)karg, (void__user *)arg, 4 *sizeof(compat_uptr_t))) { printk("copy_from_user fail\n"); return-EFAULT; } ubuffer = compat_alloc_user_space(4 *sizeof(unsignedlong)); if(!access_ok(VERIFY_WRITE, ubuffer, 4 *sizeof(unsignedlong))) return-EFAULT; if(...
下面的例子传了一个结构体struct_a_t的地址ret=copy_from_user(&sturct_a,(structstruct_a_t*)arg64,sizeof(structstruct_a_t));ret=copy_to_user(ptr_to_compat(arg64),&struct_a,sizeof(struct_a_t));break;default:break;}returnret;}
KernelSU for Google Pixel4XL. Contribute to msnx/KernelSU-Pixel4XL development by creating an account on GitHub.
that they allocated on the kernel stack in do_video_ioctl(), copy all data from user space into karg and then back to user space. However, we decided against this approach because it does not align with other compat syscall implementations. Instead, we tried to replicate the get_user/put_...
copy_from_user(&p64->fmt.meta,&p32->fmt.meta, sizeof(p64->fmt.meta))?-EFAULT:0; default: return-EINVAL; } } staticintget_v4l2_create32(structv4l2_create_buffers*p64, structv4l2_create_buffers32__user*p32) { if(copy_from_user...
{ struct ifreq __user *u_ifreq64; struct ifreq32 __user *u_ifreq32 = compat_ptr(arg); char tmp_buf[IFNAMSIZ]; void __user *data64; u32 data32; if (copy_from_user(&tmp_buf[0], &(u_ifreq32->ifr_ifrn.ifrn_name[0]), IFNAMSIZ)) return -EFAULT; if (__get_user(data32...