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. pdr: Introduce pldm_entity_association_pdr_add_check() 23 24### Changed 25 261. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 272. transport: pldm_transport_poll(): Adjust return value semantics 28 29### Deprecated 30 311. state-set: Enum pldm_state_set_operational_fault_status_values 32 33 The enum operational_fault_status is defined with wrong members and will 34 eventually be replaced with the correct members. Any uses of 35 pldm_state_set_operational_fault_status_values members should move to 36 equivalent pldm_state_set_operational_stress_status_values members if needed. 37 382. platform: Struct field name in fru_record_set PDR 39 40 References to entity_instance_num should be changed to entity_instance 41 423. platform: Struct field name in numeric sensor value PDR 43 44 References to entity_instance_num should be changed to entity_instance 45 46### Removed 47 481. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 492. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 503. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 514. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 525. bios_table: Remove pldm_bios_table_append_pad_checksum() 536. fru: Remove get_fru_record_by_option() 547. pdr: Make is_present() static 558. pdr: Remove pldm_pdr_add() 569. pdr: Remove pldm_pdr_add_fru_record_set() 5710. pdr: Remove pldm_entity_association_pdr_add_from_node() 5811. pdr: Make find_entity_ref_in_tree() static 5912. pdr: Make entity_association_tree_find() static 60 61### Fixed 62 631. requester: Fix response buffer cast in pldm_send_recv() 642. pdr: Hoist record handle overflow test to avoid memory leak 65 66## [0.4.0] - 2023-07-14 67 68### Added 69 701. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 712. fru: Introduce get_fru_record_by_option_check() 723. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 734. pdr: Introduce pldm_pdr_add_check() 745. pdr: Introduce pldm_pdr_add_fru_record_set_check() 75 76### Changed 77 781. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 792. requester: Expose pldm_close() in header 803. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 814. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 825. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 836. pdr: pldm_pdr_init(): Return NULL on allocation failure 847. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 858. pdr: Document preconditions for trivial accessor functions 86 87 A trivial accessor function is one that exposes properties of an object in a 88 way can't result in an error, beyond passing an invalid argument to the 89 function. For APIs meeting this definition we define a precondition that 90 struct pointers must point to valid objects to avoid polluting the function 91 prototypes. The following APIs now have this precondition explicitly defined: 92 93 - pldm_entity_extract() 94 - pldm_entity_get_parent() 95 - pldm_entity_is_exist_parent() 96 - pldm_entity_is_node_parent() 97 - pldm_is_current_parent_child 98 - pldm_is_empty_entity_assoc_tree() 99 - pldm_pdr_get_record_count() 100 - pldm_pdr_get_record_handle() 101 - pldm_pdr_get_repo_size() 102 - pldm_pdr_record_is_remote() 103 1049. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 10510. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 10611. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 10712. pdr: pldm_entity_association_tree_visit(): Document preconditions 10813. pdr: pldm_entity_association_tree_visit(): Exit early on failure 10914. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 11015. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 11116. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 11217. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 11318. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 11419. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 11520. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 11621. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 11722. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 11823. pdr: pldm_entity_get_num_children(): Don't return invalid values 11924. libpldm: Lift or remove asserts where a subsequent check exists 120 121### Deprecated 122 1231. pldm_bios_table_attr_entry_integer_encode() 124 125 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 126 1272. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 128 129 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 130 1313. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 132 133 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 134 1354. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 136 137 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 138 1395. pdr: Deprecate is_present() 140 141 There should be no users of this symbol. If you are a user, you should figure 142 out how to stop, or get in touch. This symbol will be marked static the 143 release after deprecation. 144 1456. pdr: Deprecate find_entity_ref_in_tree() 146 147 There should be no users of this symbol. If you are a user, you should figure 148 out how to stop, or get in touch. This symbol will be marked static the 149 release after deprecation. 150 1517. pdr: Deprecate entity_association_tree_find() 152 153 There should be no users of this symbol. If you are a user, you should figure 154 out how to stop, or get in touch. This symbol will be marked static the 155 release after deprecation. 156 1578. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 158 159 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 160 pldm_bios_table_append_pad_checksum() should migrate to 161 pldm_bios_table_append_pad_checksum_check() 162 1639. fru: Stabilise get_fru_record_by_option_check() 164 165 get_fru_record_by_option() is deprecated by this change. Users of 166 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 167 16810. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 169 170 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 171 Users of pldm_entity_association_pdr_add_from_node() should migrate to 172 pldm_entity_association_pdr_add_from_node_check() 173 17411. pdr: Stabilise pldm_pdr_add_check() 175 176 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 177 migrate to pldm_pdr_add_check() 178 17912. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 180 181 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 182 pldm_pdr_add_fru_record_set() should migrate to 183 pldm_pdr_add_fru_record_set_check() 184 185### Removed 186 1871. bios_table: Remove deprecated APIs sanitized by assert(): 188 189 - pldm_bios_table_string_entry_encode() 190 - pldm_bios_table_string_entry_decode_string() 191 - pldm_bios_table_attr_entry_enum_encode() 192 - pldm_bios_table_attr_entry_enum_decode_pv_num() 193 - pldm_bios_table_attr_entry_enum_decode_def_num() 194 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 195 - pldm_bios_table_attr_entry_string_encode() 196 - pldm_bios_table_attr_entry_string_decode_def_string_length() 197 198### Fixed 199 2001. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 2012. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 2023. transport: mctp-demux: Don't test socket for non-zero value 2034. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 2045. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 2056. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 2067. abi: Update to remove pldm_close() from reference dumps 2078. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 208 209## [0.3.0] - 2023-06-23 210 211### Added 212 2131. Add encode/decode pldmMessagePollEvent data 2142. README: Add a section on working with libpldm 2153. pdr: Introduce remote_container_id and associated APIs 2164. pdr: Add APIs for creating and locating remote PDRs 2175. pdr: Add pldm_pdr_find_last_in_range() 2186. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 2197. pdr: Add pldm_pdr_find_container_id_range_exclude() 220 221### Changed 222 2231. include: Move installed transport.h under libpldm/ 2242. libpldm: Explicit deprecated, stable and testing ABI classes 2253. meson: Reduce strength of oem-ibm requirements from enabled to allowed 226 227 The `oem-ibm` feature is now enabled by the default meson configuration, for 228 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 229 recipe: 230 231 https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10 232 233 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 234 when invoking `meson setup` 235 2364. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 2375. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 238 239### Deprecated 240 2411. bios_table: Deprecate APIs with arguments sanitized using assert() 242 243 C provides enough foot-guns without us encoding them into library APIs. 244 Specifically, deprecate the following in favour of their `*_check()` variants 245 which ensure assertions won't fail or otherwise invoke UB: 246 247 - pldm_bios_table_string_entry_encode() 248 - pldm_bios_table_string_entry_decode_string() 249 - pldm_bios_table_attr_entry_enum_encode() 250 - pldm_bios_table_attr_entry_enum_decode_pv_num() 251 - pldm_bios_table_attr_entry_enum_decode_def_num() 252 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 253 - pldm_bios_table_attr_entry_string_encode() 254 - pldm_bios_table_attr_entry_string_decode_def_string_length() 255 256### Removed 257 2581. libpldm: Remove the requester-api option 259 260### Fixed 261 2621. requester: Make pldm_open() return existing fd 2632. transport: Prevent sticking in waiting for response 2643. transport: Match on response in pldm_transport_send_recv_msg() 2654. requester: Add check before accessing hdr in pldm_recv() 2665. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 267