gpio: Restrict usage of GPIO chip irq members before initialization
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-bluefield (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Asmaa Mnebhi |
Bug Description
SRU Justification:
[Impact]
GPIO chip irq members are exposed before they could be completely
initialized and this leads to race conditions.
One such issue was observed for the gc->irq.domain variable which
was accessed through the pwr-mlxbf.c driver in gpiochip_to_irq() before
it could be initialized by gpiochip_
Kernel NULL pointer dereference. This is a well known issue in the linux community
and was fixed via 2 commits:
5467801f1fcbdc4
and
06fb4ecfeac7e00
This race condition is intermittent and hard to reproduce.
[Fix]
* Cherry pick: 5467801f1fcbdc4
* cherry-pick: 06fb4ecfeac7e00
[Test Case]
* Check that the gpio-mlxbf2.c driver is loaded with no kernel panic
* check that all drivers dependent on gpio-mlxbf2.c driver are loaded (mlxbf-gige and pwr-mlxbf)
* do 5000 reboots to make sure this race condition no longer happens
[Regression Potential]
This could cause some regression with the use of gpio interrupts so it is important to test the dependent
drivers mlxbf-gige and pwr-mlxbf. Trigger power reset interrupt to test pwr-mlxbf and bring down/up the
oob_net0 interface to test mlxbf-gige.
CVE References
Changed in linux-bluefield (Ubuntu Focal): | |
assignee: | nobody → Asmaa Mnebhi (asmaam) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux-bluefield (Ubuntu): | |
status: | New → Invalid |
Changed in linux-bluefield (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done-focal removed: verification-needed-focal |
This bug is awaiting verification that the linux-bluefield /5.4.0- 1060.66 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification- needed- focal' to 'verification- done-focal' . If the problem still exists, change the tag 'verification- needed- focal' to 'verification- failed- focal'.
If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.
See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation how to enable and use -proposed. Thank you!