Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 600196 - sys-kernel/hardened-sources-4.8.8 - GRKERNSEC_KSTACKOVERFLOW causes "AMD-Vi: Completion-Wait loop timed out"
Summary: sys-kernel/hardened-sources-4.8.8 - GRKERNSEC_KSTACKOVERFLOW causes "AMD-Vi: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-18 21:46 UTC by Alexander Tsoy
Modified: 2016-11-25 13:12 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel log (hardened-sources-4.8.8) (dmesg-iommu.log,54.01 KB, text/plain)
2016-11-18 22:09 UTC, Alexander Tsoy
Details
kernel log (vanilla-sources-4.8.8) (dmesg-iommu-good.log,115.93 KB, text/plain)
2016-11-18 22:31 UTC, Alexander Tsoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Tsoy 2016-11-18 21:46:35 UTC
When iommu is enabled, kernel constantly flooding with the following errors:

[    3.943678] AMD-Vi: Completion-Wait loop timed out
[    4.069905] AMD-Vi: Completion-Wait loop timed out
[    4.193441] AMD-Vi: Completion-Wait loop timed out
[    4.314378] AMD-Vi: Completion-Wait loop timed out
[    4.435285] AMD-Vi: Completion-Wait loop timed out
[    4.556225] AMD-Vi: Completion-Wait loop timed out
[    4.710102] AMD-Vi: Completion-Wait loop timed out
[    4.836121] AMD-Vi: Completion-Wait loop timed out
[    4.962122] AMD-Vi: Completion-Wait loop timed out
[    5.088122] AMD-Vi: Completion-Wait loop timed out
[    5.214121] AMD-Vi: Completion-Wait loop timed out
[    5.340118] AMD-Vi: Completion-Wait loop timed out
[    5.466123] AMD-Vi: Completion-Wait loop timed out
[    5.603982] AMD-Vi: Completion-Wait loop timed out
[    5.730996] AMD-Vi: Completion-Wait loop timed out
[    5.857953] AMD-Vi: Completion-Wait loop timed out
[    5.984904] AMD-Vi: Completion-Wait loop timed out
[    6.111936] AMD-Vi: Completion-Wait loop timed out
[    6.269186] AMD-Vi: Completion-Wait loop timed out
[    6.398025] AMD-Vi: Completion-Wait loop timed out
[    6.524039] AMD-Vi: Completion-Wait loop timed out
[    6.650039] AMD-Vi: Completion-Wait loop timed out

System boots with a lot of service start timeouts. Network, display, etc doesn't work. However I can see login prompt via serial console. %)

Mainline kernel (vanilla-sources-4.8.8) with the same config works fine. Disabling IOMMU (amd_iommu=off on the kernel cmdline) workarounds this issue.

The CPU in this system is Piledriver-based Opteron (4300 series).
Comment 1 Alexander Tsoy 2016-11-18 22:09:02 UTC
Created attachment 453750 [details]
kernel log (hardened-sources-4.8.8)
Comment 2 Alexander Tsoy 2016-11-18 22:31:16 UTC
Created attachment 453752 [details]
kernel log (vanilla-sources-4.8.8)

Ignore IO_PAGE_FAULT errors caused by amdgpu driver. It's a known unrelated issue.
Comment 3 Alexander Tsoy 2016-11-21 22:30:39 UTC
The problem persists with hardened-sources-4.8.9. I also tested gentoo-sources-4.8.9 and It works fine when IOMMU is enabled.
Comment 4 Alexander Tsoy 2016-11-21 23:00:53 UTC
It's due to GRKERNSEC_KSTACKOVERFLOW
Comment 5 PaX Team 2016-11-22 11:27:10 UTC
this is an issue that upstream already fixed as it got exposed by their new VMAP_STACK feature (similar to grsec's KSTACKOVERFLOW): http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bf5beef578e46393f11eb69dda7d17a065e05ff . i guess we'll just backport it into grsec if you can confirm that it fixes your 4.8 too.
Comment 6 Alexander Tsoy 2016-11-23 21:47:37 UTC
(In reply to PaX Team from comment #5)

It fixed my 4.8. Thanks!
Comment 7 Alexander Tsoy 2016-11-25 07:10:49 UTC
Fixed in hardened-sources-4.8.10 (grsecurity-3.1-4.8.10-201611232213.patch)
Comment 8 Anthony Basile gentoo-dev 2016-11-25 13:12:56 UTC
(In reply to Alexander Tsoy from comment #7)
> Fixed in hardened-sources-4.8.10 (grsecurity-3.1-4.8.10-201611232213.patch)

thanks for testing i was just about to ask :)