1. 01 Aug, 2021 4 commits
    • Maciej W. Rozycki's avatar
      scsi: BusLogic: Avoid unbounded vsprintf() use · a40662c9
      Maciej W. Rozycki authored
      Existing blogic_msg() invocations do not appear to overrun its internal
      buffer of a fixed length of 100, which would cause stack corruption, but
      it's easy to miss with possible further updates and a fix is cheap in
      performance terms, so limit the output produced into the buffer by using
      vscnprintf() rather than vsprintf().
      
      Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201939390.44318@angie.orcam.me.ukAcked-by: default avatarKhalid Aziz <khalid@gonehiking.org>
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      a40662c9
    • Maciej W. Rozycki's avatar
      scsi: BusLogic: Fix missing pr_cont() use · 44d01fc8
      Maciej W. Rozycki authored
      Update BusLogic driver's messaging system to use pr_cont() for continuation
      lines, bringing messy output:
      
      pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17
      scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 *****
      scsi: Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>
      scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter
      scsi0:   Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level
      scsi0:   PCI Bus: 0, Device: 19, Address:
      0xE0012000,
      Host Adapter SCSI ID: 7
      scsi0:   Parity Checking: Enabled, Extended Translation: Enabled
      scsi0:   Synchronous Negotiation: Ultra, Wide Negotiation: Enabled
      scsi0:   Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled
      scsi0:   Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211
      scsi0:   Driver Queue Depth: 211, Host Adapter Queue Depth: 192
      scsi0:   Tagged Queue Depth:
      Automatic
      , Untagged Queue Depth: 3
      scsi0:   SCSI Bus Termination: Both Enabled
      , SCAM: Disabled
      
      scsi0: *** BusLogic BT-958 Initialized Successfully ***
      scsi host0: BusLogic BT-958
      
      back to order:
      
      pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17
      scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 *****
      scsi: Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>
      scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter
      scsi0:   Firmware Version: 5.07B, I/O Address: 0x7000, IRQ Channel: 17/Level
      scsi0:   PCI Bus: 0, Device: 19, Address: 0xE0012000, Host Adapter SCSI ID: 7
      scsi0:   Parity Checking: Enabled, Extended Translation: Enabled
      scsi0:   Synchronous Negotiation: Ultra, Wide Negotiation: Enabled
      scsi0:   Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled
      scsi0:   Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211
      scsi0:   Driver Queue Depth: 211, Host Adapter Queue Depth: 192
      scsi0:   Tagged Queue Depth: Automatic, Untagged Queue Depth: 3
      scsi0:   SCSI Bus Termination: Both Enabled, SCAM: Disabled
      scsi0: *** BusLogic BT-958 Initialized Successfully ***
      scsi host0: BusLogic BT-958
      
      Also diagnostic output such as with the BusLogic=TraceConfiguration
      parameter is affected and becomes vertical and therefore hard to read.
      This has now been corrected, e.g.:
      
      pci 0000:00:13.0: PCI->APIC IRQ transform: INT A -> IRQ 17
      blogic_cmd(86) Status = 30:  4 ==>  4: FF 05 93 00
      blogic_cmd(95) Status = 28: (Modify I/O Address)
      blogic_cmd(91) Status = 30:  1 ==>  1: 01
      blogic_cmd(04) Status = 30:  4 ==>  4: 41 41 35 30
      blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D
      scsi: ***** BusLogic SCSI Driver Version 2.1.17 of 12 September 2013 *****
      scsi: Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>
      blogic_cmd(04) Status = 30:  4 ==>  4: 41 41 35 30
      blogic_cmd(0B) Status = 30:  3 ==>  3: 00 08 07
      blogic_cmd(0D) Status = 30: 34 ==> 34: 03 01 07 04 00 00 00 00 00 00 00 00 00 00 00 00 FF 42 44 46 FF 00 00 00 00 00 00 00 00 00 FF 00 FF 00
      blogic_cmd(8D) Status = 30: 14 ==> 14: 45 DC 00 20 00 00 00 00 00 40 30 37 42 1D
      blogic_cmd(84) Status = 30:  1 ==>  1: 37
      blogic_cmd(8B) Status = 30:  5 ==>  5: 39 35 38 20 20
      blogic_cmd(85) Status = 30:  1 ==>  1: 42
      blogic_cmd(86) Status = 30:  4 ==>  4: FF 05 93 00
      blogic_cmd(91) Status = 30: 64 ==> 64: 41 46 3E 20 39 35 38 20 20 00 C4 00 04 01 07 2F 07 04 35 FF FF FF FF FF FF FF FF FF FF 01 00 FE FF 08 FF FF 00 00 00 00 00 00 00 01 00 01 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 FC
      scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter
      
      etc.
      
      Link: https://lore.kernel.org/r/alpine.DEB.2.21.2104201940430.44318@angie.orcam.me.uk
      Fixes: 4bcc595c ("printk: reinstate KERN_CONT for printing continuation lines")
      Cc: stable@vger.kernel.org # v4.9+
      Acked-by: default avatarKhalid Aziz <khalid@gonehiking.org>
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      44d01fc8
    • Christoph Hellwig's avatar
      scsi: bsg-lib: Fix commands without data transfer in bsg_transport_sg_io_fn() · 659a3784
      Christoph Hellwig authored
      Set ret to 0 after the initial permission checks to avoid leaking -EPERM
      for commands without data transfer.
      
      Link: https://lore.kernel.org/r/20210731074027.1185545-3-hch@lst.de
      Fixes: 75ca5640 ("scsi: bsg: Move the whole request execution into the SCSI/transport handlers")
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      659a3784
    • Christoph Hellwig's avatar
      scsi: bsg: Fix commands without data transfer in scsi_bsg_sg_io_fn() · 5c0f6137
      Christoph Hellwig authored
      Set ret to 0 after the initial permission checks to avoid leaking -EPERM
      for commands without data transfer.
      
      Link: https://lore.kernel.org/r/20210731074027.1185545-2-hch@lst.de
      Fixes: 75ca5640 ("scsi: bsg: Move the whole request execution into the SCSI/transport handlers")
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      5c0f6137
  2. 31 Jul, 2021 8 commits
  3. 29 Jul, 2021 24 commits
  4. 27 Jul, 2021 4 commits