CVE-2022-50174

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-50174
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50174.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-50174
Downstream
Published
2025-06-18T11:15:47Z
Modified
2025-07-01T14:24:43.069904Z
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

net: hinic: avoid kernel hung in hinicgetstats64()

When using hinic device as a bond slave device, and reading device stats of master bond device, the kernel may hung.

The kernel panic calltrace as follows: Kernel panic - not syncing: softlockup: hung tasks Call trace: nativequeuedspinlockslowpath+0x1ec/0x31c devgetstats+0x60/0xcc devseqprintfstats+0x40/0x120 devseqshow+0x1c/0x40 seqreaditer+0x3c8/0x4dc seqread+0xe0/0x130 procregread+0xa8/0xe0 vfsread+0xb0/0x1d4 ksysread+0x70/0xfc _arm64sysread+0x20/0x30 el0svccommon+0x88/0x234 doel0svc+0x2c/0x90 el0svc+0x1c/0x30 el0synchandler+0xa8/0xb0 el0_sync+0x148/0x180

And the calltrace of task that actually caused kernel hungs as follows: _switchto+124 _schedule+548 schedule+72 scheduletimeout+348 _downcommon+188 _down+24 down+104 hinicgetstats64+44 [hinic] devgetstats+92 bondgetstats+172 [bonding] devgetstats+92 devseqprintfstats+60 devseqshow+24 seqreaditer+964 seqread+220 procregread+164 vfsread+172 ksysread+108 _arm64sysread+28 el0svccommon+132 doel0svc+40 el0svc+24 el0synchandler+164 el0sync+324

When getting device stats from bond, kernel will call bondgetstats(). It first holds the spinlock bond->statslock, and then call hinicgetstats64() to collect hinic device's stats. However, hinicget_stats64() calls down(&nic_dev->mgmt_lock) to protect its critical section, which may schedule current task out. And if system is under high pressure, the task cannot be woken up immediately, which eventually triggers kernel hung panic.

Since previous patch has replaced hinicdev.txstats/rxstats with local variable in hinicget_stats64(), there is nothing need to be protected by lock, so just removing down()/up() is ok.

References

Affected packages

Debian:11 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.140-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1
5.10.113-1
5.10.120-1~bpo10+1
5.10.120-1
5.10.127-1
5.10.127-2~bpo10+1
5.10.127-2
5.10.136-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.2-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.2-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}