nashpa has quit [Ping timeout: 256 seconds]
tyler-baker has quit [Quit: Shazbot]
tyler-baker has joined #linux-exynos
ssvb has quit [Ping timeout: 264 seconds]
dlezcano has quit [Ping timeout: 240 seconds]
dlezcano has joined #linux-exynos
nashpa has joined #linux-exynos
ssvb has joined #linux-exynos
ssvb has quit [Ping timeout: 264 seconds]
afaerber has joined #linux-exynos
liquidAcid has joined #linux-exynos
ssvb has joined #linux-exynos
nashpa has quit [Quit: Going away]
nashpa has joined #linux-exynos
zombah has joined #linux-exynos
afaerber_ has joined #linux-exynos
afaerber has quit [Ping timeout: 255 seconds]
zombah has quit [Ping timeout: 244 seconds]
zombah has joined #linux-exynos
zombah has quit [Quit: Leaving]
<liquidAcid> what's the right way to access userspace data in an ioctl? just dereferencing the pointer or is copy_from_user the safe approach?
<javier__> liquidAcid: you must use copy_from_user for that
<liquidAcid> javier__, hmm, this fails here for me
<liquidAcid> if struct size is 24, then it returns 24 as well
<javier__> liquidAcid: hmm, are you sure you are passing a valid pointer?
<liquidAcid> yes
<liquidAcid> direct access works just fine
<javier__> liquidAcid: that's really weird...
<liquidAcid> hmm, don't see that done in e.g. i915 as well
<liquidAcid> it's always direct access
* javier__ looks
<javier__> liquidAcid: right, because drm_ioctl() does it
<javier__> same for copy_to_user()
<javier__> liquidAcid: that will explain why it fails, because is already a kernel and not user space address so access_ok() fails
<liquidAcid> ah, ok
<liquidAcid> i looked at some stackoverflow posts about ioctls and copy_from_user and i got the impression that i should check this
<javier__> liquidAcid: well you should if your driver has a callback for a ioctl
<javier__> but it seems there is an indirection level for DRM drivers
* javier__ knows nothing about DRM/KMS
<javier__> liquidAcid: I mean, DRM drivers don't register a struct file_operations with an .ioctl callback but instead defines a set of DRM specific ioctl handlers and the core register the drm_ioctl
<javier__> liquidAcid: on a second look DRM drivers do register file ops but the .ioctl handler is drm_ioctl, instead of a driver specific ioctl
<javier__> but you get the idea, the core handles the copy_{from,to}_user so drivers don't have to deal with that
<liquidAcid> that's one problem less to worry about i guess :)
<javier__> :)