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 32## [0.9.1] - 2024-09-07 33 34### Changed 35 361. Moved evolutions intended for v0.9.0 into place 37 38 Evolutions for the release have been moved from `evolutions/current` to 39 `evolutions/v0.9.1`. Library users can apply them to migrate off of 40 deprecated APIs. 41 42## [0.9.0] - 2024-09-07 43 44### Added 45 461. base: Define macros for reserved TIDs 472. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 483. pdr: Add pldm_entity_association_pdr_create_new() 494. platform: Define macros for the responded transferflags 505. pdr: Add pldm_pdr_get_terminus_handle() API 516. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 527. fw_update: Add encode req & decode resp for get_downstream_fw_params 538. platform: Add decode_pldm_platform_cper_event() API 549. decode_get_pdr_repository_info_resp_safe() 55 56 Replaces decode_get_pdr_repository_info_resp() as discussed in the 57 `Deprecated` section below 58 5910. decode_get_pdr_resp_safe() 60 61 Replaces decode_get_pdr_resp() as discussed in the `Deprecated` section 62 below 63 64### Changed 65 661. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 672. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 683. platform: Stabilise decode_pldm_message_poll_event_data() APIs 694. ABI break for decode_sensor_op_data() 70 71 Applying LIBPLDM_CC_NONNULL to the internal msgbuf APIs caused 72 abi-compliance-checker to flag a change in the register containing the 73 parameter `previous_op_state`. 74 755. platform: Stabilise decode_pldm_platform_cper_event() API 76 77### Deprecated 78 791. Rename and deprecate functions with the `_check` suffix 80 81 All library function return values always need to be checked. The `_check` 82 suffix is redundant, so remove it. Migration to the non-deprecated 83 equivalents without the `_check` suffix can be performed using 84 `scripts/ apply-renames` and the [clang-rename][] configurations under 85 `evolutions/` 86 87 The deprecated functions: 88 89 - `get_fru_record_by_option_check()` 90 - `pldm_bios_table_append_pad_checksum_check()` 91 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 92 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 93 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 94 - `pldm_bios_table_attr_entry_enum_encode_check()` 95 - `pldm_bios_table_attr_entry_integer_encode_check()` 96 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 97 - `pldm_bios_table_attr_entry_string_encode_check()` 98 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 99 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 100 - `pldm_bios_table_attr_value_entry_encode_string_check()` 101 - `pldm_bios_table_string_entry_decode_string_check()` 102 - `pldm_bios_table_string_entry_encode_check()` 103 - `pldm_entity_association_pdr_add_check()` 104 - `pldm_entity_association_pdr_add_from_node_check()` 105 - `pldm_pdr_add_check()` 106 - `pldm_pdr_add_fru_record_set_check()` 107 108[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 109 1102. `decode_get_pdr_repository_info_resp()` 111 112 Users should move to `decode_get_pdr_repository_info_resp_safe()` which 113 eliminates the opportunity for buffer overruns when extracting objects from 114 the message. 115 1163. `decode_get_pdr_resp()` 117 118 Users should move to `decode_get_pdr_resp_safe()` which reduces the 119 invocation tedium and improves memory safety over `decode_get_pdr_resp()`. 120 121### Removed 122 1231. IBM OEM header compatibility symlinks. 124 125 Anyone left using the deprecated paths can migrate using the coccinelle patch 126 at `evolutions/current/oem-ibm-header-compat.cocci`. 127 128### Fixed 129 1301. requester: instance-id: Release read lock on conflict 131 132## [0.8.0] - 2024-05-23 133 134### Added 135 1361. base: Provide pldm_msg_hdr_correlate_response() 1372. transport: af-mctp: Add pldm_transport_af_mctp_bind() 1383. oem: ibm: Add chapdata file type support 1394. base: Added PLDM_SMBIOS & PLDM_RDE message types 1405. oem: meta: Add decode_oem_meta_file_io_req() 1416. state-set: Add all state set values to system power state enum as per DSP0249 1427. platform: Add alias members to the enum 143 pldm_pdr_repository_chg_event_change_record_event_data_operation. 144 145 enum constants with inconsistent names are deprecated with this change. 146 remove old inconsistent enum members after backward compatibility cleanup is 147 done 148 1498. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 1509. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 15110. platform: Add 3 PDR type enum for Redfish Device Enablement per 152 DSP0248_1.2.0 15311. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 15412. entity: Add enum for Network Interface Connectors and Network Ports 155 Connection Types 15613. pdr: Add decode_numeric_effecter_pdr_data() 15714. oem: ibm: Support for the Real SAI entity id 15815. fw_update: Add encode req & decode resp for query_downstream_devices 15916. fw_update: Add encode req & decode resp for query_downstream_identifiers 16017. platform: Add support for GetStateEffecterStates command 161 162### Changed 163 1641. base: Stabilise pldm_msg_hdr_correlate_response() 1652. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1663. libpldm: Fix header use 1674. libpldm: More fixes for header use 1685. pdr: Stabilise pldm_pdr_find_last_in_range() API 1696. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1707. oem: meta: stabilise decode_oem_meta_file_io_req() 1718. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 172 173### Deprecated 174 1751. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 176 with `PLDM_OEM_IBM_` 177 178### Fixed 179 1801. libpldm: Rationalise the local and installed path of pldm.h 1812. pdr: Assign record_handle in entity_association_pdr_add_children() 1823. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1834. pdr: Remove redundant constant for minimum numeric sensor PDR length 1845. tests: oem: meta: Fix fileio use of msgbuf 185 186## [0.7.0] - 2023-08-29 187 188### Added 189 1901. state-set: Add new enum for Operational Fault Status enum 191 192### Changed 193 1941. transport: Match specified metadata in pldm_transport_send_recv_msg() 1952. transport: mctp-demux: Drop ABI annotation for internal symbols 1963. transport: Stabilise core transport and implementation APIs 197 198 This stabilisation covers the following headers and functions: 199 200 - libpldm/transport.h 201 202 - pldm_transport_poll() 203 - pldm_transport_send_msg() 204 - pldm_transport_recv_msg() 205 - pldm_transport_send_recv_msg() 206 207 - libpldm/transport/af-mctp.h 208 209 - pldm_transport_af_mctp_init() 210 - pldm_transport_af_mctp_destroy() 211 - pldm_transport_af_mctp_core() 212 - pldm_transport_af_mctp_init_pollfd() 213 - pldm_transport_af_mctp_map_tid() 214 - pldm_transport_af_mctp_unmap_tid() 215 216 - libpldm/transport/mctp-demux.h 217 - pldm_transport_mctp_demux_init() 218 - pldm_transport_mctp_demux_destroy() 219 - pldm_transport_mctp_demux_core() 220 - pldm_transport_mctp_demux_init_pollfd() 221 - pldm_transport_mctp_demux_map_tid() 222 - pldm_transport_mctp_demux_unmap_tid() 223 224### Deprecated 225 2261. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 227 `libpldm/requester/pldm.h`): 228 229 - pldm_open() 230 - pldm_send_recv() 231 - pldm_send() 232 - pldm_recv() 233 - pldm_recv_any() 234 - pldm_close() 235 236 Users should migrate to the newer "transport" APIs instead. 237 238## Fixed 239 2401. tests: Exclude transport tests when build excludes testing ABIs 2412. abi: Capture deprecation of pldm_close() 242 243## [0.6.0] - 2023-08-22 244 245### Changed 246 2471. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 2482. meson: Apply `b_ndebug=if-release` by default 2493. pdr : Stabilize pldm_entity_association_tree_add_entity() 2504. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 2515. pdr: Stabilize pldm_entity_node_get_remote_container_id() 2526. transport: af-mctp: Assign out-params on success in \*\_recv() 2537. transport: Generalise the pldm_transport_recv_msg() API 254 255### Removed 256 2571. pdr: Remove pldm_entity_association_pdr_add() 2582. state-set: Remove enum pldm_state_set_operational_fault_status_values 259 260### Fixed 261 2621. transport: register init_pollfd callback for af-mctp 2632. transport: fix init_pollfd function parameter 2643. transport: Fix doxygen and variables for send and recv functions 2654. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 266 267## [0.5.0] - 2023-08-09 268 269### Added 270 2711. pdr: Introduce pldm_entity_association_pdr_add_check() 272 273### Changed 274 2751. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2762. transport: pldm_transport_poll(): Adjust return value semantics 2773. transport: free un-wanted responses in pldm_transport_send_recv_msg() 278 279### Deprecated 280 2811. state-set: Enum pldm_state_set_operational_fault_status_values 282 283 The enum operational_fault_status is defined with wrong members and will 284 eventually be replaced with the correct members. Any uses of 285 pldm_state_set_operational_fault_status_values members should move to 286 equivalent pldm_state_set_operational_stress_status_values members if needed. 287 2882. platform: Struct field name in fru_record_set PDR 289 290 References to entity_instance_num should be changed to entity_instance 291 2923. platform: Struct field name in numeric sensor value PDR 293 294 References to entity_instance_num should be changed to entity_instance 295 296### Removed 297 2981. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 2992. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 3003. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 3014. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 3025. bios_table: Remove pldm_bios_table_append_pad_checksum() 3036. fru: Remove get_fru_record_by_option() 3047. pdr: Make is_present() static 3058. pdr: Remove pldm_pdr_add() 3069. pdr: Remove pldm_pdr_add_fru_record_set() 30710. pdr: Remove pldm_entity_association_pdr_add_from_node() 30811. pdr: Make find_entity_ref_in_tree() static 30912. pdr: Make entity_association_tree_find() static 310 311### Fixed 312 3131. requester: Fix response buffer cast in pldm_send_recv() 3142. pdr: Hoist record handle overflow test to avoid memory leak 3153. transport: Correct comparison in while loop condition 316 317## [0.4.0] - 2023-07-14 318 319### Added 320 3211. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 3222. fru: Introduce get_fru_record_by_option_check() 3233. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 3244. pdr: Introduce pldm_pdr_add_check() 3255. pdr: Introduce pldm_pdr_add_fru_record_set_check() 326 327### Changed 328 3291. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 3302. requester: Expose pldm_close() in header 3313. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 3324. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 3335. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 3346. pdr: pldm_pdr_init(): Return NULL on allocation failure 3357. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 3368. pdr: Document preconditions for trivial accessor functions 337 338 A trivial accessor function is one that exposes properties of an object in a 339 way can't result in an error, beyond passing an invalid argument to the 340 function. For APIs meeting this definition we define a precondition that 341 struct pointers must point to valid objects to avoid polluting the function 342 prototypes. The following APIs now have this precondition explicitly defined: 343 344 - pldm_entity_extract() 345 - pldm_entity_get_parent() 346 - pldm_entity_is_exist_parent() 347 - pldm_entity_is_node_parent() 348 - pldm_is_current_parent_child 349 - pldm_is_empty_entity_assoc_tree() 350 - pldm_pdr_get_record_count() 351 - pldm_pdr_get_record_handle() 352 - pldm_pdr_get_repo_size() 353 - pldm_pdr_record_is_remote() 354 3559. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 35610. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 35711. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 35812. pdr: pldm_entity_association_tree_visit(): Document preconditions 35913. pdr: pldm_entity_association_tree_visit(): Exit early on failure 36014. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 36115. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 36216. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 36317. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 36418. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 36519. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 36620. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 36721. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 36822. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 36923. pdr: pldm_entity_get_num_children(): Don't return invalid values 37024. libpldm: Lift or remove asserts where a subsequent check exists 371 372### Deprecated 373 3741. pldm_bios_table_attr_entry_integer_encode() 375 376 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 377 3782. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 379 380 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 381 3823. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 383 384 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 385 3864. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 387 388 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 389 3905. pdr: Deprecate is_present() 391 392 There should be no users of this symbol. If you are a user, you should figure 393 out how to stop, or get in touch. This symbol will be marked static the 394 release after deprecation. 395 3966. pdr: Deprecate find_entity_ref_in_tree() 397 398 There should be no users of this symbol. If you are a user, you should figure 399 out how to stop, or get in touch. This symbol will be marked static the 400 release after deprecation. 401 4027. pdr: Deprecate entity_association_tree_find() 403 404 There should be no users of this symbol. If you are a user, you should figure 405 out how to stop, or get in touch. This symbol will be marked static the 406 release after deprecation. 407 4088. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 409 410 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 411 pldm_bios_table_append_pad_checksum() should migrate to 412 pldm_bios_table_append_pad_checksum_check() 413 4149. fru: Stabilise get_fru_record_by_option_check() 415 416 get_fru_record_by_option() is deprecated by this change. Users of 417 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 418 41910. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 420 421 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 422 Users of pldm_entity_association_pdr_add_from_node() should migrate to 423 pldm_entity_association_pdr_add_from_node_check() 424 42511. pdr: Stabilise pldm_pdr_add_check() 426 427 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 428 migrate to pldm_pdr_add_check() 429 43012. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 431 432 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 433 pldm_pdr_add_fru_record_set() should migrate to 434 pldm_pdr_add_fru_record_set_check() 435 436### Removed 437 4381. bios_table: Remove deprecated APIs sanitized by assert(): 439 440 - pldm_bios_table_string_entry_encode() 441 - pldm_bios_table_string_entry_decode_string() 442 - pldm_bios_table_attr_entry_enum_encode() 443 - pldm_bios_table_attr_entry_enum_decode_pv_num() 444 - pldm_bios_table_attr_entry_enum_decode_def_num() 445 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 446 - pldm_bios_table_attr_entry_string_encode() 447 - pldm_bios_table_attr_entry_string_decode_def_string_length() 448 449### Fixed 450 4511. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 4522. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 4533. transport: mctp-demux: Don't test socket for non-zero value 4544. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4555. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4566. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4577. abi: Update to remove pldm_close() from reference dumps 4588. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 459 460## [0.3.0] - 2023-06-23 461 462### Added 463 4641. Add encode/decode pldmMessagePollEvent data 4652. README: Add a section on working with libpldm 4663. pdr: Introduce remote_container_id and associated APIs 4674. pdr: Add APIs for creating and locating remote PDRs 4685. pdr: Add pldm_pdr_find_last_in_range() 4696. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4707. pdr: Add pldm_pdr_find_container_id_range_exclude() 471 472### Changed 473 4741. include: Move installed transport.h under libpldm/ 4752. libpldm: Explicit deprecated, stable and testing ABI classes 4763. meson: Reduce strength of oem-ibm requirements from enabled to allowed 477 478 The `oem-ibm` feature is now enabled by the default meson configuration, for 479 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 480 recipe: 481 482 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 483 484 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 485 when invoking `meson setup` 486 4874. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4885. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 489 490### Deprecated 491 4921. bios_table: Deprecate APIs with arguments sanitized using assert() 493 494 C provides enough foot-guns without us encoding them into library APIs. 495 Specifically, deprecate the following in favour of their `*_check()` variants 496 which ensure assertions won't fail or otherwise invoke UB: 497 498 - pldm_bios_table_string_entry_encode() 499 - pldm_bios_table_string_entry_decode_string() 500 - pldm_bios_table_attr_entry_enum_encode() 501 - pldm_bios_table_attr_entry_enum_decode_pv_num() 502 - pldm_bios_table_attr_entry_enum_decode_def_num() 503 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 504 - pldm_bios_table_attr_entry_string_encode() 505 - pldm_bios_table_attr_entry_string_decode_def_string_length() 506 507### Removed 508 5091. libpldm: Remove the requester-api option 510 511### Fixed 512 5131. requester: Make pldm_open() return existing fd 5142. transport: Prevent sticking in waiting for response 5153. transport: Match on response in pldm_transport_send_recv_msg() 5164. requester: Add check before accessing hdr in pldm_recv() 5175. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 518