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 37## [0.9.1] - 2024-09-07 38 39### Changed 40 411. Moved evolutions intended for v0.9.0 into place 42 43 Evolutions for the release have been moved from `evolutions/current` to 44 `evolutions/v0.9.1`. Library users can apply them to migrate off of 45 deprecated APIs. 46 47## [0.9.0] - 2024-09-07 48 49### Added 50 511. base: Define macros for reserved TIDs 522. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 533. pdr: Add pldm_entity_association_pdr_create_new() 544. platform: Define macros for the responded transferflags 555. pdr: Add pldm_pdr_get_terminus_handle() API 566. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 577. fw_update: Add encode req & decode resp for get_downstream_fw_params 588. platform: Add decode_pldm_platform_cper_event() API 599. decode_get_pdr_repository_info_resp_safe() 60 61 Replaces decode_get_pdr_repository_info_resp() as discussed in the 62 `Deprecated` section below 63 6410. decode_get_pdr_resp_safe() 65 66 Replaces decode_get_pdr_resp() as discussed in the `Deprecated` section 67 below 68 69### Changed 70 711. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 722. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 733. platform: Stabilise decode_pldm_message_poll_event_data() APIs 744. ABI break for decode_sensor_op_data() 75 76 Applying LIBPLDM_CC_NONNULL to the internal msgbuf APIs caused 77 abi-compliance-checker to flag a change in the register containing the 78 parameter `previous_op_state`. 79 805. platform: Stabilise decode_pldm_platform_cper_event() API 81 82### Deprecated 83 841. Rename and deprecate functions with the `_check` suffix 85 86 All library function return values always need to be checked. The `_check` 87 suffix is redundant, so remove it. Migration to the non-deprecated 88 equivalents without the `_check` suffix can be performed using 89 `scripts/ apply-renames` and the [clang-rename][] configurations under 90 `evolutions/` 91 92 The deprecated functions: 93 94 - `get_fru_record_by_option_check()` 95 - `pldm_bios_table_append_pad_checksum_check()` 96 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 97 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 98 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 99 - `pldm_bios_table_attr_entry_enum_encode_check()` 100 - `pldm_bios_table_attr_entry_integer_encode_check()` 101 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 102 - `pldm_bios_table_attr_entry_string_encode_check()` 103 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 104 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 105 - `pldm_bios_table_attr_value_entry_encode_string_check()` 106 - `pldm_bios_table_string_entry_decode_string_check()` 107 - `pldm_bios_table_string_entry_encode_check()` 108 - `pldm_entity_association_pdr_add_check()` 109 - `pldm_entity_association_pdr_add_from_node_check()` 110 - `pldm_pdr_add_check()` 111 - `pldm_pdr_add_fru_record_set_check()` 112 113[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 114 1152. `decode_get_pdr_repository_info_resp()` 116 117 Users should move to `decode_get_pdr_repository_info_resp_safe()` which 118 eliminates the opportunity for buffer overruns when extracting objects from 119 the message. 120 1213. `decode_get_pdr_resp()` 122 123 Users should move to `decode_get_pdr_resp_safe()` which reduces the 124 invocation tedium and improves memory safety over `decode_get_pdr_resp()`. 125 126### Removed 127 1281. IBM OEM header compatibility symlinks. 129 130 Anyone left using the deprecated paths can migrate using the coccinelle patch 131 at `evolutions/current/oem-ibm-header-compat.cocci`. 132 133### Fixed 134 1351. requester: instance-id: Release read lock on conflict 136 137## [0.8.0] - 2024-05-23 138 139### Added 140 1411. base: Provide pldm_msg_hdr_correlate_response() 1422. transport: af-mctp: Add pldm_transport_af_mctp_bind() 1433. oem: ibm: Add chapdata file type support 1444. base: Added PLDM_SMBIOS & PLDM_RDE message types 1455. oem: meta: Add decode_oem_meta_file_io_req() 1466. state-set: Add all state set values to system power state enum as per DSP0249 1477. platform: Add alias members to the enum 148 pldm_pdr_repository_chg_event_change_record_event_data_operation. 149 150 enum constants with inconsistent names are deprecated with this change. 151 remove old inconsistent enum members after backward compatibility cleanup is 152 done 153 1548. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 1559. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 15610. platform: Add 3 PDR type enum for Redfish Device Enablement per 157 DSP0248_1.2.0 15811. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 15912. entity: Add enum for Network Interface Connectors and Network Ports 160 Connection Types 16113. pdr: Add decode_numeric_effecter_pdr_data() 16214. oem: ibm: Support for the Real SAI entity id 16315. fw_update: Add encode req & decode resp for query_downstream_devices 16416. fw_update: Add encode req & decode resp for query_downstream_identifiers 16517. platform: Add support for GetStateEffecterStates command 166 167### Changed 168 1691. base: Stabilise pldm_msg_hdr_correlate_response() 1702. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1713. libpldm: Fix header use 1724. libpldm: More fixes for header use 1735. pdr: Stabilise pldm_pdr_find_last_in_range() API 1746. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1757. oem: meta: stabilise decode_oem_meta_file_io_req() 1768. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 177 178### Deprecated 179 1801. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 181 with `PLDM_OEM_IBM_` 182 183### Fixed 184 1851. libpldm: Rationalise the local and installed path of pldm.h 1862. pdr: Assign record_handle in entity_association_pdr_add_children() 1873. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1884. pdr: Remove redundant constant for minimum numeric sensor PDR length 1895. tests: oem: meta: Fix fileio use of msgbuf 190 191## [0.7.0] - 2023-08-29 192 193### Added 194 1951. state-set: Add new enum for Operational Fault Status enum 196 197### Changed 198 1991. transport: Match specified metadata in pldm_transport_send_recv_msg() 2002. transport: mctp-demux: Drop ABI annotation for internal symbols 2013. transport: Stabilise core transport and implementation APIs 202 203 This stabilisation covers the following headers and functions: 204 205 - libpldm/transport.h 206 207 - pldm_transport_poll() 208 - pldm_transport_send_msg() 209 - pldm_transport_recv_msg() 210 - pldm_transport_send_recv_msg() 211 212 - libpldm/transport/af-mctp.h 213 214 - pldm_transport_af_mctp_init() 215 - pldm_transport_af_mctp_destroy() 216 - pldm_transport_af_mctp_core() 217 - pldm_transport_af_mctp_init_pollfd() 218 - pldm_transport_af_mctp_map_tid() 219 - pldm_transport_af_mctp_unmap_tid() 220 221 - libpldm/transport/mctp-demux.h 222 - pldm_transport_mctp_demux_init() 223 - pldm_transport_mctp_demux_destroy() 224 - pldm_transport_mctp_demux_core() 225 - pldm_transport_mctp_demux_init_pollfd() 226 - pldm_transport_mctp_demux_map_tid() 227 - pldm_transport_mctp_demux_unmap_tid() 228 229### Deprecated 230 2311. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 232 `libpldm/requester/pldm.h`): 233 234 - pldm_open() 235 - pldm_send_recv() 236 - pldm_send() 237 - pldm_recv() 238 - pldm_recv_any() 239 - pldm_close() 240 241 Users should migrate to the newer "transport" APIs instead. 242 243## Fixed 244 2451. tests: Exclude transport tests when build excludes testing ABIs 2462. abi: Capture deprecation of pldm_close() 247 248## [0.6.0] - 2023-08-22 249 250### Changed 251 2521. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 2532. meson: Apply `b_ndebug=if-release` by default 2543. pdr : Stabilize pldm_entity_association_tree_add_entity() 2554. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 2565. pdr: Stabilize pldm_entity_node_get_remote_container_id() 2576. transport: af-mctp: Assign out-params on success in \*\_recv() 2587. transport: Generalise the pldm_transport_recv_msg() API 259 260### Removed 261 2621. pdr: Remove pldm_entity_association_pdr_add() 2632. state-set: Remove enum pldm_state_set_operational_fault_status_values 264 265### Fixed 266 2671. transport: register init_pollfd callback for af-mctp 2682. transport: fix init_pollfd function parameter 2693. transport: Fix doxygen and variables for send and recv functions 2704. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 271 272## [0.5.0] - 2023-08-09 273 274### Added 275 2761. pdr: Introduce pldm_entity_association_pdr_add_check() 277 278### Changed 279 2801. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2812. transport: pldm_transport_poll(): Adjust return value semantics 2823. transport: free un-wanted responses in pldm_transport_send_recv_msg() 283 284### Deprecated 285 2861. state-set: Enum pldm_state_set_operational_fault_status_values 287 288 The enum operational_fault_status is defined with wrong members and will 289 eventually be replaced with the correct members. Any uses of 290 pldm_state_set_operational_fault_status_values members should move to 291 equivalent pldm_state_set_operational_stress_status_values members if needed. 292 2932. platform: Struct field name in fru_record_set PDR 294 295 References to entity_instance_num should be changed to entity_instance 296 2973. platform: Struct field name in numeric sensor value PDR 298 299 References to entity_instance_num should be changed to entity_instance 300 301### Removed 302 3031. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 3042. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 3053. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 3064. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 3075. bios_table: Remove pldm_bios_table_append_pad_checksum() 3086. fru: Remove get_fru_record_by_option() 3097. pdr: Make is_present() static 3108. pdr: Remove pldm_pdr_add() 3119. pdr: Remove pldm_pdr_add_fru_record_set() 31210. pdr: Remove pldm_entity_association_pdr_add_from_node() 31311. pdr: Make find_entity_ref_in_tree() static 31412. pdr: Make entity_association_tree_find() static 315 316### Fixed 317 3181. requester: Fix response buffer cast in pldm_send_recv() 3192. pdr: Hoist record handle overflow test to avoid memory leak 3203. transport: Correct comparison in while loop condition 321 322## [0.4.0] - 2023-07-14 323 324### Added 325 3261. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 3272. fru: Introduce get_fru_record_by_option_check() 3283. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 3294. pdr: Introduce pldm_pdr_add_check() 3305. pdr: Introduce pldm_pdr_add_fru_record_set_check() 331 332### Changed 333 3341. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 3352. requester: Expose pldm_close() in header 3363. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 3374. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 3385. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 3396. pdr: pldm_pdr_init(): Return NULL on allocation failure 3407. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 3418. pdr: Document preconditions for trivial accessor functions 342 343 A trivial accessor function is one that exposes properties of an object in a 344 way can't result in an error, beyond passing an invalid argument to the 345 function. For APIs meeting this definition we define a precondition that 346 struct pointers must point to valid objects to avoid polluting the function 347 prototypes. The following APIs now have this precondition explicitly defined: 348 349 - pldm_entity_extract() 350 - pldm_entity_get_parent() 351 - pldm_entity_is_exist_parent() 352 - pldm_entity_is_node_parent() 353 - pldm_is_current_parent_child 354 - pldm_is_empty_entity_assoc_tree() 355 - pldm_pdr_get_record_count() 356 - pldm_pdr_get_record_handle() 357 - pldm_pdr_get_repo_size() 358 - pldm_pdr_record_is_remote() 359 3609. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 36110. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 36211. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 36312. pdr: pldm_entity_association_tree_visit(): Document preconditions 36413. pdr: pldm_entity_association_tree_visit(): Exit early on failure 36514. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 36615. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 36716. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 36817. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 36918. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 37019. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 37120. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 37221. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 37322. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 37423. pdr: pldm_entity_get_num_children(): Don't return invalid values 37524. libpldm: Lift or remove asserts where a subsequent check exists 376 377### Deprecated 378 3791. pldm_bios_table_attr_entry_integer_encode() 380 381 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 382 3832. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 384 385 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 386 3873. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 388 389 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 390 3914. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 392 393 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 394 3955. pdr: Deprecate is_present() 396 397 There should be no users of this symbol. If you are a user, you should figure 398 out how to stop, or get in touch. This symbol will be marked static the 399 release after deprecation. 400 4016. pdr: Deprecate find_entity_ref_in_tree() 402 403 There should be no users of this symbol. If you are a user, you should figure 404 out how to stop, or get in touch. This symbol will be marked static the 405 release after deprecation. 406 4077. pdr: Deprecate entity_association_tree_find() 408 409 There should be no users of this symbol. If you are a user, you should figure 410 out how to stop, or get in touch. This symbol will be marked static the 411 release after deprecation. 412 4138. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 414 415 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 416 pldm_bios_table_append_pad_checksum() should migrate to 417 pldm_bios_table_append_pad_checksum_check() 418 4199. fru: Stabilise get_fru_record_by_option_check() 420 421 get_fru_record_by_option() is deprecated by this change. Users of 422 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 423 42410. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 425 426 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 427 Users of pldm_entity_association_pdr_add_from_node() should migrate to 428 pldm_entity_association_pdr_add_from_node_check() 429 43011. pdr: Stabilise pldm_pdr_add_check() 431 432 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 433 migrate to pldm_pdr_add_check() 434 43512. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 436 437 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 438 pldm_pdr_add_fru_record_set() should migrate to 439 pldm_pdr_add_fru_record_set_check() 440 441### Removed 442 4431. bios_table: Remove deprecated APIs sanitized by assert(): 444 445 - pldm_bios_table_string_entry_encode() 446 - pldm_bios_table_string_entry_decode_string() 447 - pldm_bios_table_attr_entry_enum_encode() 448 - pldm_bios_table_attr_entry_enum_decode_pv_num() 449 - pldm_bios_table_attr_entry_enum_decode_def_num() 450 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 451 - pldm_bios_table_attr_entry_string_encode() 452 - pldm_bios_table_attr_entry_string_decode_def_string_length() 453 454### Fixed 455 4561. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 4572. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 4583. transport: mctp-demux: Don't test socket for non-zero value 4594. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4605. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4616. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4627. abi: Update to remove pldm_close() from reference dumps 4638. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 464 465## [0.3.0] - 2023-06-23 466 467### Added 468 4691. Add encode/decode pldmMessagePollEvent data 4702. README: Add a section on working with libpldm 4713. pdr: Introduce remote_container_id and associated APIs 4724. pdr: Add APIs for creating and locating remote PDRs 4735. pdr: Add pldm_pdr_find_last_in_range() 4746. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4757. pdr: Add pldm_pdr_find_container_id_range_exclude() 476 477### Changed 478 4791. include: Move installed transport.h under libpldm/ 4802. libpldm: Explicit deprecated, stable and testing ABI classes 4813. meson: Reduce strength of oem-ibm requirements from enabled to allowed 482 483 The `oem-ibm` feature is now enabled by the default meson configuration, for 484 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 485 recipe: 486 487 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 488 489 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 490 when invoking `meson setup` 491 4924. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4935. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 494 495### Deprecated 496 4971. bios_table: Deprecate APIs with arguments sanitized using assert() 498 499 C provides enough foot-guns without us encoding them into library APIs. 500 Specifically, deprecate the following in favour of their `*_check()` variants 501 which ensure assertions won't fail or otherwise invoke UB: 502 503 - pldm_bios_table_string_entry_encode() 504 - pldm_bios_table_string_entry_decode_string() 505 - pldm_bios_table_attr_entry_enum_encode() 506 - pldm_bios_table_attr_entry_enum_decode_pv_num() 507 - pldm_bios_table_attr_entry_enum_decode_def_num() 508 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 509 - pldm_bios_table_attr_entry_string_encode() 510 - pldm_bios_table_attr_entry_string_decode_def_string_length() 511 512### Removed 513 5141. libpldm: Remove the requester-api option 515 516### Fixed 517 5181. requester: Make pldm_open() return existing fd 5192. transport: Prevent sticking in waiting for response 5203. transport: Match on response in pldm_transport_send_recv_msg() 5214. requester: Add check before accessing hdr in pldm_recv() 5225. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 523