1. 18 7月, 2015 1 次提交
    • N
      configfs: fix kernel infoleak through user-controlled format string · 3958b792
      Nicolas Iooss 提交于
      Some modules call config_item_init_type_name() and config_group_init_type_name()
      with parameter "name" directly controlled by userspace.  These two
      functions call config_item_set_name() with this name used as a format
      string, which can be used to leak information such as content of the
      stack to userspace.
      
      For example, make_netconsole_target() in netconsole module calls
      config_item_init_type_name() with the name of a newly-created directory.
      This means that the following commands give some unexpected output, with
      configfs mounted in /sys/kernel/config/ and on a system with a
      configured eth0 ethernet interface:
      
          # modprobe netconsole
          # mkdir /sys/kernel/config/netconsole/target_%lx
          # echo eth0 > /sys/kernel/config/netconsole/target_%lx/dev_name
          # echo 1 > /sys/kernel/config/netconsole/target_%lx/enabled
          # echo eth0 > /sys/kernel/config/netconsole/target_%lx/dev_name
          # dmesg |tail -n1
          [  142.697668] netconsole: target (target_ffffffffc0ae8080) is
          enabled, disable to update parameters
      
      The directory name is correct but %lx has been interpreted in the
      internal item name, displayed here in the error message used by
      store_dev_name() in drivers/net/netconsole.c.
      
      To fix this, update every caller of config_item_set_name to use "%s"
      when operating on untrusted input.
      
      This issue was found using -Wformat-security gcc flag, once a __printf
      attribute has been added to config_item_set_name().
      Signed-off-by: NNicolas Iooss <nicolas.iooss_linux@m4x.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Acked-by: NJoel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3958b792
  2. 09 7月, 2015 1 次提交
    • J
      USB: serial: Destroy serial_minors IDR on module exit · d23f47d4
      Johannes Thumshirn 提交于
      Destroy serial_minors IDR on module exit, reclaiming the allocated memory.
      
      This was detected by the following semantic patch (written by Luis
      Rodriguez <mcgrof@suse.com>)
      
      <SmPL>
      @ defines_module_init @
      declarer name module_init, module_exit;
      declarer name DEFINE_IDR;
      identifier init;
      @@
      
      module_init(init);
      
      @ defines_module_exit @
      identifier exit;
      @@
      
      module_exit(exit);
      
      @ declares_idr depends on defines_module_init && defines_module_exit @
      identifier idr;
      @@
      
      DEFINE_IDR(idr);
      
      @ on_exit_calls_destroy depends on declares_idr && defines_module_exit @
      identifier declares_idr.idr, defines_module_exit.exit;
      @@
      
      exit(void)
      {
       ...
       idr_destroy(&idr);
       ...
      }
      
      @ missing_module_idr_destroy depends on declares_idr && defines_module_exit && !on_exit_calls_destroy @
      identifier declares_idr.idr, defines_module_exit.exit;
      @@
      
      exit(void)
      {
       ...
       +idr_destroy(&idr);
      }
      </SmPL>
      Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Cc: stable <stable@vger.kernel.org>	# v3.11
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      d23f47d4
  3. 07 7月, 2015 11 次提交
  4. 06 7月, 2015 3 次提交
    • P
      USB: cp210x: add ID for Aruba Networks controllers · f98a7aa8
      Peter Sanford 提交于
      Add the USB serial console device ID for Aruba Networks 7xxx series
      controllers which have a USB port for their serial console.
      Signed-off-by: NPeter Sanford <peter@sanford.io>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f98a7aa8
    • S
      USB: mos7720: rename registers · ee5729ec
      Sudip Mukherjee 提交于
      Some of the register names defined here are matching with registers
      defined in other places. Like DCR is defined here and DCR is also
      a register in mn10300 architecture. So when we are building this with
      mn10300, build fails.
      To avoid we rename all the registers.
      Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ee5729ec
    • C
      USB: option: add 2020:4000 ID · f6d7fb37
      Claudio Cappelli 提交于
      Add device Olivetti Olicard 300 (Network Connect: MT6225) - IDs 2020:4000.
      
      T:  Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2020 ProdID=4000 Rev=03.00
      S:  Manufacturer=Network Connect
      S:  Product=MT6225
      C:  #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option
      I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      Signed-off-by: NClaudio Cappelli <claudio.cappelli.linux@gmail.com>
      Suggested-by: NLars Melin <larsm17@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      [johan: amend commit message with devices info ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f6d7fb37
  5. 26 6月, 2015 1 次提交
  6. 24 6月, 2015 1 次提交
  7. 23 6月, 2015 1 次提交
    • D
      module: add per-module param_lock · b51d23e4
      Dan Streetman 提交于
      Add a "param_lock" mutex to each module, and update params.c to use
      the correct built-in or module mutex while locking kernel params.
      Remove the kparam_block_sysfs_r/w() macros, replace them with direct
      calls to kernel_param_[un]lock(module).
      
      The kernel param code currently uses a single mutex to protect
      modification of any and all kernel params.  While this generally works,
      there is one specific problem with it; a module callback function
      cannot safely load another module, i.e. with request_module() or even
      with indirect calls such as crypto_has_alg().  If the module to be
      loaded has any of its params configured (e.g. with a /etc/modprobe.d/*
      config file), then the attempt will result in a deadlock between the
      first module param callback waiting for modprobe, and modprobe trying to
      lock the single kernel param mutex to set the new module's param.
      
      This fixes that by using per-module mutexes, so that each individual module
      is protected against concurrent changes in its own kernel params, but is
      not blocked by changes to other module params.  All built-in modules
      continue to use the built-in mutex, since they will always be loaded at
      runtime and references (e.g. request_module(), crypto_has_alg()) to them
      will never cause load-time param changing.
      
      This also simplifies the interface used by modules to block sysfs access
      to their params; while there are currently functions to block and unblock
      sysfs param access which are split up by read and write and expect a single
      kernel param to be passed, their actual operation is identical and applies
      to all params, not just the one passed to them; they simply lock and unlock
      the global param mutex.  They are replaced with direct calls to
      kernel_param_[un]lock(THIS_MODULE), which locks THIS_MODULE's param_lock, or
      if the module is built-in, it locks the built-in mutex.
      Suggested-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b51d23e4
  8. 22 6月, 2015 1 次提交
    • B
      MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU · df115f3e
      Ben Hutchings 提交于
      The Octeon OHCI is now supported by the ohci-platform driver, and
      USB_OCTEON_OHCI is marked as deprecated.  However, it is currently
      still necessary to enable it in order to select
      USB_OHCI_BIG_ENDIAN_MMIO.  Make CPU_CAVIUM_OCTEON select that as well,
      so that USB_OCTEON_OHCI is really obsolete.
      
      The old ohci-octeon and ehci-octeon drivers also only enabled big-endian
      MMIO in case the CPU was big-endian.  Make the selections of
      USB_EHCI_BIG_ENDIAN_MMIO and USB_OHCI_BIG_ENDIAN_MMIO conditional, to
      match this.
      
      Fixes: 2193dda5 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Chandrakala Chavva <cchavva@caviumnetworks.com>
      Cc: Paul Martin <paul.martin@codethink.co.uk>
      Patchwork: https://patchwork.linux-mips.org/patch/10178/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      df115f3e
  9. 16 6月, 2015 1 次提交
    • N
      target: Drop unnecessary core_tpg_register TFO parameter · bc0c94b1
      Nicholas Bellinger 提交于
      This patch drops unnecessary target_core_fabric_ops parameter usage
      for core_tpg_register() during fabric driver TFO->fabric_make_tpg()
      se_portal_group creation callback execution.
      
      Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure
      fabric driver is really using the same TFO provided at module_init
      time.
      
      Also go ahead and drop the forward TFO declarations tree-wide, and
      handling the special case for iscsi-target discovery TPG.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bc0c94b1
  10. 13 6月, 2015 2 次提交
  11. 10 6月, 2015 2 次提交
  12. 09 6月, 2015 4 次提交
  13. 08 6月, 2015 1 次提交
  14. 05 6月, 2015 1 次提交
  15. 02 6月, 2015 2 次提交
    • B
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche 提交于
      Only include SCSI initiator header files in target code that needs
      these header files, namely the SCSI pass-through code and the tcm_loop
      driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
      target code because the former is intended for initiator code and the
      latter for target code. With this patch the only initiator include
      directives in target code that remain are as follows:
      
      $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
      drivers/target/loopback/tcm_loop.c:29:#include <scsi/scsi.h>
      drivers/target/loopback/tcm_loop.c:31:#include <scsi/scsi_host.h>
      drivers/target/loopback/tcm_loop.c:32:#include <scsi/scsi_device.h>
      drivers/target/loopback/tcm_loop.c:33:#include <scsi/scsi_cmnd.h>
      drivers/target/target_core_pscsi.c:39:#include <scsi/scsi_device.h>
      drivers/target/target_core_pscsi.c:40:#include <scsi/scsi_host.h>
      drivers/xen/xen-scsiback.c:52:#include <scsi/scsi_host.h> /* SG_ALL */
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      ba929992
    • T
      USB: usbtmc: add device quirk for Rigol DS6104 · f5042022
      Teunis van Beelen 提交于
      Recently we purchased the Rigol DS6104 and when I try to operate it from
      my Linux pc, everything works well with the default usbtmc driver,
      except when I want to download a big datachunk like a screenshot. This
      bitmapfile has a size of 1152054 bytes but I receive a smaller file and
      no new packets can be read.
      
      When I took a look at the driver source, I found this "Rigol quirk" and
      I added the id of the new DS series oscilloscopes to this list. I
      compiled it and loaded the new driver and now everything seems to work
      fine.
      Signed-off-by: NTeunis van Beelen <teuniz@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f5042022
  16. 01 6月, 2015 3 次提交
  17. 31 5月, 2015 4 次提交