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## [0.9.0] - 2024-09-07 21 22### Added 23 241. base: Define macros for reserved TIDs 252. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 263. pdr: Add pldm_entity_association_pdr_create_new() 274. platform: Define macros for the responded transferflags 285. pdr: Add pldm_pdr_get_terminus_handle() API 296. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 307. fw_update: Add encode req & decode resp for get_downstream_fw_params 318. platform: Add decode_pldm_platform_cper_event() API 329. decode_get_pdr_repository_info_resp_safe() 33 34 Replaces decode_get_pdr_repository_info_resp() as discussed in the 35 `Deprecated` section below 36 3710. decode_get_pdr_resp_safe() 38 39 Replaces decode_get_pdr_resp() as discussed in the `Deprecated` section 40 below 41 42### Changed 43 441. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 452. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 463. platform: Stabilise decode_pldm_message_poll_event_data() APIs 474. ABI break for decode_sensor_op_data() 48 49 Applying LIBPLDM_CC_NONNULL to the internal msgbuf APIs caused 50 abi-compliance-checker to flag a change in the register containing the 51 parameter `previous_op_state`. 52 535. platform: Stabilise decode_pldm_platform_cper_event() API 54 55### Deprecated 56 571. Rename and deprecate functions with the `_check` suffix 58 59 All library function return values always need to be checked. The `_check` 60 suffix is redundant, so remove it. Migration to the non-deprecated 61 equivalents without the `_check` suffix can be performed using 62 `scripts/ apply-renames` and the [clang-rename][] configurations under 63 `evolutions/` 64 65 The deprecated functions: 66 67 - `get_fru_record_by_option_check()` 68 - `pldm_bios_table_append_pad_checksum_check()` 69 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 70 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 71 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 72 - `pldm_bios_table_attr_entry_enum_encode_check()` 73 - `pldm_bios_table_attr_entry_integer_encode_check()` 74 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 75 - `pldm_bios_table_attr_entry_string_encode_check()` 76 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 77 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 78 - `pldm_bios_table_attr_value_entry_encode_string_check()` 79 - `pldm_bios_table_string_entry_decode_string_check()` 80 - `pldm_bios_table_string_entry_encode_check()` 81 - `pldm_entity_association_pdr_add_check()` 82 - `pldm_entity_association_pdr_add_from_node_check()` 83 - `pldm_pdr_add_check()` 84 - `pldm_pdr_add_fru_record_set_check()` 85 86[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 87 882. `decode_get_pdr_repository_info_resp()` 89 90 Users should move to `decode_get_pdr_repository_info_resp_safe()` which 91 eliminates the opportunity for buffer overruns when extracting objects from 92 the message. 93 943. `decode_get_pdr_resp()` 95 96 Users should move to `decode_get_pdr_resp_safe()` which reduces the 97 invocation tedium and improves memory safety over `decode_get_pdr_resp()`. 98 99### Removed 100 1011. IBM OEM header compatibility symlinks. 102 103 Anyone left using the deprecated paths can migrate using the coccinelle patch 104 at `evolutions/current/oem-ibm-header-compat.cocci`. 105 106### Fixed 107 1081. requester: instance-id: Release read lock on conflict 109 110## [0.8.0] - 2024-05-23 111 112### Added 113 1141. base: Provide pldm_msg_hdr_correlate_response() 1152. transport: af-mctp: Add pldm_transport_af_mctp_bind() 1163. oem: ibm: Add chapdata file type support 1174. base: Added PLDM_SMBIOS & PLDM_RDE message types 1185. oem: meta: Add decode_oem_meta_file_io_req() 1196. state-set: Add all state set values to system power state enum as per DSP0249 1207. platform: Add alias members to the enum 121 pldm_pdr_repository_chg_event_change_record_event_data_operation. 122 123 enum constants with inconsistent names are deprecated with this change. 124 remove old inconsistent enum members after backward compatibility cleanup is 125 done 126 1278. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 1289. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 12910. platform: Add 3 PDR type enum for Redfish Device Enablement per 130 DSP0248_1.2.0 13111. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 13212. entity: Add enum for Network Interface Connectors and Network Ports 133 Connection Types 13413. pdr: Add decode_numeric_effecter_pdr_data() 13514. oem: ibm: Support for the Real SAI entity id 13615. fw_update: Add encode req & decode resp for query_downstream_devices 13716. fw_update: Add encode req & decode resp for query_downstream_identifiers 13817. platform: Add support for GetStateEffecterStates command 139 140### Changed 141 1421. base: Stabilise pldm_msg_hdr_correlate_response() 1432. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1443. libpldm: Fix header use 1454. libpldm: More fixes for header use 1465. pdr: Stabilise pldm_pdr_find_last_in_range() API 1476. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1487. oem: meta: stabilise decode_oem_meta_file_io_req() 1498. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 150 151### Deprecated 152 1531. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 154 with `PLDM_OEM_IBM_` 155 156### Fixed 157 1581. libpldm: Rationalise the local and installed path of pldm.h 1592. pdr: Assign record_handle in entity_association_pdr_add_children() 1603. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1614. pdr: Remove redundant constant for minimum numeric sensor PDR length 1625. tests: oem: meta: Fix fileio use of msgbuf 163 164## [0.7.0] - 2023-08-29 165 166### Added 167 1681. state-set: Add new enum for Operational Fault Status enum 169 170### Changed 171 1721. transport: Match specified metadata in pldm_transport_send_recv_msg() 1732. transport: mctp-demux: Drop ABI annotation for internal symbols 1743. transport: Stabilise core transport and implementation APIs 175 176 This stabilisation covers the following headers and functions: 177 178 - libpldm/transport.h 179 180 - pldm_transport_poll() 181 - pldm_transport_send_msg() 182 - pldm_transport_recv_msg() 183 - pldm_transport_send_recv_msg() 184 185 - libpldm/transport/af-mctp.h 186 187 - pldm_transport_af_mctp_init() 188 - pldm_transport_af_mctp_destroy() 189 - pldm_transport_af_mctp_core() 190 - pldm_transport_af_mctp_init_pollfd() 191 - pldm_transport_af_mctp_map_tid() 192 - pldm_transport_af_mctp_unmap_tid() 193 194 - libpldm/transport/mctp-demux.h 195 - pldm_transport_mctp_demux_init() 196 - pldm_transport_mctp_demux_destroy() 197 - pldm_transport_mctp_demux_core() 198 - pldm_transport_mctp_demux_init_pollfd() 199 - pldm_transport_mctp_demux_map_tid() 200 - pldm_transport_mctp_demux_unmap_tid() 201 202### Deprecated 203 2041. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 205 `libpldm/requester/pldm.h`): 206 207 - pldm_open() 208 - pldm_send_recv() 209 - pldm_send() 210 - pldm_recv() 211 - pldm_recv_any() 212 - pldm_close() 213 214 Users should migrate to the newer "transport" APIs instead. 215 216## Fixed 217 2181. tests: Exclude transport tests when build excludes testing ABIs 2192. abi: Capture deprecation of pldm_close() 220 221## [0.6.0] - 2023-08-22 222 223### Changed 224 2251. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 2262. meson: Apply `b_ndebug=if-release` by default 2273. pdr : Stabilize pldm_entity_association_tree_add_entity() 2284. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 2295. pdr: Stabilize pldm_entity_node_get_remote_container_id() 2306. transport: af-mctp: Assign out-params on success in \*\_recv() 2317. transport: Generalise the pldm_transport_recv_msg() API 232 233### Removed 234 2351. pdr: Remove pldm_entity_association_pdr_add() 2362. state-set: Remove enum pldm_state_set_operational_fault_status_values 237 238### Fixed 239 2401. transport: register init_pollfd callback for af-mctp 2412. transport: fix init_pollfd function parameter 2423. transport: Fix doxygen and variables for send and recv functions 2434. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 244 245## [0.5.0] - 2023-08-09 246 247### Added 248 2491. pdr: Introduce pldm_entity_association_pdr_add_check() 250 251### Changed 252 2531. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2542. transport: pldm_transport_poll(): Adjust return value semantics 2553. transport: free un-wanted responses in pldm_transport_send_recv_msg() 256 257### Deprecated 258 2591. state-set: Enum pldm_state_set_operational_fault_status_values 260 261 The enum operational_fault_status is defined with wrong members and will 262 eventually be replaced with the correct members. Any uses of 263 pldm_state_set_operational_fault_status_values members should move to 264 equivalent pldm_state_set_operational_stress_status_values members if needed. 265 2662. platform: Struct field name in fru_record_set PDR 267 268 References to entity_instance_num should be changed to entity_instance 269 2703. platform: Struct field name in numeric sensor value PDR 271 272 References to entity_instance_num should be changed to entity_instance 273 274### Removed 275 2761. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 2772. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 2783. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 2794. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 2805. bios_table: Remove pldm_bios_table_append_pad_checksum() 2816. fru: Remove get_fru_record_by_option() 2827. pdr: Make is_present() static 2838. pdr: Remove pldm_pdr_add() 2849. pdr: Remove pldm_pdr_add_fru_record_set() 28510. pdr: Remove pldm_entity_association_pdr_add_from_node() 28611. pdr: Make find_entity_ref_in_tree() static 28712. pdr: Make entity_association_tree_find() static 288 289### Fixed 290 2911. requester: Fix response buffer cast in pldm_send_recv() 2922. pdr: Hoist record handle overflow test to avoid memory leak 2933. transport: Correct comparison in while loop condition 294 295## [0.4.0] - 2023-07-14 296 297### Added 298 2991. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 3002. fru: Introduce get_fru_record_by_option_check() 3013. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 3024. pdr: Introduce pldm_pdr_add_check() 3035. pdr: Introduce pldm_pdr_add_fru_record_set_check() 304 305### Changed 306 3071. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 3082. requester: Expose pldm_close() in header 3093. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 3104. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 3115. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 3126. pdr: pldm_pdr_init(): Return NULL on allocation failure 3137. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 3148. pdr: Document preconditions for trivial accessor functions 315 316 A trivial accessor function is one that exposes properties of an object in a 317 way can't result in an error, beyond passing an invalid argument to the 318 function. For APIs meeting this definition we define a precondition that 319 struct pointers must point to valid objects to avoid polluting the function 320 prototypes. The following APIs now have this precondition explicitly defined: 321 322 - pldm_entity_extract() 323 - pldm_entity_get_parent() 324 - pldm_entity_is_exist_parent() 325 - pldm_entity_is_node_parent() 326 - pldm_is_current_parent_child 327 - pldm_is_empty_entity_assoc_tree() 328 - pldm_pdr_get_record_count() 329 - pldm_pdr_get_record_handle() 330 - pldm_pdr_get_repo_size() 331 - pldm_pdr_record_is_remote() 332 3339. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 33410. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 33511. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 33612. pdr: pldm_entity_association_tree_visit(): Document preconditions 33713. pdr: pldm_entity_association_tree_visit(): Exit early on failure 33814. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 33915. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 34016. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 34117. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 34218. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 34319. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 34420. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 34521. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 34622. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 34723. pdr: pldm_entity_get_num_children(): Don't return invalid values 34824. libpldm: Lift or remove asserts where a subsequent check exists 349 350### Deprecated 351 3521. pldm_bios_table_attr_entry_integer_encode() 353 354 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 355 3562. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 357 358 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 359 3603. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 361 362 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 363 3644. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 365 366 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 367 3685. pdr: Deprecate is_present() 369 370 There should be no users of this symbol. If you are a user, you should figure 371 out how to stop, or get in touch. This symbol will be marked static the 372 release after deprecation. 373 3746. pdr: Deprecate find_entity_ref_in_tree() 375 376 There should be no users of this symbol. If you are a user, you should figure 377 out how to stop, or get in touch. This symbol will be marked static the 378 release after deprecation. 379 3807. pdr: Deprecate entity_association_tree_find() 381 382 There should be no users of this symbol. If you are a user, you should figure 383 out how to stop, or get in touch. This symbol will be marked static the 384 release after deprecation. 385 3868. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 387 388 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 389 pldm_bios_table_append_pad_checksum() should migrate to 390 pldm_bios_table_append_pad_checksum_check() 391 3929. fru: Stabilise get_fru_record_by_option_check() 393 394 get_fru_record_by_option() is deprecated by this change. Users of 395 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 396 39710. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 398 399 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 400 Users of pldm_entity_association_pdr_add_from_node() should migrate to 401 pldm_entity_association_pdr_add_from_node_check() 402 40311. pdr: Stabilise pldm_pdr_add_check() 404 405 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 406 migrate to pldm_pdr_add_check() 407 40812. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 409 410 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 411 pldm_pdr_add_fru_record_set() should migrate to 412 pldm_pdr_add_fru_record_set_check() 413 414### Removed 415 4161. bios_table: Remove deprecated APIs sanitized by assert(): 417 418 - pldm_bios_table_string_entry_encode() 419 - pldm_bios_table_string_entry_decode_string() 420 - pldm_bios_table_attr_entry_enum_encode() 421 - pldm_bios_table_attr_entry_enum_decode_pv_num() 422 - pldm_bios_table_attr_entry_enum_decode_def_num() 423 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 424 - pldm_bios_table_attr_entry_string_encode() 425 - pldm_bios_table_attr_entry_string_decode_def_string_length() 426 427### Fixed 428 4291. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 4302. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 4313. transport: mctp-demux: Don't test socket for non-zero value 4324. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4335. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4346. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4357. abi: Update to remove pldm_close() from reference dumps 4368. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 437 438## [0.3.0] - 2023-06-23 439 440### Added 441 4421. Add encode/decode pldmMessagePollEvent data 4432. README: Add a section on working with libpldm 4443. pdr: Introduce remote_container_id and associated APIs 4454. pdr: Add APIs for creating and locating remote PDRs 4465. pdr: Add pldm_pdr_find_last_in_range() 4476. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4487. pdr: Add pldm_pdr_find_container_id_range_exclude() 449 450### Changed 451 4521. include: Move installed transport.h under libpldm/ 4532. libpldm: Explicit deprecated, stable and testing ABI classes 4543. meson: Reduce strength of oem-ibm requirements from enabled to allowed 455 456 The `oem-ibm` feature is now enabled by the default meson configuration, for 457 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 458 recipe: 459 460 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 461 462 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 463 when invoking `meson setup` 464 4654. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4665. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 467 468### Deprecated 469 4701. bios_table: Deprecate APIs with arguments sanitized using assert() 471 472 C provides enough foot-guns without us encoding them into library APIs. 473 Specifically, deprecate the following in favour of their `*_check()` variants 474 which ensure assertions won't fail or otherwise invoke UB: 475 476 - pldm_bios_table_string_entry_encode() 477 - pldm_bios_table_string_entry_decode_string() 478 - pldm_bios_table_attr_entry_enum_encode() 479 - pldm_bios_table_attr_entry_enum_decode_pv_num() 480 - pldm_bios_table_attr_entry_enum_decode_def_num() 481 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 482 - pldm_bios_table_attr_entry_string_encode() 483 - pldm_bios_table_attr_entry_string_decode_def_string_length() 484 485### Removed 486 4871. libpldm: Remove the requester-api option 488 489### Fixed 490 4911. requester: Make pldm_open() return existing fd 4922. transport: Prevent sticking in waiting for response 4933. transport: Match on response in pldm_transport_send_recv_msg() 4944. requester: Add check before accessing hdr in pldm_recv() 4955. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 496