[PARPORT] Buffer read/write verification

Dale Whitfield (dale@elad.cix.co.uk)
Fri, 19 Mar 1999 12:10:54 +0000

Hi all,

Wondered what the opinions were on the fact that parport, and other drivers no
doubt, always assume they are returning data to user-space. Hence they verify
whether the data buffer is readable or writable.

It appears that validating storage as well as the __get_user()/__put_user type
routines are designed for calls from user-space only. It seems unnecessarily
restrictive for calls from drivers and somewhat pointless. Drivers calling
drivers are penalised by having to set things up before the call, rather than
applications. I'd have thought the reverse would be true.

In addition, its also not always possible to know whether the parport routine
that is being called is verifying a buffer. It may not if its dealing with
single bytes of data, as opposed to a larger buffer.

This is particularly relevant in the vc-qcam driver I'm writing which makes a
huge number of calls to parport.

Any comments or efficient workarounds? Having to wrap set_fs() around every
call to a parport api seems ridiculous.


-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --

This archive was generated by hypermail 2.0b3 on Sun 28 Mar 1999 - 17:02:19 EST