f8954b3f | 25-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
mctp-demux-daemon: Fix cleanup path on socket_init() failure
Now that we have potentially set up packet capture, make sure to clean up the packet capture resources if we get a failure during socket
mctp-demux-daemon: Fix cleanup path on socket_init() failure
Now that we have potentially set up packet capture, make sure to clean up the packet capture resources if we get a failure during socket initialisation.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I138cc24509bc6009ad0f3adda282e045a099984c
show more ...
|
cad47301 | 20-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
mctp-demux-daemon: Add packet capture option
Optionally enable libpcap support in mctp-demux-daemon to capture packets both from the Unix domain socket and binding interfaces. Providing the two capt
mctp-demux-daemon: Add packet capture option
Optionally enable libpcap support in mctp-demux-daemon to capture packets both from the Unix domain socket and binding interfaces. Providing the two capture points allows for tracking down issues with packets being dropped during binding initialisation.
As there's no formal linktype defined for MCTP or higher-level DMTF protocols command-line switches provide the ability to specify one of the private linktype values in the range 147-162.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I593d9e4be80c0198e643758f216e774169668a8c
show more ...
|
5d3d4e6d | 20-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
core: Add infrastructure for packet captures
A callback and user data member is defined to abstract out the implementation details of capturing the packets. The captured packets are in DSP0236 form,
core: Add infrastructure for packet captures
A callback and user data member is defined to abstract out the implementation details of capturing the packets. The captured packets are in DSP0236 form, i.e. no binding metadata is present.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Id8234d6e8f7856c70a0ca3fe5d4cee38ec11bd8c
show more ...
|
490e3873 | 24-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
mctp-demux: Add signalfd support
This allows us to clean up resources when the process is terminated.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia8ba75394490f0577bac7d860dbdb4f92e6
mctp-demux: Add signalfd support
This allows us to clean up resources when the process is terminated.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia8ba75394490f0577bac7d860dbdb4f92e672d2d
show more ...
|
cfeaef8e | 23-Jun-2021 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
Add compiler flags to enable dev testing
This just adds compiler flags to CMakeLists.txt to be on par with the autotools.
Tested: Manually invoked a developer build and verified
Signed-off-by: Sum
Add compiler flags to enable dev testing
This just adds compiler flags to CMakeLists.txt to be on par with the autotools.
Tested: Manually invoked a developer build and verified
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: Ibb129c2055ad57af57b4bca4ac81590afd994f8d
show more ...
|
34d4c96f | 16-Jun-2021 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
core: Handle exhaution of message contexts
If message contexts are exhausted, there is a possibility of NULL pointer dereference. Close this attack surface with a check on the message context creati
core: Handle exhaution of message contexts
If message contexts are exhausted, there is a possibility of NULL pointer dereference. Close this attack surface with a check on the message context creation status.
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: I208349b74a27a14b180c976bd78ec81a7991e43f
show more ...
|
bc79c24e | 16-Jun-2021 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
core: Handle arithmetic overflow in adding new fragments
Large fragment sizes can cause arithmetic overflows and can cause memory corruptions. However, this condition will not be hit with a fragment
core: Handle arithmetic overflow in adding new fragments
Large fragment sizes can cause arithmetic overflows and can cause memory corruptions. However, this condition will not be hit with a fragment size check in place and with a sane memory allocator in place.
Adding this check to ensure that we have defense in depth.
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: Iaa976ce636c1eb617afa75e852b39c50699ebeb2
show more ...
|
69f545f7 | 18-May-2021 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
core: Handle MCTP fragment sizes
Message assembly can be terminated if case we receive a middle/end packet of unexpected size. This provision is provided in DSP0236 v1.3.1 section 8.8 incorrect tran
core: Handle MCTP fragment sizes
Message assembly can be terminated if case we receive a middle/end packet of unexpected size. This provision is provided in DSP0236 v1.3.1 section 8.8 incorrect transmission unit.
Reception of middle packets whose size is not equal to start packet and end packets whose size is not less than or equal to the start packet causes message assembly termination.
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: I6371ab9e22e2c8ece70a9480f224de3f1f2f184e
show more ...
|
d4103f8f | 16-Jun-2021 |
Andrew Jeffery <andrew@aj.id.au> |
mctp-demux-daemon: Use systemd socket activation
Take advantage of lazy initialisation.
However, this also allows (one) daemon providing services over MCTP (pldmd) an opportunity to start prior to
mctp-demux-daemon: Use systemd socket activation
Take advantage of lazy initialisation.
However, this also allows (one) daemon providing services over MCTP (pldmd) an opportunity to start prior to MCTP interfaces coming up. This is a stunted way to provide capabilities that might be assumed by other components (the host) without implementing some required messages from the MCTP standard.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I4b1c21f4fd42f84e2c85a453570a74330fc70ecf
show more ...
|
507ba00d | 16-Jun-2021 |
Andrew Jeffery <andrew@aj.id.au> |
systemd: Own service startup ordering with respect to pldmd
We're about to turn the dependencies around so mctp-demux-daemon can be socket-activated by systemd. Move ownership of the start-up sequen
systemd: Own service startup ordering with respect to pldmd
We're about to turn the dependencies around so mctp-demux-daemon can be socket-activated by systemd. Move ownership of the start-up sequencing between mctp-demux-daemon and pldmd into libmctp so the switch to socket-activation is transparent to pldmd.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia094d7ce32eabccf86d6a53a4a74b7deea79488d
show more ...
|
ac1cd9dc | 15-Jun-2021 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Add subdirectory for systemd metadata
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I0989331aff807928fc23a4b298ef97c491714093 |
a523bcc1 | 19-May-2021 |
Helen Huang <he.huang@linux.intel.com> |
core: Check Null pointer in mctp_bridge_busses()
Handle memory allocation failures in mctp_bridge_busses to reduce the likelihood of a possible attack.
Change-Id: Ib8edc94ae5942dc1c0b2355aeb3642d07
core: Check Null pointer in mctp_bridge_busses()
Handle memory allocation failures in mctp_bridge_busses to reduce the likelihood of a possible attack.
Change-Id: Ib8edc94ae5942dc1c0b2355aeb3642d079512537 Signed-off-by: Helen Huang <he.huang@linux.intel.com>
show more ...
|
9f5b47a5 | 11-May-2021 |
Andrew Jeffery <andrew@aj.id.au> |
configure: Ensure udev rules are installed in rules.d
udevdir is set to the udev root, e.g. /lib/udev, while rules need to live in the rules.d subdirectory.
Signed-off-by: Andrew Jeffery <andrew@aj
configure: Ensure udev rules are installed in rules.d
udevdir is set to the udev root, e.g. /lib/udev, while rules need to live in the rules.d subdirectory.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I9416eb7e5a99a4bf8391a4ba135c26f43a79822c
show more ...
|
745b1d15 | 10-May-2021 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Ship udev rules to help with device and driver transition
Currently the OpenBMC kernel has a hacky device driver at drivers/char/misc/mctp-lpc.c that only works against KCS channel 4 on Aspe
astlpc: Ship udev rules to help with device and driver transition
Currently the OpenBMC kernel has a hacky device driver at drivers/char/misc/mctp-lpc.c that only works against KCS channel 4 on Aspeed BMCs. This hacky driver exposes an `mctp0` device node.
The intent is to replace it with one that is slightly less hacky at drivers/char/ipmi/kcs_bmc_cdev_raw.c[1], though eventually this too will be replaced by an in-kernel implementation of the entire LPC MCTP binding.
kcs_bmc_dev_raw.c works against all KCS devices in both Aspeed and Nuvoton BMC SoCs.
We need to move away from KCS channel 4 on the Aspeed BMCs as the way the hardware initialises the status bits conflicts with the protocol definition for the LPC MCTP binding[2].
Kill two birds with one stone by shipping udev rules that accomodate the new device node names that come with kcs_bmc_dev_raw.c, and symlink them upon creation to /dev/mctp0 to emulate the original mctp-lpc.c interface.
[1] https://lore.kernel.org/openbmc/20210510064955.1704652-1-andrew@aj.id.au/T/#me02d9a0e6ce82c9e0602cd615ccdad66d242af87 [2] https://github.com/openbmc/libmctp/blob/eba19a3b122a39ef2b5dbda49b418a202f78a48d/docs/bindings/vendor-ibm-astlpc.md#kcs-status-register-layout
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I21446936cea6c5e4024ec6536ad5983dd360deb2
show more ...
|
eba19a3b | 09-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Introduce protocol v3 with integrity checks
v3 of the binding adds a CRC-32 value as a medium-specific trailer to each packet passing over the binding interface.
The patch includes a naive
astlpc: Introduce protocol v3 with integrity checks
v3 of the binding adds a CRC-32 value as a medium-specific trailer to each packet passing over the binding interface.
The patch includes a naive bit-shift implementation of CRC-32, we can improve it later as necessary.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I93a95bccef30010d56e10e29b6d84554268ab7af
show more ...
|
39da3d03 | 12-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Split padding in pktbuf into header and trailer
The astlpc binding will shortly make use of a medium-specific trailer to implement a CRC-32 integrity check over packet data. Allow for mediu
libmctp: Split padding in pktbuf into header and trailer
The astlpc binding will shortly make use of a medium-specific trailer to implement a CRC-32 integrity check over packet data. Allow for medium-specific trailer data in the pktbuf in order to remove the need for a bounce-buffer. The binding will trim the pktbuf to the payload length before passing the instance up the stack.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ib215a552ff218b007f7f119c5235fbc75d9ca6cb
show more ...
|
88412be4 | 09-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Make packet properties depend on protocol version
The astlpc binding will shortly have an implementation of the v3 protocol specification. v3 adjusts the medium-specific packet size to inclu
astlpc: Make packet properties depend on protocol version
The astlpc binding will shortly have an implementation of the v3 protocol specification. v3 adjusts the medium-specific packet size to include a CRC-32 in a packet trailer. Implementing v3 must not impact the behaviour of earlier protocol versions, so provide an ops struct to handle version-specific details.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Iab04defa76b57a592442189e6ade58f25ed1d9ae
show more ...
|
d88c969c | 11-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: bindings: Add a Makefile
Makes local preview of changes easier to manage.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I67be4b51664c1b31ab183d2e2f9c63faaf34b919 |
0620b4c3 | 09-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Fix whitespace in ops struct
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: If64467bb99f480cddc0c315ef97069c0ab18d778 |
b719ae1c | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Define v3 of the protocol
v3 adds a CRC-32 integrity check across each packet exchanged via the binding.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie9b798e
docs: vendor-ibm-astlpc: Define v3 of the protocol
v3 adds a CRC-32 integrity check across each packet exchanged via the binding.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie9b798e1076e099525ebf7bcfe5d8ea81367ae3a
show more ...
|
a7e29ab4 | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Tweak description of header magic
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ied2a9d85c63d44bb227385f3ab981b44e8498d80 |
8b8f8059 | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Style code snippets as C
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I95a31775cef4f54e37a94cde5185493d3427f586 |
3297be51 | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Fix IDs in packet transmission sequences
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I974a1c72c57f899d297e7cb71e4dbec5ca325ea4 |
42a4afdc | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Increase prominence of endianness
Describe this before we get distracted by other details of the LPC FW window.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I
docs: vendor-ibm-astlpc: Increase prominence of endianness
Describe this before we get distracted by other details of the LPC FW window.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ibe2c17cdc60631a4402fd182be64d636c6835605
show more ...
|
cf08ac9c | 10-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
docs: vendor-ibm-astlpc: Annotate {M,L}SB in Bit column
Tidy up alignment of the descriptions.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie15ef81ed337bf183e6367e0f92547aa5bc2fd1a |