#770472 libfreeipmi12: programs using libfreeipmi2 crash the first time after a system boot

#770472#5
Date:
2014-11-21 14:54:22 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

Ran a program linked against libfreeipmi2, for example bmc-config.

   * What was the outcome of this action?

Segfault:

[  304.932148] traps: bmc-config[6848] general protection ip:7fa773b714d8 sp:7ffffbda9070 error:0 in libfreeipmi.so.12.0.3[7fa773a13000+29d000]

   * What outcome did you expect instead?

No segfault?

The very very strange part of the bug is that this happens the first time libfreeipmi12 is used after a system boot, not subsequent times.

This is on 3.16-0.bpo.2-amd64, as the Dom0 for xen-4.1.  The hardware is a Dell Poweredge 840.

#770472#10
Date:
2014-11-21 15:20:57 UTC
From:
To:
Ok, it's not exactly how I described it,

bmc-config (and some other commands) will crash *until* ipmi-sensors is
run, at which point it will start working.

Until the next reboot.

#770472#15
Date:
2014-11-21 15:47:10 UTC
From:
To:
The bug only happens when running under xen, not on the bare metal.

So I guess it's a xen bug really.

#770472#20
Date:
2014-11-21 20:01:58 UTC
From:
To:
thanks for digging into it... not sure if I should do anything about it,
but let's at least ask upstream

Dear Albert,

User reported some kernel trap hit upon initial boot in Xen instances,
see more detail :

Package: libfreeipmi12
Version: 1.1.5-3
http://bugs.debian.org/770472

Is that something familiar/resolvable at freeipmi level?

Cheers!

#770472#25
Date:
2014-11-21 21:30:54 UTC
From:
To:
I imagine the bug is somewhere in xen's memory mapped I/O area if it's
happening the first time after boot.

Since I'm just using the normal in() and out() calls, not sure there's
much I can do.  If there is a way to massage freeipmi to not trigger the
bug we could work around it, but I have no idea how one might massage
it.
-- 
Albert Chu
chu11@llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory

#770472#30
Date:
2014-11-22 09:48:07 UTC
From:
To:
I'm pretty sure this is  a Xen bug -- another datapoint is that I have
another machine with the same setup where the Dom0 has spontaneously
rebooted 4 times - the problem "went away" when I tried ipmi-sensors on
it.   I imagine the reboots were caused by the kernel hitting the same trap.

I'll reassign to Xen and do more testing Monday.
























\

#770472#41
Date:
2026-10-10 18:54:39 UTC
From:
To:
Hi,

I'm closing this bug: as you found, the crash only happened under Xen,
and upstream agreed it is outside freeipmi, which only uses plain in/out
port I/O after iopl().

The likely cause is the kernel bug fixed as CVE-2016-3157 / XSA-171
(IOPL not properly context-switched on 64-bit PV Xen guests), fixed in
Debian in June 2016 (DLA-516-1, DSA-3607-1).

If you can still reproduce it with a current kernel and freeipmi, please
reopen.

Regards,
Fabio