Re: [PATCH 3/4] drivers/misc: Add ASpeed LPC control driver
From: Greg KH <hidden>
Date: 2017-01-12 16:26:19
Also in:
openbmc
On Thu, Jan 12, 2017 at 10:07:33AM -0600, Benjamin Herrenschmidt wrote:
On Thu, 2017-01-12 at 17:00 +0100, Greg KH wrote:quoted
quoted
How so ? I mean, access_ok followed by __get/__put_user is still a classic, what's wrong with it ?No "normal" driver should do that, just call copy_to/from_user and be done with it. That way all of the proper locking and validation checks like this are done correctly for you. Why would a driver ever call the "raw" __get/__put_user functions?I supposed historically it was considered faster for some things :-) Not a huge deal, and yes it's probably cleaner, I was just wondering what was "racy" about access_ok() that I might have missed...
I think, you can change things after access_ok() happens, there used to be bugs in that area a few years ago. I think we fixed them by moving the offending drivers to use copy_*() instead. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html