Public bug reported:

[Impact]
This is a code correctness issue found during code review. From my reading of 
the code, the spin_lock will always happen to have just been devm_kcalloc'd, 
which uses GFP_ZERO, before spin_lock_init() needs to be called. That may make 
the current code safe, but relying on that coincidence seems dangerous. There's 
also various debugging facilities in the kernel that appear to rely on proper 
spinlock initialization, and those may currently be broken.

[Test Case]
Boot test to look for regressions.

[Fix]
Backport a fix from the scsi maintainer's 4.19 queue which adds a 
spin_lock_init() call.

[Regression Risk]
The fix is limited to the hisi_sas driver and is obviously correct.

** Affects: linux (Ubuntu)
     Importance: Undecided
     Assignee: dann frazier (dannf)
         Status: In Progress

** Affects: linux (Ubuntu Bionic)
     Importance: Undecided
     Assignee: dann frazier (dannf)
         Status: In Progress

** Also affects: linux (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Changed in: linux (Ubuntu)
       Status: New => In Progress

** Changed in: linux (Ubuntu Bionic)
       Status: New => In Progress

** Changed in: linux (Ubuntu)
     Assignee: (unassigned) => dann frazier (dannf)

** Changed in: linux (Ubuntu Bionic)
     Assignee: (unassigned) => dann frazier (dannf)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1777734

Title:
  hisi_sas: Add missing PHY spinlock init

Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  [Impact]
  This is a code correctness issue found during code review. From my reading of 
the code, the spin_lock will always happen to have just been devm_kcalloc'd, 
which uses GFP_ZERO, before spin_lock_init() needs to be called. That may make 
the current code safe, but relying on that coincidence seems dangerous. There's 
also various debugging facilities in the kernel that appear to rely on proper 
spinlock initialization, and those may currently be broken.

  [Test Case]
  Boot test to look for regressions.

  [Fix]
  Backport a fix from the scsi maintainer's 4.19 queue which adds a 
spin_lock_init() call.

  [Regression Risk]
  The fix is limited to the hisi_sas driver and is obviously correct.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1777734/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to