1# Changelog 2 3All notable changes to this project will be documented in this file. 4 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6and this project adheres to 7[Semantic Versioning](https://semver.org/spec/v2.0.0.html). 8 9Change categories: 10 11- Added 12- Changed 13- Deprecated 14- Removed 15- Fixed 16- Security 17 18## [Unreleased] 19 20### Removed 21 221. Deprecated functions with the `_check` suffix 23 24 - `pldm_bios_table_append_pad_checksum_check()` 25 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 26 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 27 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 28 - `pldm_bios_table_attr_entry_enum_encode_check()` 29 - `pldm_bios_table_attr_entry_integer_encode_check()` 30 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 31 - `pldm_bios_table_attr_entry_string_encode_check()` 32 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 33 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 34 - `pldm_bios_table_attr_value_entry_encode_string_check()` 35 - `pldm_bios_table_string_entry_decode_string_check()` 36 - `pldm_bios_table_string_entry_encode_check()` 37 - `pldm_entity_association_pdr_add_check()` 38 39## [0.9.1] - 2024-09-07 40 41### Changed 42 431. Moved evolutions intended for v0.9.0 into place 44 45 Evolutions for the release have been moved from `evolutions/current` to 46 `evolutions/v0.9.1`. Library users can apply them to migrate off of 47 deprecated APIs. 48 49## [0.9.0] - 2024-09-07 50 51### Added 52 531. base: Define macros for reserved TIDs 542. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 553. pdr: Add pldm_entity_association_pdr_create_new() 564. platform: Define macros for the responded transferflags 575. pdr: Add pldm_pdr_get_terminus_handle() API 586. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 597. fw_update: Add encode req & decode resp for get_downstream_fw_params 608. platform: Add decode_pldm_platform_cper_event() API 619. decode_get_pdr_repository_info_resp_safe() 62 63 Replaces decode_get_pdr_repository_info_resp() as discussed in the 64 `Deprecated` section below 65 6610. decode_get_pdr_resp_safe() 67 68 Replaces decode_get_pdr_resp() as discussed in the `Deprecated` section 69 below 70 71### Changed 72 731. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 742. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 753. platform: Stabilise decode_pldm_message_poll_event_data() APIs 764. ABI break for decode_sensor_op_data() 77 78 Applying LIBPLDM_CC_NONNULL to the internal msgbuf APIs caused 79 abi-compliance-checker to flag a change in the register containing the 80 parameter `previous_op_state`. 81 825. platform: Stabilise decode_pldm_platform_cper_event() API 83 84### Deprecated 85 861. Rename and deprecate functions with the `_check` suffix 87 88 All library function return values always need to be checked. The `_check` 89 suffix is redundant, so remove it. Migration to the non-deprecated 90 equivalents without the `_check` suffix can be performed using 91 `scripts/ apply-renames` and the [clang-rename][] configurations under 92 `evolutions/` 93 94 The deprecated functions: 95 96 - `get_fru_record_by_option_check()` 97 - `pldm_bios_table_append_pad_checksum_check()` 98 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 99 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 100 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 101 - `pldm_bios_table_attr_entry_enum_encode_check()` 102 - `pldm_bios_table_attr_entry_integer_encode_check()` 103 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 104 - `pldm_bios_table_attr_entry_string_encode_check()` 105 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 106 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 107 - `pldm_bios_table_attr_value_entry_encode_string_check()` 108 - `pldm_bios_table_string_entry_decode_string_check()` 109 - `pldm_bios_table_string_entry_encode_check()` 110 - `pldm_entity_association_pdr_add_check()` 111 - `pldm_entity_association_pdr_add_from_node_check()` 112 - `pldm_pdr_add_check()` 113 - `pldm_pdr_add_fru_record_set_check()` 114 115[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 116 1172. `decode_get_pdr_repository_info_resp()` 118 119 Users should move to `decode_get_pdr_repository_info_resp_safe()` which 120 eliminates the opportunity for buffer overruns when extracting objects from 121 the message. 122 1233. `decode_get_pdr_resp()` 124 125 Users should move to `decode_get_pdr_resp_safe()` which reduces the 126 invocation tedium and improves memory safety over `decode_get_pdr_resp()`. 127 128### Removed 129 1301. IBM OEM header compatibility symlinks. 131 132 Anyone left using the deprecated paths can migrate using the coccinelle patch 133 at `evolutions/current/oem-ibm-header-compat.cocci`. 134 135### Fixed 136 1371. requester: instance-id: Release read lock on conflict 138 139## [0.8.0] - 2024-05-23 140 141### Added 142 1431. base: Provide pldm_msg_hdr_correlate_response() 1442. transport: af-mctp: Add pldm_transport_af_mctp_bind() 1453. oem: ibm: Add chapdata file type support 1464. base: Added PLDM_SMBIOS & PLDM_RDE message types 1475. oem: meta: Add decode_oem_meta_file_io_req() 1486. state-set: Add all state set values to system power state enum as per DSP0249 1497. platform: Add alias members to the enum 150 pldm_pdr_repository_chg_event_change_record_event_data_operation. 151 152 enum constants with inconsistent names are deprecated with this change. 153 remove old inconsistent enum members after backward compatibility cleanup is 154 done 155 1568. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 1579. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 15810. platform: Add 3 PDR type enum for Redfish Device Enablement per 159 DSP0248_1.2.0 16011. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 16112. entity: Add enum for Network Interface Connectors and Network Ports 162 Connection Types 16313. pdr: Add decode_numeric_effecter_pdr_data() 16414. oem: ibm: Support for the Real SAI entity id 16515. fw_update: Add encode req & decode resp for query_downstream_devices 16616. fw_update: Add encode req & decode resp for query_downstream_identifiers 16717. platform: Add support for GetStateEffecterStates command 168 169### Changed 170 1711. base: Stabilise pldm_msg_hdr_correlate_response() 1722. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1733. libpldm: Fix header use 1744. libpldm: More fixes for header use 1755. pdr: Stabilise pldm_pdr_find_last_in_range() API 1766. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1777. oem: meta: stabilise decode_oem_meta_file_io_req() 1788. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 179 180### Deprecated 181 1821. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 183 with `PLDM_OEM_IBM_` 184 185### Fixed 186 1871. libpldm: Rationalise the local and installed path of pldm.h 1882. pdr: Assign record_handle in entity_association_pdr_add_children() 1893. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1904. pdr: Remove redundant constant for minimum numeric sensor PDR length 1915. tests: oem: meta: Fix fileio use of msgbuf 192 193## [0.7.0] - 2023-08-29 194 195### Added 196 1971. state-set: Add new enum for Operational Fault Status enum 198 199### Changed 200 2011. transport: Match specified metadata in pldm_transport_send_recv_msg() 2022. transport: mctp-demux: Drop ABI annotation for internal symbols 2033. transport: Stabilise core transport and implementation APIs 204 205 This stabilisation covers the following headers and functions: 206 207 - libpldm/transport.h 208 209 - pldm_transport_poll() 210 - pldm_transport_send_msg() 211 - pldm_transport_recv_msg() 212 - pldm_transport_send_recv_msg() 213 214 - libpldm/transport/af-mctp.h 215 216 - pldm_transport_af_mctp_init() 217 - pldm_transport_af_mctp_destroy() 218 - pldm_transport_af_mctp_core() 219 - pldm_transport_af_mctp_init_pollfd() 220 - pldm_transport_af_mctp_map_tid() 221 - pldm_transport_af_mctp_unmap_tid() 222 223 - libpldm/transport/mctp-demux.h 224 - pldm_transport_mctp_demux_init() 225 - pldm_transport_mctp_demux_destroy() 226 - pldm_transport_mctp_demux_core() 227 - pldm_transport_mctp_demux_init_pollfd() 228 - pldm_transport_mctp_demux_map_tid() 229 - pldm_transport_mctp_demux_unmap_tid() 230 231### Deprecated 232 2331. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 234 `libpldm/requester/pldm.h`): 235 236 - pldm_open() 237 - pldm_send_recv() 238 - pldm_send() 239 - pldm_recv() 240 - pldm_recv_any() 241 - pldm_close() 242 243 Users should migrate to the newer "transport" APIs instead. 244 245## Fixed 246 2471. tests: Exclude transport tests when build excludes testing ABIs 2482. abi: Capture deprecation of pldm_close() 249 250## [0.6.0] - 2023-08-22 251 252### Changed 253 2541. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 2552. meson: Apply `b_ndebug=if-release` by default 2563. pdr : Stabilize pldm_entity_association_tree_add_entity() 2574. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 2585. pdr: Stabilize pldm_entity_node_get_remote_container_id() 2596. transport: af-mctp: Assign out-params on success in \*\_recv() 2607. transport: Generalise the pldm_transport_recv_msg() API 261 262### Removed 263 2641. pdr: Remove pldm_entity_association_pdr_add() 2652. state-set: Remove enum pldm_state_set_operational_fault_status_values 266 267### Fixed 268 2691. transport: register init_pollfd callback for af-mctp 2702. transport: fix init_pollfd function parameter 2713. transport: Fix doxygen and variables for send and recv functions 2724. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 273 274## [0.5.0] - 2023-08-09 275 276### Added 277 2781. pdr: Introduce pldm_entity_association_pdr_add_check() 279 280### Changed 281 2821. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2832. transport: pldm_transport_poll(): Adjust return value semantics 2843. transport: free un-wanted responses in pldm_transport_send_recv_msg() 285 286### Deprecated 287 2881. state-set: Enum pldm_state_set_operational_fault_status_values 289 290 The enum operational_fault_status is defined with wrong members and will 291 eventually be replaced with the correct members. Any uses of 292 pldm_state_set_operational_fault_status_values members should move to 293 equivalent pldm_state_set_operational_stress_status_values members if needed. 294 2952. platform: Struct field name in fru_record_set PDR 296 297 References to entity_instance_num should be changed to entity_instance 298 2993. platform: Struct field name in numeric sensor value PDR 300 301 References to entity_instance_num should be changed to entity_instance 302 303### Removed 304 3051. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 3062. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 3073. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 3084. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 3095. bios_table: Remove pldm_bios_table_append_pad_checksum() 3106. fru: Remove get_fru_record_by_option() 3117. pdr: Make is_present() static 3128. pdr: Remove pldm_pdr_add() 3139. pdr: Remove pldm_pdr_add_fru_record_set() 31410. pdr: Remove pldm_entity_association_pdr_add_from_node() 31511. pdr: Make find_entity_ref_in_tree() static 31612. pdr: Make entity_association_tree_find() static 317 318### Fixed 319 3201. requester: Fix response buffer cast in pldm_send_recv() 3212. pdr: Hoist record handle overflow test to avoid memory leak 3223. transport: Correct comparison in while loop condition 323 324## [0.4.0] - 2023-07-14 325 326### Added 327 3281. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 3292. fru: Introduce get_fru_record_by_option_check() 3303. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 3314. pdr: Introduce pldm_pdr_add_check() 3325. pdr: Introduce pldm_pdr_add_fru_record_set_check() 333 334### Changed 335 3361. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 3372. requester: Expose pldm_close() in header 3383. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 3394. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 3405. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 3416. pdr: pldm_pdr_init(): Return NULL on allocation failure 3427. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 3438. pdr: Document preconditions for trivial accessor functions 344 345 A trivial accessor function is one that exposes properties of an object in a 346 way can't result in an error, beyond passing an invalid argument to the 347 function. For APIs meeting this definition we define a precondition that 348 struct pointers must point to valid objects to avoid polluting the function 349 prototypes. The following APIs now have this precondition explicitly defined: 350 351 - pldm_entity_extract() 352 - pldm_entity_get_parent() 353 - pldm_entity_is_exist_parent() 354 - pldm_entity_is_node_parent() 355 - pldm_is_current_parent_child 356 - pldm_is_empty_entity_assoc_tree() 357 - pldm_pdr_get_record_count() 358 - pldm_pdr_get_record_handle() 359 - pldm_pdr_get_repo_size() 360 - pldm_pdr_record_is_remote() 361 3629. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 36310. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 36411. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 36512. pdr: pldm_entity_association_tree_visit(): Document preconditions 36613. pdr: pldm_entity_association_tree_visit(): Exit early on failure 36714. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 36815. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 36916. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 37017. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 37118. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 37219. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 37320. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 37421. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 37522. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 37623. pdr: pldm_entity_get_num_children(): Don't return invalid values 37724. libpldm: Lift or remove asserts where a subsequent check exists 378 379### Deprecated 380 3811. pldm_bios_table_attr_entry_integer_encode() 382 383 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 384 3852. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 386 387 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 388 3893. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 390 391 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 392 3934. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 394 395 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 396 3975. pdr: Deprecate is_present() 398 399 There should be no users of this symbol. If you are a user, you should figure 400 out how to stop, or get in touch. This symbol will be marked static the 401 release after deprecation. 402 4036. pdr: Deprecate find_entity_ref_in_tree() 404 405 There should be no users of this symbol. If you are a user, you should figure 406 out how to stop, or get in touch. This symbol will be marked static the 407 release after deprecation. 408 4097. pdr: Deprecate entity_association_tree_find() 410 411 There should be no users of this symbol. If you are a user, you should figure 412 out how to stop, or get in touch. This symbol will be marked static the 413 release after deprecation. 414 4158. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 416 417 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 418 pldm_bios_table_append_pad_checksum() should migrate to 419 pldm_bios_table_append_pad_checksum_check() 420 4219. fru: Stabilise get_fru_record_by_option_check() 422 423 get_fru_record_by_option() is deprecated by this change. Users of 424 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 425 42610. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 427 428 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 429 Users of pldm_entity_association_pdr_add_from_node() should migrate to 430 pldm_entity_association_pdr_add_from_node_check() 431 43211. pdr: Stabilise pldm_pdr_add_check() 433 434 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 435 migrate to pldm_pdr_add_check() 436 43712. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 438 439 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 440 pldm_pdr_add_fru_record_set() should migrate to 441 pldm_pdr_add_fru_record_set_check() 442 443### Removed 444 4451. bios_table: Remove deprecated APIs sanitized by assert(): 446 447 - pldm_bios_table_string_entry_encode() 448 - pldm_bios_table_string_entry_decode_string() 449 - pldm_bios_table_attr_entry_enum_encode() 450 - pldm_bios_table_attr_entry_enum_decode_pv_num() 451 - pldm_bios_table_attr_entry_enum_decode_def_num() 452 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 453 - pldm_bios_table_attr_entry_string_encode() 454 - pldm_bios_table_attr_entry_string_decode_def_string_length() 455 456### Fixed 457 4581. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 4592. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 4603. transport: mctp-demux: Don't test socket for non-zero value 4614. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4625. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4636. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4647. abi: Update to remove pldm_close() from reference dumps 4658. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 466 467## [0.3.0] - 2023-06-23 468 469### Added 470 4711. Add encode/decode pldmMessagePollEvent data 4722. README: Add a section on working with libpldm 4733. pdr: Introduce remote_container_id and associated APIs 4744. pdr: Add APIs for creating and locating remote PDRs 4755. pdr: Add pldm_pdr_find_last_in_range() 4766. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4777. pdr: Add pldm_pdr_find_container_id_range_exclude() 478 479### Changed 480 4811. include: Move installed transport.h under libpldm/ 4822. libpldm: Explicit deprecated, stable and testing ABI classes 4833. meson: Reduce strength of oem-ibm requirements from enabled to allowed 484 485 The `oem-ibm` feature is now enabled by the default meson configuration, for 486 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 487 recipe: 488 489 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 490 491 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 492 when invoking `meson setup` 493 4944. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4955. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 496 497### Deprecated 498 4991. bios_table: Deprecate APIs with arguments sanitized using assert() 500 501 C provides enough foot-guns without us encoding them into library APIs. 502 Specifically, deprecate the following in favour of their `*_check()` variants 503 which ensure assertions won't fail or otherwise invoke UB: 504 505 - pldm_bios_table_string_entry_encode() 506 - pldm_bios_table_string_entry_decode_string() 507 - pldm_bios_table_attr_entry_enum_encode() 508 - pldm_bios_table_attr_entry_enum_decode_pv_num() 509 - pldm_bios_table_attr_entry_enum_decode_def_num() 510 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 511 - pldm_bios_table_attr_entry_string_encode() 512 - pldm_bios_table_attr_entry_string_decode_def_string_length() 513 514### Removed 515 5161. libpldm: Remove the requester-api option 517 518### Fixed 519 5201. requester: Make pldm_open() return existing fd 5212. transport: Prevent sticking in waiting for response 5223. transport: Match on response in pldm_transport_send_recv_msg() 5234. requester: Add check before accessing hdr in pldm_recv() 5245. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 525