]> git.karo-electronics.de Git - mv-sheeva.git/commit
Staging: bcm: use get_user() to access user pointers
authorDan Carpenter <error27@gmail.com>
Thu, 21 Oct 2010 05:46:58 +0000 (07:46 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Nov 2010 21:32:36 +0000 (13:32 -0800)
commiteccbf04a904fc99c54ab37c29a2a4dedcec66e33
treefe6d1142f644afe0984bdd3570b89ede21bc1540
parent4fc718a4b0cdf3803f370e323ea5252a3d76f52d
Staging: bcm: use get_user() to access user pointers

This fixes some places that dereference user pointers directly instead
of using get_user().

Please especially check my changes to IOCTL_BCM_GET_CURRENT_STATUS.  The
original code modified the struct which "arg" was pointing to.  I think
this was a bug in the original code and that we only wanted to write to
the OutputBuffer. Also with the original code you could read as much
memory as you wanted so I had to put a cap on OutputLength.  The only
value of OutputLength that makes sense is sizeof(LINK_STATE) so now if
OutputLength is not sizeof(LINK_STATE) it returns -EINVAL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/bcm/Bcmchar.c