36324f6b | 24-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
Apply GCC's tainted_args attribute to library entrypoints
The implementation applies `__attribute__((tainted_args))` by integrating it into the existing ABI macro annotations.
In the process, quite
Apply GCC's tainted_args attribute to library entrypoints
The implementation applies `__attribute__((tainted_args))` by integrating it into the existing ABI macro annotations.
In the process, quite a number of APIs were discovered to be unsafe in ways that were not immediately fixable. Often this is because they lack arguments that enable the appropriate bounds-checking to be applied.
Redesigning them is work beyond the scope of the immediate effort. Instead, we also introduce a new annotation, LIBPLDM_ABI_DEPRECATED_UNSAFE, that simply lacks `__attribute__((tainted_args))` and therefore doesn't trigger the extra analysis.
Change-Id: Ib8994eaa3907a5432d040426ad03687cbf4c2136 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
57d9a2ef | 03-Oct-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
oem: ibm: platform: Bounds check encode_bios_attribute_update_event_req()
``` ../src/oem/ibm/platform.c: In function ‘encode_bios_attribute_update_event_req’: ../src/oem/ibm/platform.c:49:9: error:
oem: ibm: platform: Bounds check encode_bios_attribute_update_event_req()
``` ../src/oem/ibm/platform.c: In function ‘encode_bios_attribute_update_event_req’: ../src/oem/ibm/platform.c:49:9: error: use of attacker-controlled value ‘(long unsigned int)num_handles * 2’ as size without upper-bounds checking [CWE-129] [-Werror=analyzer-tainted-size] 49 | memcpy(request->bios_attribute_handles, list_of_handles, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 50 | num_handles * sizeof(uint16_t)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
gitlint-ignore: T1, B1 Fixes: 9c76679224cf ("libpldm: Migrate to subproject") Change-Id: Ie329d651207936b4a4762efa7631c9ecb525cf74 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
e984a461 | 07-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
meson: Format build files with `meson format`
Additionally, add the formatting command to `scripts/pre-submit` so it's run by OpenBMC's CI (via `scripts/run-ci`).
Change-Id: Ifb8fc06106b8cfa9155e98
meson: Format build files with `meson format`
Additionally, add the formatting command to `scripts/pre-submit` so it's run by OpenBMC's CI (via `scripts/run-ci`).
Change-Id: Ifb8fc06106b8cfa9155e986528b769a5ca450b4c Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
a7989cd6 | 30-Oct-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
meson: Fix for OEM header collision issue
It needs to be possible to build libpldm with any number of oem features enabled simultaneously. If the header files are same then the earlier implementatio
meson: Fix for OEM header collision issue
It needs to be possible to build libpldm with any number of oem features enabled simultaneously. If the header files are same then the earlier implementation will not work.
Install the header file in a way that doesn't break any oem portions. Also the symlinks are generated to the older location until we migrate the applications using the files to new location.
Tested: The headers are installed in the new location and symlinks are generated.
Change-Id: I1455d52ff4b0c7f74b49d136bf582182537592d1 Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
b0c1d20a | 07-Nov-2023 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
libpldm: Fix header use
The headers need to work whether we're building libpldm in the repo or we're building another project depending on the headers in the system include directory.
Tidy up the p
libpldm: Fix header use
The headers need to work whether we're building libpldm in the repo or we're building another project depending on the headers in the system include directory.
Tidy up the paths involved and switch to defining the public headers as system headers for the purpose of the build.
Change-Id: I49413988c94d393ea5761bc4684edcd2c2482a98 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
691668fe | 01-Nov-2023 |
Patrick Williams <patrick@stwcx.xyz> |
license: add spdx identifier to all files
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ifddd07cc0eb5edeb2dcb410747073d68c6631cb1 |
f89befe3 | 15-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
meson: Force inclusion of config.h via `-include`
Make sure there's no ambiguity about which config.h is used for includes in the event that libpldm acquires subprojects, or is used as a subproject
meson: Force inclusion of config.h via `-include`
Make sure there's no ambiguity about which config.h is used for includes in the event that libpldm acquires subprojects, or is used as a subproject itself.
Tested: `meson compile -C build` succeeds
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I08c3bdc807cc268d2401e06f0bfaee07f89ba534
show more ...
|
9d2a1c6a | 04-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
libpldm: Explicit deprecated, stable and testing ABI classes
Experimenting with new APIs is important, but ABI stability of the library is also important. We wish to have the freedom to add APIs wit
libpldm: Explicit deprecated, stable and testing ABI classes
Experimenting with new APIs is important, but ABI stability of the library is also important. We wish to have the freedom to add APIs without being burdened by them being immediately set in stone.
We implement this wish by introducing three classes of ABI:
1. deprecated 2. stable 3. testing
These are enforced by corresponding function attributes:
1. LIBPLDM_ABI_DEPRECATED 2. LIBPLDM_ABI_STABLE 3. LIBPLDM_ABI_TESTING
Symbol visibility in the library is flipped to 'hidden' by default, so one of these annotations must be used for the symbol to be exposed.
With these classes in place there are now clear points in time at which we update the ABI dumps captured under the abi/ directory: When an API is migrated from the 'testing' class to the 'stable' class, or when removed from the 'deprecated' class.
Which classes of functions are exposed by the build is controlled by the new 'abi' meson option. The option is of array type which contains the list of ABI classes the build should consider. It defaults to enabling all classes to provide test coverage in CI. The classes used should be constrained to deprecated and stable (and not test) in any dependent projects.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I25402e20c7be9c9f264f9ccd7ac36b384823734c
show more ...
|
37dd6a3d | 12-May-2023 |
Andrew Jeffery <andrew@aj.id.au> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository[1] and reformat the repository.
[1] https://gerrit.openbmc.org/c/openbmc/docs/+/63441
Further, shift the fixup for C's `_Static_assert` into src/msgbuf.h to prevent a clang-tidy-16 error:
``` /data0/jenkins/workspace/ci-repository/openbmc/libpldm/src/msgbuf.h:315:2: error: '_Static_assert' is a C11 extension [clang-diagnostic-c11-extensions,-warnings-as-errors] _Static_assert(sizeof(*dst) == sizeof(ldst), ^ ```
And fix up the function prototype in the definition of `pldm_open()`:
``` ../src/requester/pldm.c:128:16: error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes,-warnings-as-errors] void pldm_close() ^ void ```
Change-Id: I57b53f51914e39237e733d024e62ab41b3d306c1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
9a8e4975 | 28-Nov-2022 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix includes using iwyu tool
These changes are done by running iwyu manually under clang14.
IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in ``
Fix includes using iwyu tool
These changes are done by running iwyu manually under clang14.
IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in ``` https: //github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md. ``` Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: Idaaeffd78c9ad7db2b41a057d40f889ade297c55
show more ...
|
9c766792 | 10-Aug-2022 |
Andrew Jeffery <andrew@aj.id.au> |
libpldm: Migrate to subproject
Organize files in libpldm to make it a subproject
In the current state, libpldm is not readily consumable as a subproject.This commit does all the necessary re-organi
libpldm: Migrate to subproject
Organize files in libpldm to make it a subproject
In the current state, libpldm is not readily consumable as a subproject.This commit does all the necessary re-organisation of the source code to make it work as a subproject.
There are no .c/.h files changes in this commit, only meson changes and re-organising the code structure.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I20a71c0c972b1fd81fb359d604433618799102c6
show more ...
|