summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys
Commit message (Collapse)AuthorAgeFilesLines
* Staging: unisys: use after free in list_for_each()Dan Carpenter2014-04-162-6/+6
| | | | | | | | These should be using the _safe version of list_for_each() because we free the current element and it leads to a use after free bug. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: use after free in error messagesDan Carpenter2014-04-161-2/+2
| | | | | | | | We dereference "bus" when we report the error so we have to move the kfree() down a couple lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: mark drivers as BROKENGreg Kroah-Hartman2014-04-071-1/+1
| | | | | | | | | | | | | | | | | | Turns out these drivers like to mess around with the system even if the hardware they control isn't present. That's not good, and people are starting to report lots of issues with this in their build/boot testing. So for now, let's just mark them as BROKEN, until the code gets converted to use the proper driver model interaction (i.e. don't do anything until the hardware is actually found in the system.) Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Sasha Levin <sasha.levin@oracle.com> Cc: Benjamin Romer <benjamin.romer@unisys.com> Cc: David Kershner <david.kershner@unisys.com> Cc: someone <sparmaintainer@unisys.com> Cc: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: verify that a control channel existsSasha Levin2014-04-071-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code didn't verify that a control channel exists before trying to use it. It caused NULL ptr derefs which were easy to trigger by an unpriviliged user simply by reading the proc file, causing: [ 68.161404] BUG: unable to handle kernel NULL pointer dereference at (null) [ 68.162442] IP: visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225) [ 68.163165] PGD 5ca21067 PUD 5ca20067 PMD 0 [ 68.163712] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC [ 68.164390] Dumping ftrace buffer: [ 68.164793] (ftrace buffer empty) [ 68.165220] Modules linked in: [ 68.165601] CPU: 0 PID: 7915 Comm: cat Tainted: G W 3.14.0-next-20140403-sasha-00012-gef5fa7d-dirty #373 [ 68.166821] task: ffff88006e8c3000 ti: ffff88005ca30000 task.ti: ffff88005ca30000 [ 68.167689] RIP: visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225) [ 68.168683] RSP: 0018:ffff88005ca31e58 EFLAGS: 00010282 [ 68.169302] RAX: ffff88005ca10000 RBX: ffff88005ca31e97 RCX: 0000000000000001 [ 68.170019] RDX: ffff88005ca31e97 RSI: 0000000000000bd6 RDI: 0000000000000000 [ 68.170019] RBP: ffff88005ca31e78 R08: 0000000000000000 R09: 0000000000000000 [ 68.170019] R10: ffff880000000000 R11: 0000000000000001 R12: 0000000000000001 [ 68.170019] R13: 0000000000000bd6 R14: 0000000000000000 R15: 0000000000008000 [ 68.170019] FS: 00007f0e8c041700(0000) GS:ffff88007be00000(0000) knlGS:0000000000000000 [ 68.170019] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 68.170019] CR2: 0000000000000000 CR3: 000000006efe9000 CR4: 00000000000006b0 [ 68.170019] Stack: [ 68.170019] ffff88005ca31f50 ffff88005ca10000 000000000060e000 ffff88005ca31f50 [ 68.170019] ffff88005ca31ec8 ffffffff83e6f983 ffff8800780db810 0000000000008000 [ 68.170019] ffff88005ca31ec8 ffff88006da5f908 ffff8800780db800 000000000060e000 [ 68.170019] Call Trace: [ 68.170019] proc_read_toolaction (drivers/staging/unisys/visorchipset/visorchipset_main.c:2541) [ 68.170019] proc_reg_read (fs/proc/inode.c:211) [ 68.170019] vfs_read (fs/read_write.c:408) [ 68.170019] SyS_read (fs/read_write.c:519 fs/read_write.c:511) [ 68.170019] tracesys (arch/x86/kernel/entry_64.S:749) [ 68.170019] Code: 00 00 66 66 66 66 90 55 48 89 e5 48 83 ec 20 48 89 5d e0 48 89 d3 4c 89 65 e8 49 89 cc 4c 89 6d f0 49 89 f5 4c 89 75 f8 49 89 fe <48> 8b 3f e8 4f f9 ff ff 85 c0 0f 88 97 00 00 00 4d 85 ed 0f 85 [ 68.170019] RIP visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225) [ 68.170019] RSP <ffff88005ca31e58> [ 68.170019] CR2: 0000000000000000 Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: Add missing close parentheses in filexfer.cMasanari Iida2014-04-071-1/+1
| | | | | | | Add missing close parentheses in filexfer.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: replace kzalloc/kfree with UISMALLOC/UISFREEDaeseok Youn2014-03-203-105/+13Star
| | | | | | | | | | It doesn't need to trace status of buffer when buffers are allocated/deallocated. So stuff of tracing memory status are removed. And also UISMALLOC/UISFREE macro are removed completetly. just use kzalloc/kfree. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove RETINT macroKen Cox2014-03-196-61/+68
| | | | | | | | The RETINT macro included a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove FAIL macroKen Cox2014-03-194-65/+103
| | | | | | | | The FAIL macro ultimately includes a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove RETVOID macroKen Cox2014-03-194-13/+6Star
| | | | | | | | The RETVOID macro contained a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove RETPTR macroKen Cox2014-03-198-39/+55
| | | | | | | | The RETPTR macro contained a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove RETBOOL macroKen Cox2014-03-194-32/+32
| | | | | | | | The RETBOOL macro contained a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Remove FAIL_WPOSTCODE_1 macroKen Cox2014-03-192-24/+33
| | | | | | | | | Part of a series to get rid of goto statements embedded in macros. I'm breaking this up into a series of smaller patches for easier review. The later patches in the series will actually remove the goto statements. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Cleanup macros to get rid of goto statementsKen Cox2014-03-192-92/+18Star
| | | | | | | | | | | | | | | | | | | | | Remove the following macros: TRY CHKFD CHKDD CHKFDX CHKDDX ADDPROCLINE TRY_WPOSTCODE_1 TRY_WPOSTCODE_2 FAIL_WPOSTCODE_2 FAIL_WPOSTCODE_3 Part of a series to get rid of goto statements embedded in macros. I'm breaking this up into a series of smaller patches for easier review. The later patches in the series will actually remove the goto statements. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: include: Remove unused macros from timskmod.hKen Cox2014-03-191-118/+0Star
| | | | | | | | | | | | The following macros were never referenced and have been removed: DEVFROMID DEVFROMFILE DEVFROMINODE DEVFROMIDX TRY_WPOSTCODE_3 Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: kmalloc/memset to kzalloc conversationSilvio F2014-03-195-20/+9Star
| | | | | | | | | | | | | | | | This patch solves the Coccinelle warning: "kzalloc should be used instead of kmalloc/memset" This patch is a fixup for linux-next: 97a84f1203786985856a0d4b49b1d7cc387238ce "Staging: unisys: Replace kmalloc/memset with kzalloc" The ALLOC_CMDRSP #define is after transformation to kzalloc only a rename for kzalloc and was completly removed. Signed-off-by: Silvio F <silvio.fricke@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: visorutil: Clean up sparse warnings in visorutil codeKen Cox2014-03-174-115/+11Star
| | | | | | | | | | Clean up code to get rid of sparse warnings. Also fixed variable length arrays declared on the stack by removing visor_hexDumpToBuffer() and using hex_dump_to_buffer() instead. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: visorchipset: Clean up sparse warnings in visorchipset code.Ken Cox2014-03-173-8/+10
| | | | | | | | Clean up code to get rid of sparse warnings due to accessing I/O space. Also declared functions and variables as static if they are only used locally. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: visorchannel: Clean up sparse warnings in visorchannel codeKen Cox2014-03-172-137/+1Star
| | | | | | | | | | Clean up code to get rid of sparse warnings, mostly due to accessing I/O space. Remove visorchannel_get_safe_queue(), visorchannel_safesignalremove(), and visorchannel_safesignalinsert() since they were not called from anywhere. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: uislib: Cleanup sparse warnings in uislibKen Cox2014-03-173-54/+22Star
| | | | | | | | | | Clean up code to get rid of sparse warnings, mostly related to accessing I/O space. Remove uislibcmpxchg64() and use cmpxchg() instead. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Clean multiple sparse warningsKen Cox2014-03-178-243/+209Star
| | | | | | | | | | | | Cleaned up multiple sparse warnings, mostly due to improper access of I/O space. Also declared functions and variables that were only used locally as static. Removed ULTRA_disp_channel_header(), ULTRA_disp_channel(), ULTRA_disp_vnic_channel() because they were never called. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: channels: Cleanup sparse warningsKen Cox2014-03-174-133/+49Star
| | | | | | | | | | | Clean up multiple sparse warnings mostly due to different address spaces when accessing I/O memory. Also, remove SignalRemoveAll(), SignalQueueHasOneElement(), SignalQueueIsFull(), because they were never called. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: remove incorrect error handling after queue_delayed_workDaeseok Youn2014-03-171-10/+4Star
| | | | | | | | | The queue_delayed_work() return false if the work is already on the queue, true otherwise. So return value cannot be less than zero. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: Replace kmalloc/memset with kzallocAndreea-Cristina Bernat2014-03-175-14/+11Star
| | | | | | | | This patch solves the Coccinelle warning: "kzalloc should be used instead of kmalloc/memset". Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
* staging: unisys: visorutil: Use kzalloc instead of kmalloc with memsetIulia Manda2014-03-141-16/+8Star
| | | | | | | | | | Fix coccinelle warnings of better allocation by using kzalloc. In these cases, kzalloc is preferred, as kmalloc may fail if it does not find contiguous memory. Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
* Staging: unisys: Fix multiple variable length array declarationsKen Cox2014-03-093-10/+39
| | | | | | | | | | | There were multiple variable length arrays declared on the stack in proc handlers: char buf[count]; I changed these to be fixed length arrays. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: update MAINTAINERS and TODOBenjamin Romer2014-03-091-1/+2
| | | | | | | | | | This patch adds the Unisys s-Par driver maintainers to the MAINTAINERS file, changes the state to "Supported", modifies TODO to address patches to the Unisys mailing list, and adds Greg Kroah-Hartman to the patch recipients list. Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: uislib: Fix locking in info_proc_read_helper()Ken Cox2014-03-091-40/+55
| | | | | | | | | | | Make sure BusListLock is unlocked before returning. If an error is encountered early on in info_proc_read_helper() the function can return without unlocking. Also changed the PROCLINE macro so that it doesn't include a goto statement. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: virthba: Fix variable length arrayKen Cox2014-03-091-1/+4
| | | | | | | | | A character array was declared on the stack with variable length. This has been corrected to use a fixed length. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys/uislib: kthread_create() returns an ERR_PTRDan Carpenter2014-03-091-1/+1
| | | | | | | kthread_create() returns an ERR_PTR on error, it never returns NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: unisys: virthba: Add dependency on SCSIKen Cox2014-03-061-1/+1
| | | | | | | | | If CONFIG_SCSI is not enabled, compiling virthba.c goes horribly wrong with undefined symbols. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: Give exported symbols unique namesKen Cox2014-03-0624-276/+308
| | | | | | | | Many exported symbols had very generic names. This commit changes the names so that they will be unique. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: unisys: remove unreferenced utility functions.Ken Cox2014-03-062-663/+1Star
| | | | | | | | A number of functions were used for debug at one time but that code has been removed. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: s-Par driver documentationKen Cox2014-03-054-0/+293
| | | | | | | | Documentation for the set of s-Par drivers Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: virthba driver to access shared SCSI hbaKen Cox2014-03-056-0/+1872
| | | | | | | | | | | | | | | | | | The virthba module provides access to a shared SCSI host bus adapter and one or more disk devices, by proxying SCSI commands between the guest and the service partition that owns the shared SCSI adapter, using a channel between the guest and the service partition. The disks that appear on the shared bus are defined by the s-Par configuration and enforced by the service partition, while the guest driver handles sending commands and handling responses. Each disk is shared as a whole to a guest. Sharing the bus adapter in this way provides resiliency; should the device encounter an error, only the service partition is rebooted, and the device is reinitialized. This allows guests to continue running and to recover from the error. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: virtpci driverKen Cox2014-03-056-0/+1884
| | | | | | | | The virtpci module handles the bus functions for virthba, and virtnic. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: visoruislib driver used to handle requests from virtpciKen Cox2014-03-059-1/+3195
| | | | | | | | | The visoruislib module is a support library, used to handle requests from virtpci. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: visorchannelstub driver to provide channel support routinesKen Cox2014-03-057-0/+425
| | | | | | | | | The visorchannelstub module provides support routines for storing and retrieving data from a channel. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: visorchipset driver to provide registration and other servicesKen Cox2014-03-0533-0/+9062
| | | | | | | | | | | | | | | | | | | | | | | The visorchipset module receives device creation and destruction events from the Command service partition of s-Par, as well as controlling registration of shared device drivers with the s-Par driver core. The events received are used to populate other s-Par modules with their assigned shared devices. Visorchipset is required for shared device drivers to function properly. Visorchipset also stores information for handling dump disk device creation during kdump. In operation, the visorchipset module processes device creation and destruction messages sent by s-Par's Command service partition through a channel. These messages result in creation (or destruction) of each virtual bus and virtual device. Each bus and device is also associated with a communication channel, which is used to communicate with one or more IO service partitions to perform device IO on behalf of the guest. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: visorchannel moduleKen Cox2014-03-0512-0/+2035
| | | | | | | | | The visorchannel module is a support library that abstracts reading and writing a channel in memory. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: visorutil driver to provide common functionality to other s-Par driversKen Cox2014-03-0518-0/+3254
The visorutil module is a support library required by all other s-Par driver modules. Among its features it abstracts reading, writing, and manipulating a block of memory. Signed-off-by: Ken Cox <jkc@redhat.com> Cc: Ben Romer <sparmaintainer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>