summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip
AgeCommit message (Collapse)Author
2014-04-15staging/usbip: fix store_attach() sscanf return value checkShuah Khan
sscanf() parses the input buffer for four input items. However, the return value check is incorrect, as it checks for one input item instead of four which is what it is expecting in the input buffer. As a result, sscanf() will always fail even when the input buffer is correct. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-15staging/usbip: userspace - fix usbipd SIGSEGV from refresh_exported_devices()Shuah Khan
refresh_exported_devices() doesn't check udev_device_new_from_syspath() return value and passed in null dev to udev_device_get_driver() resulting in a segmentation fault. Change it to check for null return value from both udev_device_new_from_syspath() and udev_device_get_driver(). Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-12Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "The first vfs pile, with deep apologies for being very late in this window. Assorted cleanups and fixes, plus a large preparatory part of iov_iter work. There's a lot more of that, but it'll probably go into the next merge window - it *does* shape up nicely, removes a lot of boilerplate, gets rid of locking inconsistencie between aio_write and splice_write and I hope to get Kent's direct-io rewrite merged into the same queue, but some of the stuff after this point is having (mostly trivial) conflicts with the things already merged into mainline and with some I want more testing. This one passes LTP and xfstests without regressions, in addition to usual beating. BTW, readahead02 in ltp syscalls testsuite has started giving failures since "mm/readahead.c: fix readahead failure for memoryless NUMA nodes and limit readahead pages" - might be a false positive, might be a real regression..." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits) missing bits of "splice: fix racy pipe->buffers uses" cifs: fix the race in cifs_writev() ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure kill generic_file_buffered_write() ocfs2_file_aio_write(): switch to generic_perform_write() ceph_aio_write(): switch to generic_perform_write() xfs_file_buffered_aio_write(): switch to generic_perform_write() export generic_perform_write(), start getting rid of generic_file_buffer_write() generic_file_direct_write(): get rid of ppos argument btrfs_file_aio_write(): get rid of ppos kill the 5th argument of generic_file_buffered_write() kill the 4th argument of __generic_file_aio_write() lustre: don't open-code kernel_recvmsg() ocfs2: don't open-code kernel_recvmsg() drbd: don't open-code kernel_recvmsg() constify blk_rq_map_user_iov() and friends lustre: switch to kernel_sendmsg() ocfs2: don't open-code kernel_sendmsg() take iov_iter stuff to mm/iov_iter.c process_vm_access: tidy up a bit ...
2014-04-02Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual rocket science -- mostly documentation and comment updates" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: sparse: fix comment doc: fix double words isdn: capi: fix "CAPI_VERSION" comment doc: DocBook: Fix typos in xml and template file Bluetooth: add module name for btwilink driver core: unexport static function create_syslog_header mmc: core: typo fix in printk specifier ARM: spear: clean up editing mistake net-sysfs: fix comment typo 'CONFIG_SYFS' doc: Insert MODULE_ in module-signing macros Documentation: update URL to hfsplus Technote 1150 gpio: update path to documentation ixgbe: Fix format string in ixgbe_fcoe. Kconfig: Remove useless "default N" lines user_namespace.c: Remove duplicated word in comment CREDITS: fix formatting treewide: Fix typo in Documentation/DocBook mm: Fix warning on make htmldocs caused by slab.c ata: ata-samsung_cf: cleanup in header file idr: remove unused prototype of idr_free()
2014-04-01usbip: don't open-code sockfd_lookup/sockfd_putAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-03-20staging: usbip: fix line over 80 charactersCédric Cabessa
Signed-off-by: Cédric Cabessa <ced@ryick.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-20staging: usbip: fix quoted string split across linesCédric Cabessa
Signed-off-by: Cédric Cabessa <ced@ryick.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18staging: usbip: Fix quoted string split across lines.Keerthimai Janarthanan
Fix quoted string split across lines. Signed-off-by: Keerthimai Janarthanan <keerthimaipb@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-10usbcore: rename struct dev_state to struct usb_dev_stateValentina Manea
Since it is needed outside usbcore and exposed in include/linux/usb.h, it conflicts with enum dev_state in rt2x00 wireless driver. Mark it as usb specific to avoid conflicts in the future. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: add hwdata as optional dependency in READMEValentina Manea
This is an optional dependency since USB/IP can fully work without it. However, it is needed to display device information such as vendor. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: don't throw error when trying to read ↵Valentina Manea
configuration specific attributes When a device has just been bound to usbip-host but the client hasn't set a configuration on it, certain attributes will not exist. Don't treat this as an error. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: claim ports used by shared devicesValentina Manea
A device should not be able to be used concurrently both by the server and the client. Claiming the port used by the shared device ensures no interface drivers bind to it and that it is not usable from the server. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: trigger driver probing after unbinding from usbip-hostValentina Manea
A sysfs attribute is used to announce kernel space that a new driver probing session should be triggered for the just unbinded device. In order to have the address of struct device associated to this USB device, a new member has been added to struct bus_id_priv. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: let client choose device configurationValentina Manea
Since usbip-host is now a device driver and the client has full access to the shared device, it makes sense to let the client choose device configuration. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: increase version to 2.0Valentina Manea
Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: update dependencies in READMEValentina Manea
Add libudev as dependency and remove libsysfs. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: remove libsysfs flag and autoconf checkValentina Manea
libsysfs is now completely removed from USB/IP. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: migrate vhci_driver to libudevValentina Manea
This patch migrates vhci_driver to libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: remove class device infrastructure in vhci_driverValentina Manea
The class device lists were used only when being initialized, being populated and being destroyed. They had no real meaning and thus the code was useless. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: migrate usbip_host_driver to libudevValentina Manea
This patch modifies usbip_host_driver to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: move sysfs_utils to libsrcValentina Manea
Since it offers a API to both usbip tools and libusbip, it is more appropriate to be place in the library. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: add new list APIValentina Manea
Take the linked list implementation from the Linux Kernel and strip it down to what it is needed. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: re-add interface information listingValentina Manea
This was deleted in the driver conversion patch. It didn't need to be deleted; showing more information is ok. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: migrate usbip_list to libudevValentina Manea
This patch modifies usbip_list to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: migrate usbip_unbind to libudevValentina Manea
This patch modifies usbip_unbind to use libudev. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: remove useless libsysfs includesValentina Manea
This patch removes useless libsysfs.h includes in various userspace files. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08staging: usbip: userspace: migrate usbip_bind to libudevValentina Manea
This patch adds autoconf check for libudev and migrates usbip_bind to the new library. libsysfs will still be used until all userspace is modified. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06usbip:usbip_common.c: check return value of sscanfJohn de la Garza
Added code to check return value of sscanf. Signed-off-by: John de la Garza <john@jjdev.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06staging: usbip: vhci_sysfs.c: check return value of sscanfJohn de la Garza
Added code to check return value of sscanf. Signed-off-by: John de la Garza <john@jjdev.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04staging/usbip: change usbip userspace to include new uapi usbip.hShuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip userspace to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04staging/usbip: change usbip to include new uapi usbip.hShuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip kernel space to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04staging/usbip: add uapi header to export usbip kernel interfacesShuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. Adding an usbip uapi header file will define the kernel - userspace interface for this device status. This new uapi file is added under usbip/uapi to keep the staging tree code self-contained. When usbip moves to mainline drivers, this file should be moved under uapi/linux Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28staging: usbip: userspace: Memory leak in usbip_exported_device_newHeinrich Schuchardt
Memory was leaked and a device not closed if we ran out of memory on the system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27staging: usbip: Fix format string mismatch in usbip_vhci_attach_device2Masanari Iida
Argument type of sockfd is set as int, but format string is set as unsigned int. Fix the mismatch. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27Staging: usbip: Fix the warning of unchecked sscanf return value.Elena Oat
The return value of sscanf in stub_dev.c is not checked. This patch adds the checking of the return value. Signed-off-by: Elena Oat <oat.elena@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-20Merge branch 'master' into for-nextJiri Kosina
2014-02-20Kconfig: Remove useless "default N" linesPaul Bolle
A number of Kconfig entries default to (uppercase) "N". It was clearly intended to use "default n". But since (lowercase) "n" is the default anyway, these lines might as well be removed. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-14staging: usbip: prevent possible buffer overflow reading port recordsMark Asselstine
To avoid buffer overflow while reading a corrupted or possibly modified port file we validate the length of each part of the port record to ensure it doesn't exceed the length of the destination buffer. https://bugzilla.kernel.org/show_bug.cgi?id=69931 Signed-off-by: Mark Asselstine <asselsm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-08Merge branch 'staging-linus' into staging-workGreg Kroah-Hartman
This is to pull in the lustre fixes so that others can continue to work on updating the lustre codebase, as well as resolve some merge issues with the ion and ocproto drivers to keep linux-next happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07usbip/userspace/libsrc/names.c: memory leakHeinrich Schuchardt
revised patch p is freed if NULL. p is leaked if second calloc fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: userspace to use linux header for usb_device_speed enum, ↵Shuah Khan
missing speeds to speed_strings array Remove usb_device_speed enum define from usbip_common.h and change it to include linux/usb/ch9.h instead. Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: simplify usbip_dump_usb_device() udev->speed handlingShuah Khan
Change usbip_dump_usb_device() to use usb_speed_string() and remove the code that does switch on udev->speed and builds custom speed strings. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging: usbip: convert usbip-host driver to usb_device_driverValentina Manea
This driver was previously an interface driver. Since USB/IP exports a whole device, not just an interface, it would make sense to be a device driver. This patch also modifies the way userspace sees and uses a shared device: * the usbip_status file is no longer created for interface 0, but for the whole device (such as /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1/usbip_status). * per interface information, such as interface class or protocol, is no longer sent/received; only device specific information is transmitted. * since the driver was moved one level below in the USB architecture, there is no need to bind/unbind each interface, just the device as a whole. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: Change vhci_hcd store_attach() device information message to ↵Shuah Khan
include speed string Change vhci_hcd store_attach() routine to include speed string in its device information message. The current call to dev_info() prints out speed number which is the enum number. Change to call usb_speed_string() to print speed string in addition to the number. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: remove vhci_hcd vhci_hub_status change messageShuah Khan
When vhci_hcd is enabled, the following message floods the dmesg buffer. This message doesn't provide any useful information other than cluttering the dmesg buffer. Fix it by removing the message. There is another debug message in this routine that dumps detailed port status change information. [ 4062.716662] vhci_hcd: changed 0 Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07staging/usbip: Fix vhci_hcd attach failure error message to be informativeShuah Khan
When attach fails due to unsupported and/or invalid bus speed, the message vhci_hcd prints out doesn't include any useful information as to what caused the failure. Change the message to be informative and use usb_speed_string() to get the right speed string from usb common. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-22Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "Usual rocket science stuff from trivial.git" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) neighbour.h: fix comment sched: Fix warning on make htmldocs caused by wait.h slab: struct kmem_cache is protected by slab_mutex doc: Fix typo in USB Gadget Documentation of/Kconfig: Spelling s/one/once/ mkregtable: Fix sscanf handling lp5523, lp8501: comment improvements thermal: rcar: comment spelling treewide: fix comments and printk msgs IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart() Documentation: update /proc/uptime field description Documentation: Fix size parameter for snprintf arm: fix comment header and macro name asm-generic: uaccess: Spelling s/a ny/any/ mtd: onenand: fix comment header doc: driver-model/platform.txt: fix a typo drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text doc: Fix typo (acces_process_vm -> access_process_vm) treewide: Fix typos in printk drivers/gpu/drm/qxl/Kconfig: reformat the help text ...
2014-01-09staging: usbip: userspace: add support for viewing imported devicesValentina Manea
As of Matt Mooney's major refactoring in 2011, usbip port option was left out. Add support for this option in a manner similar to the old implementation. Sample output: Imported USB devices ==================== Port 00: <Port in Use> at Full Speed(12Mbps) unknown vendor : unknown product (1687:6211) 2-1 -> usbip://192.168.122.152:3240/1-1 -> remote bus/dev 001/002 Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-19Merge branch 'master' into for-nextJiri Kosina
Sync with Linus' tree to be able to apply fixes on top of newer things in tree (efi-stub). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-12-17usbip: Fix sscanf handlingAlan
Scan only to the length permitted by the buffer One of a set of sscanf problems noted by Jackie Chang Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>