A Bad Address error means that the address you entered is not valid. In case you are already higher, I would suggest that this is because you are passing a copy infoinstead of a pointer to the memory location info.
Looking at documents is copy_to_userdefined as
copy_to_user(void __user * to, const void * from, unsigned long n);
So, if your variable is infonot specified, I would update your code:
if(copy_to_user(&info, &kernel_info, sizeof(struct prinfo)) ) {
}
source
share