Summary: | _fireinfo.detect_hypervisor() rises Segmentation fault | ||
---|---|---|---|
Product: | Fireinfo | Reporter: | Mauro Condarelli <mc5686> |
Component: | Client | Assignee: | Michael Tremer <michael.tremer> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | Crash | ||
Priority: | Will affect almost no one | CC: | adolf.belka, peter.mueller |
Version: | unspecified | ||
Hardware: | x86_64 | ||
OS: | Linux |
Description
Mauro Condarelli
2023-06-21 20:37:10 UTC
http://git.ipfire.org/?p=oddments/fireinfo.git;a=commit;h=f092d0a62749b2802ed4f4bbe78208c790cc6831 Author: Michael Tremer <michael.tremer@ipfire.org> virt: Fix off-by-one error when detecting hypervisor Reported-by: Mauro Condarelli <mc5686@mclink.it> Fixes: #13155 - _fireinfo.detect_hypervisor() rises Segmentation fault Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Hello Mauro, thank you for submitting this. I have fixed the off-by-one error here: > https://git.ipfire.org/?p=oddments/fireinfo.git;a=commitdiff;h=f092d0a62749b2802ed4f4bbe78208c790cc6831 The entire routine is very dated and I am not sure how many hypervisors that have emerged since then are being missed by us. I agree that we should rely on the version from systemd, but that is however not easily accessible through their library. Currently I do not quite know why we are running fireinfo as it is costing a lot of resources for very little benefit, but that is a different debate. So I am not sure whether it is a good idea to add LXD being detected as QEMU. > Note: IPFire seems to run fine in spite of this error in my environment. Yes, this is mostly a cosmetic issue. Thanks Michael, I did not actually check your fix, but at first glance it seems you changed the "off-by-one" error in an "off-by-two" one. My suggested fix is to completely avoid "HYPER_LAST" (unused) and use "HYPER_OTHER" in the loop. http://git.ipfire.org/?p=oddments/fireinfo.git;a=commit;h=e3e68b9baa9723916b1999394432e9ad260cfaa2 Author: Michael Tremer <michael.tremer@ipfire.org> virt: Fix off-by-one error when detecting hypervisor Reported-by: Mauro Condarelli <mc5686@mclink.it> Fixes: #13155 - _fireinfo.detect_hypervisor() rises Segmentation fault Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> (In reply to Mauro Condarelli from comment #3) > Thanks Michael, > I did not actually check your fix, but at first glance it seems you > changed the "off-by-one" error in an "off-by-two" one. > > My suggested fix is to completely avoid "HYPER_LAST" (unused) and use > "HYPER_OTHER" in the loop. You are right... I produced absolute bullshit here. Another attempt: > https://git.ipfire.org/?p=oddments/fireinfo.git;a=commitdiff;h=e3e68b9baa9723916b1999394432e9ad260cfaa2 The entire code there is quite messy and I would rewrite it entirely if I had the time :) |