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### Added 21 221. oem: meta: Add decode_oem_meta_file_io_write_req() 232. oem: meta: Add decode_oem_meta_file_io_read_req() 243. oem: meta: Add encode_oem_meta_file_io_read_resp() 254. pdr: Add pldm_entity_association_pdr_remove_contained_entity() 265. pdr: Add pldm_pdr_remove_fru_record_set_by_rsi() 27 28### Changed 29 301. dsp: bios_table: Null check for pldm_bios_table_iter_is_end() 31 32 pldm_bios_table_iter_is_end() now returns true if the provided argument is 33 NULL. 34 352. ABI break for pldm_pdr_find_record() 36 37 Register assignment for function parameters was changed with the removal of 38 some asserts in related implementations. 39 403. ABI break for pldm_pdr_get_next_record() 41 42 Register assignment for function parameters was changed with the removal of 43 some asserts in related implementations. 44 45### Deprecated 46 471. oem: meta: Deprecate `decode_oem_meta_file_io_req()` 48 49 Users should switch to `decode_oem_meta_file_io_write_req()`. Modify this 50 function to make it safer. 51 52 Modification: 53 54 - The meaning of the returned result. 55 - Change parameters from individual pointers to a struct. 56 - Check the length provided in the message won't exceed the buffer. 57 58### Removed 59 601. Deprecated functions with the `_check` suffix 61 62 - `get_fru_record_by_option_check()` 63 - `pldm_bios_table_append_pad_checksum_check()` 64 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 65 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 66 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 67 - `pldm_bios_table_attr_entry_enum_encode_check()` 68 - `pldm_bios_table_attr_entry_integer_encode_check()` 69 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 70 - `pldm_bios_table_attr_entry_string_encode_check()` 71 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 72 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 73 - `pldm_bios_table_attr_value_entry_encode_string_check()` 74 - `pldm_bios_table_string_entry_decode_string_check()` 75 - `pldm_bios_table_string_entry_encode_check()` 76 - `pldm_entity_association_pdr_add_check()` 77 - `pldm_entity_association_pdr_add_from_node_check()` 78 - `pldm_pdr_add_check()` 79 - `pldm_pdr_add_fru_record_set_check()` 80 81### Fixed 82 831. dsp: bios_table: Null check for pldm_bios_table_iter_is_end() 84 85 Avoid a caller-controlled NULL pointer dereference in the library 86 implementation. 87 88## [0.9.1] - 2024-09-07 89 90### Changed 91 921. Moved evolutions intended for v0.9.0 into place 93 94 Evolutions for the release have been moved from `evolutions/current` to 95 `evolutions/v0.9.1`. Library users can apply them to migrate off of 96 deprecated APIs. 97 98## [0.9.0] - 2024-09-07 99 100### Added 101 1021. base: Define macros for reserved TIDs 1032. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 1043. pdr: Add pldm_entity_association_pdr_create_new() 1054. platform: Define macros for the responded transferflags 1065. pdr: Add pldm_pdr_get_terminus_handle() API 1076. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 1087. fw_update: Add encode req & decode resp for get_downstream_fw_params 1098. platform: Add decode_pldm_platform_cper_event() API 1109. decode_get_pdr_repository_info_resp_safe() 111 112 Replaces decode_get_pdr_repository_info_resp() as discussed in the 113 `Deprecated` section below 114 11510. decode_get_pdr_resp_safe() 116 117 Replaces decode_get_pdr_resp() as discussed in the `Deprecated` section 118 below 119 120### Changed 121 1221. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 1232. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 1243. platform: Stabilise decode_pldm_message_poll_event_data() APIs 1254. ABI break for decode_sensor_op_data() 126 127 Applying LIBPLDM_CC_NONNULL to the internal msgbuf APIs caused 128 abi-compliance-checker to flag a change in the register containing the 129 parameter `previous_op_state`. 130 1315. platform: Stabilise decode_pldm_platform_cper_event() API 132 133### Deprecated 134 1351. Rename and deprecate functions with the `_check` suffix 136 137 All library function return values always need to be checked. The `_check` 138 suffix is redundant, so remove it. Migration to the non-deprecated 139 equivalents without the `_check` suffix can be performed using 140 `scripts/ apply-renames` and the [clang-rename][] configurations under 141 `evolutions/` 142 143 The deprecated functions: 144 145 - `get_fru_record_by_option_check()` 146 - `pldm_bios_table_append_pad_checksum_check()` 147 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 148 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 149 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 150 - `pldm_bios_table_attr_entry_enum_encode_check()` 151 - `pldm_bios_table_attr_entry_integer_encode_check()` 152 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 153 - `pldm_bios_table_attr_entry_string_encode_check()` 154 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 155 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 156 - `pldm_bios_table_attr_value_entry_encode_string_check()` 157 - `pldm_bios_table_string_entry_decode_string_check()` 158 - `pldm_bios_table_string_entry_encode_check()` 159 - `pldm_entity_association_pdr_add_check()` 160 - `pldm_entity_association_pdr_add_from_node_check()` 161 - `pldm_pdr_add_check()` 162 - `pldm_pdr_add_fru_record_set_check()` 163 164[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 165 1662. `decode_get_pdr_repository_info_resp()` 167 168 Users should move to `decode_get_pdr_repository_info_resp_safe()` which 169 eliminates the opportunity for buffer overruns when extracting objects from 170 the message. 171 1723. `decode_get_pdr_resp()` 173 174 Users should move to `decode_get_pdr_resp_safe()` which reduces the 175 invocation tedium and improves memory safety over `decode_get_pdr_resp()`. 176 177### Removed 178 1791. IBM OEM header compatibility symlinks. 180 181 Anyone left using the deprecated paths can migrate using the coccinelle patch 182 at `evolutions/current/oem-ibm-header-compat.cocci`. 183 184### Fixed 185 1861. requester: instance-id: Release read lock on conflict 187 188## [0.8.0] - 2024-05-23 189 190### Added 191 1921. base: Provide pldm_msg_hdr_correlate_response() 1932. transport: af-mctp: Add pldm_transport_af_mctp_bind() 1943. oem: ibm: Add chapdata file type support 1954. base: Added PLDM_SMBIOS & PLDM_RDE message types 1965. oem: meta: Add decode_oem_meta_file_io_req() 1976. state-set: Add all state set values to system power state enum as per DSP0249 1987. platform: Add alias members to the enum 199 pldm_pdr_repository_chg_event_change_record_event_data_operation. 200 201 enum constants with inconsistent names are deprecated with this change. 202 remove old inconsistent enum members after backward compatibility cleanup is 203 done 204 2058. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 2069. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 20710. platform: Add 3 PDR type enum for Redfish Device Enablement per 208 DSP0248_1.2.0 20911. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 21012. entity: Add enum for Network Interface Connectors and Network Ports 211 Connection Types 21213. pdr: Add decode_numeric_effecter_pdr_data() 21314. oem: ibm: Support for the Real SAI entity id 21415. fw_update: Add encode req & decode resp for query_downstream_devices 21516. fw_update: Add encode req & decode resp for query_downstream_identifiers 21617. platform: Add support for GetStateEffecterStates command 217 218### Changed 219 2201. base: Stabilise pldm_msg_hdr_correlate_response() 2212. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 2223. libpldm: Fix header use 2234. libpldm: More fixes for header use 2245. pdr: Stabilise pldm_pdr_find_last_in_range() API 2256. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 2267. oem: meta: stabilise decode_oem_meta_file_io_req() 2278. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 228 229### Deprecated 230 2311. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 232 with `PLDM_OEM_IBM_` 233 234### Fixed 235 2361. libpldm: Rationalise the local and installed path of pldm.h 2372. pdr: Assign record_handle in entity_association_pdr_add_children() 2383. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 2394. pdr: Remove redundant constant for minimum numeric sensor PDR length 2405. tests: oem: meta: Fix fileio use of msgbuf 241 242## [0.7.0] - 2023-08-29 243 244### Added 245 2461. state-set: Add new enum for Operational Fault Status enum 247 248### Changed 249 2501. transport: Match specified metadata in pldm_transport_send_recv_msg() 2512. transport: mctp-demux: Drop ABI annotation for internal symbols 2523. transport: Stabilise core transport and implementation APIs 253 254 This stabilisation covers the following headers and functions: 255 256 - libpldm/transport.h 257 258 - pldm_transport_poll() 259 - pldm_transport_send_msg() 260 - pldm_transport_recv_msg() 261 - pldm_transport_send_recv_msg() 262 263 - libpldm/transport/af-mctp.h 264 265 - pldm_transport_af_mctp_init() 266 - pldm_transport_af_mctp_destroy() 267 - pldm_transport_af_mctp_core() 268 - pldm_transport_af_mctp_init_pollfd() 269 - pldm_transport_af_mctp_map_tid() 270 - pldm_transport_af_mctp_unmap_tid() 271 272 - libpldm/transport/mctp-demux.h 273 - pldm_transport_mctp_demux_init() 274 - pldm_transport_mctp_demux_destroy() 275 - pldm_transport_mctp_demux_core() 276 - pldm_transport_mctp_demux_init_pollfd() 277 - pldm_transport_mctp_demux_map_tid() 278 - pldm_transport_mctp_demux_unmap_tid() 279 280### Deprecated 281 2821. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 283 `libpldm/requester/pldm.h`): 284 285 - pldm_open() 286 - pldm_send_recv() 287 - pldm_send() 288 - pldm_recv() 289 - pldm_recv_any() 290 - pldm_close() 291 292 Users should migrate to the newer "transport" APIs instead. 293 294## Fixed 295 2961. tests: Exclude transport tests when build excludes testing ABIs 2972. abi: Capture deprecation of pldm_close() 298 299## [0.6.0] - 2023-08-22 300 301### Changed 302 3031. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 3042. meson: Apply `b_ndebug=if-release` by default 3053. pdr : Stabilize pldm_entity_association_tree_add_entity() 3064. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 3075. pdr: Stabilize pldm_entity_node_get_remote_container_id() 3086. transport: af-mctp: Assign out-params on success in \*\_recv() 3097. transport: Generalise the pldm_transport_recv_msg() API 310 311### Removed 312 3131. pdr: Remove pldm_entity_association_pdr_add() 3142. state-set: Remove enum pldm_state_set_operational_fault_status_values 315 316### Fixed 317 3181. transport: register init_pollfd callback for af-mctp 3192. transport: fix init_pollfd function parameter 3203. transport: Fix doxygen and variables for send and recv functions 3214. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 322 323## [0.5.0] - 2023-08-09 324 325### Added 326 3271. pdr: Introduce pldm_entity_association_pdr_add_check() 328 329### Changed 330 3311. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 3322. transport: pldm_transport_poll(): Adjust return value semantics 3333. transport: free un-wanted responses in pldm_transport_send_recv_msg() 334 335### Deprecated 336 3371. state-set: Enum pldm_state_set_operational_fault_status_values 338 339 The enum operational_fault_status is defined with wrong members and will 340 eventually be replaced with the correct members. Any uses of 341 pldm_state_set_operational_fault_status_values members should move to 342 equivalent pldm_state_set_operational_stress_status_values members if needed. 343 3442. platform: Struct field name in fru_record_set PDR 345 346 References to entity_instance_num should be changed to entity_instance 347 3483. platform: Struct field name in numeric sensor value PDR 349 350 References to entity_instance_num should be changed to entity_instance 351 352### Removed 353 3541. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 3552. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 3563. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 3574. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 3585. bios_table: Remove pldm_bios_table_append_pad_checksum() 3596. fru: Remove get_fru_record_by_option() 3607. pdr: Make is_present() static 3618. pdr: Remove pldm_pdr_add() 3629. pdr: Remove pldm_pdr_add_fru_record_set() 36310. pdr: Remove pldm_entity_association_pdr_add_from_node() 36411. pdr: Make find_entity_ref_in_tree() static 36512. pdr: Make entity_association_tree_find() static 366 367### Fixed 368 3691. requester: Fix response buffer cast in pldm_send_recv() 3702. pdr: Hoist record handle overflow test to avoid memory leak 3713. transport: Correct comparison in while loop condition 372 373## [0.4.0] - 2023-07-14 374 375### Added 376 3771. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 3782. fru: Introduce get_fru_record_by_option_check() 3793. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 3804. pdr: Introduce pldm_pdr_add_check() 3815. pdr: Introduce pldm_pdr_add_fru_record_set_check() 382 383### Changed 384 3851. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 3862. requester: Expose pldm_close() in header 3873. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 3884. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 3895. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 3906. pdr: pldm_pdr_init(): Return NULL on allocation failure 3917. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 3928. pdr: Document preconditions for trivial accessor functions 393 394 A trivial accessor function is one that exposes properties of an object in a 395 way can't result in an error, beyond passing an invalid argument to the 396 function. For APIs meeting this definition we define a precondition that 397 struct pointers must point to valid objects to avoid polluting the function 398 prototypes. The following APIs now have this precondition explicitly defined: 399 400 - pldm_entity_extract() 401 - pldm_entity_get_parent() 402 - pldm_entity_is_exist_parent() 403 - pldm_entity_is_node_parent() 404 - pldm_is_current_parent_child 405 - pldm_is_empty_entity_assoc_tree() 406 - pldm_pdr_get_record_count() 407 - pldm_pdr_get_record_handle() 408 - pldm_pdr_get_repo_size() 409 - pldm_pdr_record_is_remote() 410 4119. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 41210. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 41311. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 41412. pdr: pldm_entity_association_tree_visit(): Document preconditions 41513. pdr: pldm_entity_association_tree_visit(): Exit early on failure 41614. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 41715. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 41816. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 41917. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 42018. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 42119. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 42220. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 42321. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 42422. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 42523. pdr: pldm_entity_get_num_children(): Don't return invalid values 42624. libpldm: Lift or remove asserts where a subsequent check exists 427 428### Deprecated 429 4301. pldm_bios_table_attr_entry_integer_encode() 431 432 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 433 4342. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 435 436 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 437 4383. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 439 440 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 441 4424. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 443 444 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 445 4465. pdr: Deprecate is_present() 447 448 There should be no users of this symbol. If you are a user, you should figure 449 out how to stop, or get in touch. This symbol will be marked static the 450 release after deprecation. 451 4526. pdr: Deprecate find_entity_ref_in_tree() 453 454 There should be no users of this symbol. If you are a user, you should figure 455 out how to stop, or get in touch. This symbol will be marked static the 456 release after deprecation. 457 4587. pdr: Deprecate entity_association_tree_find() 459 460 There should be no users of this symbol. If you are a user, you should figure 461 out how to stop, or get in touch. This symbol will be marked static the 462 release after deprecation. 463 4648. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 465 466 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 467 pldm_bios_table_append_pad_checksum() should migrate to 468 pldm_bios_table_append_pad_checksum_check() 469 4709. fru: Stabilise get_fru_record_by_option_check() 471 472 get_fru_record_by_option() is deprecated by this change. Users of 473 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 474 47510. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 476 477 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 478 Users of pldm_entity_association_pdr_add_from_node() should migrate to 479 pldm_entity_association_pdr_add_from_node_check() 480 48111. pdr: Stabilise pldm_pdr_add_check() 482 483 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 484 migrate to pldm_pdr_add_check() 485 48612. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 487 488 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 489 pldm_pdr_add_fru_record_set() should migrate to 490 pldm_pdr_add_fru_record_set_check() 491 492### Removed 493 4941. bios_table: Remove deprecated APIs sanitized by assert(): 495 496 - pldm_bios_table_string_entry_encode() 497 - pldm_bios_table_string_entry_decode_string() 498 - pldm_bios_table_attr_entry_enum_encode() 499 - pldm_bios_table_attr_entry_enum_decode_pv_num() 500 - pldm_bios_table_attr_entry_enum_decode_def_num() 501 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 502 - pldm_bios_table_attr_entry_string_encode() 503 - pldm_bios_table_attr_entry_string_decode_def_string_length() 504 505### Fixed 506 5071. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 5082. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 5093. transport: mctp-demux: Don't test socket for non-zero value 5104. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 5115. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 5126. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 5137. abi: Update to remove pldm_close() from reference dumps 5148. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 515 516## [0.3.0] - 2023-06-23 517 518### Added 519 5201. Add encode/decode pldmMessagePollEvent data 5212. README: Add a section on working with libpldm 5223. pdr: Introduce remote_container_id and associated APIs 5234. pdr: Add APIs for creating and locating remote PDRs 5245. pdr: Add pldm_pdr_find_last_in_range() 5256. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 5267. pdr: Add pldm_pdr_find_container_id_range_exclude() 527 528### Changed 529 5301. include: Move installed transport.h under libpldm/ 5312. libpldm: Explicit deprecated, stable and testing ABI classes 5323. meson: Reduce strength of oem-ibm requirements from enabled to allowed 533 534 The `oem-ibm` feature is now enabled by the default meson configuration, for 535 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 536 recipe: 537 538 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 539 540 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 541 when invoking `meson setup` 542 5434. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 5445. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 545 546### Deprecated 547 5481. bios_table: Deprecate APIs with arguments sanitized using assert() 549 550 C provides enough foot-guns without us encoding them into library APIs. 551 Specifically, deprecate the following in favour of their `*_check()` variants 552 which ensure assertions won't fail or otherwise invoke UB: 553 554 - pldm_bios_table_string_entry_encode() 555 - pldm_bios_table_string_entry_decode_string() 556 - pldm_bios_table_attr_entry_enum_encode() 557 - pldm_bios_table_attr_entry_enum_decode_pv_num() 558 - pldm_bios_table_attr_entry_enum_decode_def_num() 559 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 560 - pldm_bios_table_attr_entry_string_encode() 561 - pldm_bios_table_attr_entry_string_decode_def_string_length() 562 563### Removed 564 5651. libpldm: Remove the requester-api option 566 567### Fixed 568 5691. requester: Make pldm_open() return existing fd 5702. transport: Prevent sticking in waiting for response 5713. transport: Match on response in pldm_transport_send_recv_msg() 5724. requester: Add check before accessing hdr in pldm_recv() 5735. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 574