commit | 5238bd3205c61efa4ff82c0c5a4eb9d594a0865b | [log] [tgz] |
---|---|---|
author | AppaRao Puli <apparao.puli@linux.intel.com> | Tue Nov 17 11:03:11 2020 +0530 |
committer | AppaRao Puli <apparao.puli@linux.intel.com> | Tue Nov 17 11:03:11 2020 +0530 |
tree | bfd821d1437095db1cc6f6c3746afb42abb86b29 | |
parent | 929d4b57f10bc4200e16b71fbcf32521d8cc23c1 [diff] |
fix bmcweb crash during sol communication After establishing the obmc_console socket communication, If client closes the connection abruptly, async read/write operation fails with asio.ssl.stream error. To handle the error, it calls closeHandler call back function and cleans the session and socket. Any ongoing async read operation should be discarded by checking socket handle. Read/Write the message from stream via async_read_some()/async_write without checking socket handle, causes the crash. Added socket handle validation before performing any read/write operation to avoid crash. Tested: - Without fix, when sol connection closes abruptly, at times saw the crash with below logs. Nov 13 11:32:51 intel-obmc bmcweb[20169]: doRead error asio.ssl.stream:1 Nov 13 11:32:51 intel-obmc systemd[1]: bmcweb.service: Main process exited, code=dumped, status=11/SEGV Nov 13 11:32:51 intel-obmc systemd[1]: bmcweb.service: Failed with result 'core-dump'. - With fix, verified the case and no crashes seen. Nov 13 12:55:04 intel-obmc bmcweb[24426]: (2020-11-13 12:55:04) [ERROR "websocket.h":207] doRead error asio.ssl.stream:1 Nov 13 12:55:04 intel-obmc bmcweb[24426]: (2020-11-13 12:55:04) [ERROR "obmc_console.hpp":67] doread() - Socket closed Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: I2afda509ca77a561651a8682e042c45ca7366642
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja coverage -C builddir test
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.