The endianness handling was only partially implemented for uvio.c. Let's remove
it since doesn't make much sense here, because the IOCTL must be build on the
same system where they're actually executed.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
the buffer sizing did not work any longer
add explaining comments and rework the variable names for claritiy
refering commit f7cc14753cc9d930af804e2ac3ce108a12145db6
Reported-by: Mike Storzer <MSTORZER@de.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Use `PV_CERT_ERROR` error domain whenever useful. Currently, it's only used
internally in libpv and therefore there is no problem in changing it.
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
There should be no problem with this change since the changed value was never
used. Therefore, let's remove the assignment and declare the parameter as const
to prevent such a behavior in the future.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The machine types are not strictly increasing anymore since Z16, therefore,
we cannot use numerical comparison to find out the correct HSA size
of a machine.
Fixes: 2515832469 ("util_arch: Add IBM z16 as known machine")
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
`afl-clang` requires a white space between a option name and the option value.
Therefore let's fix this for `-xc` by adding a white space.
How to reproduce:
$ make -C zdump CC=afl-clang-fast LINK=afl-clang-fast
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
some versions of /bin/dash do interpreted our commands different, which
causes a variable failure and termination of the script.
e.g. a new line char "\n" will split the cmd_type to a multiple line variable
not working with the followup commands. adding the head command does avoid
multiline variables now.
Problem found in Ubuntu 20.4 and some older Ubuntu versions
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
move tool checking to the top of the script and add the output to
the check function (-c) for easy verifivation and testing
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
All debian distors use the dash shell as default, where type is not supprting "-t" parameter
Remove of "-t" where not important and change type check not using -t
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Easier to read for a first glimpse than the (still required) full config.
$ man multipathd
list|show config local
Show the currently used configuration like show config, but lim‐
iting the devices section to those devices that are actually
present in the system.
Works as of multipath-tools 0.7.8 commit
c23924dc74ee ("multipathd: implement "show config local"")
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
==660622== 385 bytes in 7 blocks are definitely lost in loss record 30 of 37
==660622== at 0x484417C: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-s390x-linux.so)
==660622== by 0x4E93BD7: strdup (strdup.c:42)
==660622== by 0x11249F: zg_strdup (zg.c:115)
==660622== by 0x11249F: zg_open (zg.c:164)
==660622== by 0x114FBF: dfi_dump_open (dfi.c:750)
==660622== by 0x114FBF: dfi_init (dfi.c:772)
==660622== by 0x111465: do_copy (zgetdump.c:192)
==660622== by 0x111465: main (zgetdump.c:216)
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
we do miss a simple way to see the dbginfo.sh version used by the
customer for the debug generation. saving the version now to dbginfo.log
Reported-by: Mike Storzer <MSTORZER@de.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Although the previous patch enables pvattest to display the
config UID this script enables the user to extract the config UID of
the SE-guest and the additional data if specified. This allows users of
pvattest v2.22.0 to view the config UID without examining binary blobs.
$ ./pvattest-info attresult.bin
Config UID:
1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
Additional Data:
1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
1b1b
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
In verbose mode (-v) `pvattest verify´ now also prints
"Attestation measurement verified", if the verification was successful and the
Config UID of the SE-guest and any additional data if available.
$ pvattest -V verify [...]
Attestation measurement verified
Config UID:
1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a
Additional Data:
1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Change the name of `hexdump´ to `pvattest_log_bytes´. Additionally, allow
that function to dump the bytes as a single hexadecimal number.
Change the name of `printf_hexdump´ to `pvattest_hexdump´.
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Map the Ultravisor return code 0x2 to "Invalid UV command" string. This
results in better error messages.
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The dracut installation directory is referenced from `chreipl-fcp-mpath`,
`zdev`, and `zipl`; in each with its own individual definition and
variable name. This makes it unnecessarily hard to change it when
installing from the top level directory of s390-tools and passing
variable overwrites via the command line.
Fix this by defining a common `DRACUTDIR` variable in the shared
`common.mak` file, and referencing this in each tool as base directory.
With this a user can simply pass `DRACUTDIR=/foo/bar/baz` on the
commandline and change the installation for all three tools.
Further, also derive common `DRACUTCONFDIR` and `DRACUTMODDIR` variables
from `DRACUTDIR` in `common.mak`, so that `zdev` and `zipl` don't use
different variable names for the same directory anymore, and all these
are defined together in a common place.
Semantically nothing changes for a default build/installation.
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
UDEVDIR is used in both `chreipl-fcp-mpath` and `zdev`, but with a
different meaning. In the former it points to the base udev directory,
not the rules directory; in the later it points to the rules directory.
If someone was to call `make` from the top level directory, and set
UDEVDIR for the whole build/installation, it would either break `zdev`
or `chreipl-fcp-mpath` (depending on what it was set to).
Fix this by pulling the definition of it in the shared `common.mak`
file, and giving it a common meaning. Point UDEVDIR to the base udev
directory, and UDEVRULESDIR to the rules directory below it.
Semantically nothing changes for a default build/installation.
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Fixes a bug that leads to a segmentation fault when no parmline is
provided.
Fixes: 11b401b5 ("zipl: move and make check for maximum command line length dynamic")
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Fixes a bug that make still tried to build pvattest even when the
compilation of pvattest was turned off.
This lead to a build bug when one of the dependencies was not met.
Also fixes the check of the OpenSSL version at build time.
Fixes: 3ab06d77 ("pvattest: Create, perform, and verify attestation measurements")
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Fixes a bug that make still tried to build libpv even when the
compilation of libpv was turned off.
This lead to a build bug when one of the dependencies was not met.
Also fixes the check of the OpenSSL version at build time.i
Fixes: 38639269 ("libpv: New library for PV tools")
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
pv_BIO_reset() wrongfully handled the BIO_reset() rc for non-file-backed BIOs.
This is currently not an issue as the only non-file BIO used cannot fail
at BIO_reset()
Fixes: 3ab06d77fb ("pvattest: Create, perform, and verify attestation measurements")
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The returncode handling for BIO_reset() was wrong when handling with
file based BIOs.
This resulted in a bug that DER formated certificates cannot be read
by genprotimg which is now fixed.
Fixes: d90344a2 (genprotimg: check return value of BIO_reset)
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
dasdfmt.c: In function ‘dasdfmt_write_labels’:
dasdfmt.c:1110:22: warning: ‘write’ reading 88 bytes from a region of size 4 [-Wstringop-overread]
1110 | rc = write(fd, &vlabel->vollbl, (sizeof(*vlabel)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | - sizeof(vlabel->volkey)));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from dasdfmt.c:23:
../include/lib/vtoc.h:84:14: note: source object ‘vollbl’ of size 4
84 | char vollbl[4]; /* volume label */
| ^~~~~~
In file included from ../include/lib/util_opt.h:16,
from dasdfmt.c:20:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~
GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/137
Signed-off-by: Dan Horák <dan@danny.cz>
Acked-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Replace strncpy() with util_strlcpy() which provides the required
semantic.
In function ‘dasdview_print_format1’,
inlined from ‘dasdview_view_standard’ at dasdview.c:1952:4,
inlined from ‘dasdview_view’ at dasdview.c:2165:3,
inlined from ‘main’ at dasdview.c:2364:3:
dasdview.c:1791:25: warning: ‘strncpy’ output may be truncated copying 16 bytes from a string of length 1023 [-Wstringop-truncation]
1791 | strncpy(asc, (char *)dumpstr + i, 16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dasdview.c:1792:25: warning: ‘strncpy’ output may be truncated copying 16 bytes from a string of length 1023 [-Wstringop-truncation]
1792 | strncpy(ebc, (char *)dumpstr + i, 16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘dasdview_print_format2’,
inlined from ‘dasdview_view_standard’ at dasdview.c:1935:4,
inlined from ‘dasdview_view’ at dasdview.c:2165:3,
inlined from ‘main’ at dasdview.c:2364:3:
dasdview.c:1825:25: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 1023 [-Wstringop-truncation]
1825 | strncpy(asc, (char *)dumpstr + i, 8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dasdview.c:1826:25: warning: ‘strncpy’ output may be truncated copying 8 bytes from a string of length 1023 [-Wstringop-truncation]
1826 | strncpy(ebc, (char *)dumpstr + i, 8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/137
Signed-off-by: Dan Horák <dan@danny.cz>
[hoeppner@linux.ibm.com: sort include]
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The build produces a number of warnings like the ones below. The
unaligned pointers are expected, thus silence the warnings by disabling
the compiler diagnostics.
ziomon_dacc.c: In function ‘read_message’:
ziomon_dacc.c:189:44: warning: taking address of packed member of ‘struct message’ may result in an unaligned pointer value [-Waddress-of-packed-member]
189 | if ( (rc = read_message_header(fp, &msg->length, &msg->type)) )
| ^~~~~~~~~~~~
or
In file included from ziomon_mgr.c:36:
blkiomon.h: In function ‘blkiomon_stat_init’:
blkiomon.h:70:21: warning: taking address of packed member of ‘struct blkiomon_stat’ may result in an unaligned pointer value [-Waddress-of-packed-member]
70 | minmax_init(&bstat->size_r);
| ^~~~~~~~~~~~~~
GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/137
Signed-off-by: Dan Horák <dan@danny.cz>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The kernel already provides the same macro as does the zt_common.h file,
thus check for its availability first.
CC zconf/qeth/lsqeth.o
In file included from ../../include/lib/util_base.h:17,
from lsqeth.c:30:
../../include/lib/zt_common.h:27: warning: "_AC" redefined
27 | #define _AC(X, TYPE) X##TYPE
|
In file included from /usr/include/linux/ethtool.h:17,
from lsqeth.c:12:
/usr/include/linux/const.h:21: note: this is the location of the previous definition
21 | #define _AC(X,Y) __AC(X,Y)
|
GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/137
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>