Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dan Carpenter
Date: Thursday, June 3, 2010 - 5:45 am

On Thu, Jun 03, 2010 at 09:16:52PM +0900, Takuya Yoshikawa wrote:

It was your clear_user() patch which inspired me.  I wrote a smatch
check to find these.  I've pushed the code to the smatch repo.
http://repo.or.cz/r/smatch.git

The heuristic I use is that if we return a variable which is the 
return value of copy_to_user() and it's non-zero then complain.  It 
didn't find the f_getown_ex() because that return value could come from
copy_to_user() or it could be -EINVAL.

I'll mess with it a bit and see if I can make it catch the f_getown_ex()
bug.

regards,
dan carpenter


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] fcntl: return -EFAULT if copy_to_user fails, Dan Carpenter, (Thu Jun 3, 3:04 am)
Re: [patch] fcntl: return -EFAULT if copy_to_user fails, Takuya Yoshikawa, (Thu Jun 3, 3:22 am)
[patch v2] fcntl: return -EFAULT if copy_to_user fails, Dan Carpenter, (Thu Jun 3, 3:35 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails, Takuya Yoshikawa, (Thu Jun 3, 5:16 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails, Dan Carpenter, (Thu Jun 3, 5:45 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails, Takuya Yoshikawa, (Thu Jun 3, 6:24 am)