Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.6.X update backports #3369

Merged
merged 10 commits into from
Mar 27, 2024
Merged

Conversation

JuergenReppSIT
Copy link
Member

The bug fixes for 5.7 are cherry picked.

JuergenReppSIT and others added 10 commits March 21, 2024 09:23
The issue described at: tpm2-software/tpm2-tss#2792
is temporally fixed by adding: "run: sudo sysctl vm.mmap_rnd_bits=28"
in ./github/workflow/main.yml

Signed-off-by: Juergen Repp <[email protected]>
The format directive %lu for size_t could not be compiled on 32 bit
systems. %zu is now used instead of %l

Signed-off-by: Juergen Repp <[email protected]>
When reading auths from a file, make sure they are 0-terminated.

Signed-off-by: Andreas Fuchs <[email protected]>
configure scripts need to be runnable with a POSIX-compliant /bin/sh.

On many (but not all!) systems, /bin/sh is provided by Bash, so errors
like this aren't spotted. Notably Debian defaults to /bin/sh provided
by dash which doesn't tolerate such bashisms as '=='.

This retains compatibility with bash.

Fixes configure warnings/errors like:
```
checking for libcurl... yes
./configure: 15201: test: xauto: unexpected operator
./configure: 15286: test: xauto: unexpected operator
checking for efivar/efivar.h... yes
```

This fixes a build error later on too:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: lib/libcommon.a(libcommon_a-tpm2_eventlog_yaml.o): in function `yaml_devicepath':
tpm2_eventlog_yaml.c:(.text.yaml_devicepath+0x2f): undefined reference to `efidp_format_device_path'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: tpm2_eventlog_yaml.c:(.text.yaml_devicepath+0x61): undefined reference to `efidp_format_device_path'
```

Bug: https://bugs.gentoo.org/922592
Signed-off-by: Sam James <[email protected]>
ubuntu 18.04 is replaced with ubuntu 20.04.

Signed-off-by: Juergen Repp <[email protected]>
* The tss compilation with tcti-libtpms is currently not possible
for FreeBSD.
* pandock will be installed.

Signed-off-by: Juergen Repp <[email protected]>
tpm2_tool.c did not compile without the include libgen.h on netbsd.
Fixes: tpm2-software#3321

Signed-off-by: Juergen Repp <[email protected]>
Fixes:
./tools/tpm2 nvread
WARN: Reading full size of the NV index
ERROR: object string is empty
ERROR: Invalid handle authorization.
ERROR: Unable to run nvread

with:
./tools/tpm2 nvread
ERROR: Must specify NV index argument
Usage: nvread [<options>] <arguments>
Where <options> are:
    [ -C | --hierarchy=<value>] [ -o | --output=<value>] [ -s | --size=<value>] [ --offset=<value>]
    [ --cphash=<value>] [ --rphash=<value>] [ -n | --name=<value>] [ -P | --auth=<value>]
    [ -S | --session=<value>] [ --print-yaml]

Signed-off-by: Bill Roberts <[email protected]>
A command that should work with no options would fail:

./tools/tpm2 nvdefine
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:164:Esys_GetCapability_Async() esyscontext is NULL.
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:83:Esys_GetCapability() Error in async function ErrorCode (0x00070005)
ERROR: Esys_NV_ReadPublic(0x70005) - esapi:A pointer is NULL that isn't allowed to be NULL.
ERROR: Unable to run nvdefine

The handling for the optional and fake TCTI states would get conflated
and not initialize an ESAPI context. Clean up the handling and make
supporting a fake TCTI it's own option bit to make it less confusing to
code.

After this the tool works as expected:
./tools/tpm2 nvdefine
nv-index: 0x1000000

Fixes: tpm2-software#3314
Signed-off-by: Bill Roberts <[email protected]>
fix syntax error (a space character is missing) making the test not ending correctly

Signed-off-by: lcharpentier-stm <[email protected]>
@JuergenReppSIT JuergenReppSIT changed the title 5.6.x update backports 5.6.X update backports Mar 21, 2024
@AndreasFuchsTPM AndreasFuchsTPM merged commit 0c60369 into tpm2-software:5.6.X Mar 27, 2024
16 checks passed
@AndreasFuchsTPM AndreasFuchsTPM added this to the 5.6.1 milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants