1. 30 12月, 2008 1 次提交
  2. 03 12月, 2008 1 次提交
  3. 02 12月, 2008 1 次提交
  4. 09 10月, 2008 1 次提交
  5. 12 7月, 2008 1 次提交
    • M
      [SCSI] aacraid: prevent copy_from_user() BUG! · 09050715
      Mark Salyzyn 提交于
      Seen:
      
      	kernel BUG at arch/i386/lib/usercopy.c:872
      
      under a 2.6.18-8.el5 kernel. Traced it to a garbage-in/garbage-out
      ioctl condition in the aacraid driver.
      
      Adaptec's special ioctl scb passthrough needs to check the validity of
      the individual scatter gather count fields to the maximum the adapter
      supports. Doing so will have the side effect of preventing
      copy_from_user() from bugging out while populating the dma buffers.
      This is a hardening effort, issue was triggered by an errant version
      of the management tools and thus the BUG should not be seen in the
      field.
      
      [jejb: fixed up compile failure]
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      09050715
  6. 21 6月, 2008 1 次提交
  7. 05 6月, 2008 1 次提交
  8. 03 5月, 2008 3 次提交
  9. 02 5月, 2008 1 次提交
  10. 20 4月, 2008 1 次提交
  11. 19 4月, 2008 2 次提交
  12. 16 4月, 2008 2 次提交
  13. 08 4月, 2008 3 次提交
  14. 12 2月, 2008 3 次提交
  15. 08 2月, 2008 3 次提交
    • S
      [SCSI] aacraid: do not set valid bit in sense information · 8e31e607
      Salyzyn, Mark 提交于
      Luben Tuikov [mailto:ltuikov@yahoo.com] sez:
      > Just as in your case and Tony's case, which I presume
      > uses the same RAID firmware vendor, it would've
      > probably been better if the RAID firmware vendor
      > fixed the firmware to not set the VALID bit if the
      > INFORMATION field is not valid.
      
      Point taken regarding the aacraid driver. Dropped the VALID bit, and
      then did some cleanup/simplification of the set_sense procedure and
      the associated parameters. Mike did some preliminary tests when the
      VALID bit was dropped before the 'Re: [PATCH] [SCSI] sd: make error
      handling more robust' patches came on the scene. The change in the
      SCSI subsystem does make this enclosed aacraid patch unnecessary, so
      this aacraid patch is merely post battle ground cleanup. If the
      simplification is an issue, repugnant, too much for a back-port to the
      stable trees or clouds the point, this patch could be happily
      distilled down to:
      
      diff -ru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
      --- a/drivers/scsi/aacraid/aachba.c     2008-02-06 16:26:45.834938955 -0500
      +++ b/drivers/scsi/aacraid/aachba.c     2008-02-06 16:32:01.109035329 -0500
      @@ -865,7 +865,7 @@
                               u32 residue)
       {
      -        sense_buf[0] = 0xF0;    /* Sense data valid, err code 70h (current error) */
      +        sense_buf[0] = 0x70;    /* Sense data invalid, err code 70h (current error) */
               sense_buf[1] = 0;       /* Segment number, always zero */
      
               if (incorrect_length) {
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      8e31e607
    • S
      [SCSI] aacraid: pci_set_dma_max_seg_size opened up for late model controllers · 62e9f5c4
      Salyzyn, Mark 提交于
      This patch ensures that the modern adapters get a maximum sg segment
      size on par with the maximum transfer size. Added some localized
      janitor fixes to the discussion patch I used with Fujita.
      
      FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp] sez:
      > I think that setting the proper maximum segment size for the late
      > model cards (as you did above) makes sense.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      62e9f5c4
    • S
      [SCSI] aacraid: fib context lock for management ioctls (take 2) · 5234e25c
      Salyzyn, Mark 提交于
      The first patch (a119ee8e) was a bit
      too aggressive and nested the locks (!) unit testing was in
      error. This patch was reverted by
      203a512f.
      
      This new patch should fix the locks correctly.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      5234e25c
  16. 06 2月, 2008 1 次提交
  17. 31 1月, 2008 2 次提交
  18. 25 1月, 2008 1 次提交
  19. 24 1月, 2008 11 次提交
    • S
      [SCSI] aacraid: add Voodoo Lite class of cards. · cb1042f2
      Salyzyn, Mark 提交于
      The cards being added are supported in a limited sense already through
      family matching, but we needed to add some functionality to the driver
      to expose selectively the physical drives. These Physical drives are
      specifically marked to not be part of any array and thus are declared
      JBODs (Just a Bunch Of Drives) for generic SCSI access.
      
      We report that this is the second patch in a set of two, but merely
      depends on the stand-alone functionality of the first patch which adds
      in that case the ability to report a driver feature flag via sysfs. We
      leverage that functionality by reporting that this driver now supports
      this new JBOD feature for the controller so that the array management
      applications may react accordingly and guide the user as they manage
      the controller.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      cb1042f2
    • S
      [SCSI] aacraid: add new driver features flags · 2ca39c48
      Salyzyn, Mark 提交于
      Feature enhancement, adding a 'flags' entry that will reside in the
      host controller's tree, with a newline separated list of arbitrary
      ascii named features that indicate whether the combination of driver
      and controller has support for said feature. Breaking from the
      one-line output typical of sysfs entries, newline was added to tailor
      for grep, or simple gets line by line string match within an
      application. I added one for a compiler time check for existence of
      debug print output, one for an optional manifest defined enhanced
      status reporting in the logs, and one for runtime reporting whether
      the controller and driver supports arrays larger than 2TB. Adaptec's
      storage management software uses the last flag to determine whether to
      make available the creation of arrays larger than 2TB, otherwise a
      warning is posted.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      2ca39c48
    • S
      [SCSI] aacraid: remove pigs in space · 8ce3eca4
      Salyzyn, Mark 提交于
      I was amazed at how much embedded space was present in the aacraid
      driver source files. Just selected five files from the set to clean up
      for now and the attached patch swelled to 73K in size!
      
      - Removed trailing space or tabs
      - Removed spaces embedded within tabs
      - Replaced leading 8 spaces with tabs
      - Removed spaces before )
      - Removed ClusterCommand as it was unused (noticed it as one triggered by above)
      - Replaced scsi_status comparison with 0x02, to compare against SAM_STATUS_CHECK_CONDITION.
      - Replaced a long series of spaces with tabs
      - Replaced some simple if...defined() with ifdef/ifndef
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      8ce3eca4
    • A
      [SCSI] aacraid: fix security weakness · d496f94d
      Alan Cox 提交于
      Actually there are several but one is trivially fixed
      
      1.	FSACTL_GET_NEXT_ADAPTER_FIB ioctl does not lock dev->fib_list
      but needs to
      2.	Ditto for FSACTL_CLOSE_GET_ADAPTER_FIB
      3.	It is possible to construct an attack via the SRB ioctls where
      the user obtains assorted elevated privileges. Various approaches are
      possible, the trivial ones being things like writing to the raw media
      via scsi commands and the swap image of other executing programs with
      higher privileges.
      
      So the ioctls should be CAP_SYS_RAWIO - at least all the FIB manipulating
      ones. This is a bandaid fix for #3 but probably the ioctls should grow
      their own capable checks. The other two bugs need someone competent in that
      driver to fix them.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      d496f94d
    • S
      [SCSI] aacraid: replace '<?:' with min_t() · 3ace426f
      Salyzyn, Mark 提交于
      The promised min_t() cleanup. Purely cosmetic.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3ace426f
    • F
      [SCSI] replace sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE · b80ca4f7
      FUJITA Tomonori 提交于
      This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in
      several LLDs. It's a preparation for the future changes to remove
      sense_buffer array in scsi_cmnd structure.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b80ca4f7
    • S
      [SCSI] aacraid: SMC vendor identification · 3bc8070f
      Salyzyn, Mark 提交于
      Due to an internal limit associated with the AdapterTypeText field,
      SMC required a product ID that overloaded the combined vendor and
      product ID. A decision was made to ship the SMC products without a
      vendor string dropping the defacto space that used to delineate vendor
      and product to boot. To correct this, we needed to adjust the code in
      the driver to parse out the vendor and product strings for the
      adapter. We match of 'AOC' in the AdapterTypeText, if so we set the
      vendor to SMC and place the entire AdapterTypeText into the product
      field.
      
      This only affects the cosmetic presentation of the Adapter vendor and
      product in the logs and in sysfs.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3bc8070f
    • S
      [SCSI] aacraid: respond to enclosure service events · 0995ad38
      Salyzyn, Mark 提交于
      Added support to respond to enclosure service events
      (controller AIFs) to add, online or offline physical targets
      reported to sg. Also added online and offlining of arrays.
      Removed an automatic variable definition in a sub block that
      hid an earlier definition, determined to be inert as the
      sub-block use did not interfere. Bumped the driver versioning
      to stamp the addition of this feature.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      0995ad38
    • S
      [SCSI] aacraid: add call to flush_kernel_dcache_page · 3a0086a8
      Salyzyn, Mark 提交于
      Some architectures require a call to flush_kernel_dcache_page for
      processor spoofed DMA operations.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3a0086a8
    • S
      [SCSI] aacraid: improve queue balancing · b18268fc
      Salyzyn, Mark 提交于
      The adapter queue is divided up equally to all the arrays to prevent
      command starvation to any individual array. On the other hand,
      physical targets are only granted a queue depth of one each. The code
      prior to this patch used to deal with the incremental discovery of
      targets, but the driver knows how many arrays are present prior to the
      scan so this knowledge is used to generate a better estimate for the
      queue depth.
      
      Remove the capability of 'physical=0' from preventing access to the
      class of adapters that have the RAID/SCSI mode of operation since none
      of the physicals on the SCSI channel are candidates ever for an array.
      
      As always, the user can override this default queue depth policy by
      making the appropriate adjustments utilizing sysfs.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b18268fc
    • S
      [SCSI] aacraid: OS panic after Adapter panic (hardening). · b6ef70f3
      Salyzyn, Mark 提交于
      In experiments in the lab we managed to trigger an Adapter firmware
      panic (BlinkLED) coincidentally while several pass-through ioctl
      command from the management software were outstanding on a bug only
      present on a class of RAID Adapters that require a hardware reset
      rather than a commanded reset. The net result was an attempt to time
      out the management software command as if it came from the SCSI layer
      resulting in an OS panic.
      
      Adapters that use commanded reset, management commands are returned
      failed by the Adapter correctly. The adapter firmware panic that
      resulted in this condition was also resolved, and there were no
      adapters in the field with this specific firmware bug so we do not
      expect any field reports. This is a rare or unlikely corner condition,
      and no reports have ever been forwarded from the field.
      Signed-off-by: NMark Salyzyn <aacraid@adaptec.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b6ef70f3