Skip to content

Commit 4b3a24b

Browse files
committed
CA-392459: Avoid opening /dev/mem when calling biosdevname
biosdevname opens /dev/mem to read the $PIR PCI interrupt routing table. This fails with Secure Boot enabled and causes a warning in the kernel. log. Since the $PIR PCI interrupt routing table is used for routing PCI interrupts to ISA IRQs, it is not useful on any modern system so pass "-x" to biosdevname to avoid this behaviour. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
1 parent a93599b commit 4b3a24b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_biosdevname.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def test(self):
4545
# check after the fact that we mocked the proper calls
4646
self.assertEqual(popen_mock.call_count, 2)
4747
calls = popen_mock.call_args_list
48-
self.assertEqual(calls[0].args[0], ['/sbin/biosdevname', '--policy', 'physical', '-d'])
49-
self.assertEqual(calls[1].args[0], ['/sbin/biosdevname', '--policy', 'all_ethN', '-d'])
48+
self.assertEqual(calls[0].args[0], ['/sbin/biosdevname', '--policy', 'physical', '-d', '-x'])
49+
self.assertEqual(calls[1].args[0], ['/sbin/biosdevname', '--policy', 'all_ethN', '-d', '-x'])
5050
popen_kwargs = {"stdout": PIPE, "stderr": PIPE, "universal_newlines": True}
5151
self.assertEqual(calls[0].kwargs, popen_kwargs)
5252
self.assertEqual(calls[1].kwargs, popen_kwargs)

xcp/net/biosdevname.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __run_all_devices(policy = "physical"):
4040
"""
4141

4242
proc = Popen(["/sbin/biosdevname", "--policy", policy,
43-
"-d"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
43+
"-d", "-x"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
4444

4545
stdout, stderr = proc.communicate()
4646

0 commit comments

Comments
 (0)