From e277516d552c362b0f6c54fee4e83b48ff830759 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 14 Jul 2021 06:50:13 -0400 Subject: [PATCH] Update to new upstream release 1.3.1 This fixes ABI issues and incorporates previous patches Related: #rhbz1981316 Signed-off-by: Simo Sorce --- 0001-Use-GCCs-__symver__-attribute.patch | 49 ++++++++++++++ 001-libkcapi-1.3.0-32bit-werror.patch | 83 ------------------------ 002-libkcapi-1.3.0-s390-types.patch | 47 -------------- libkcapi.spec | 10 +-- sources | 4 +- 5 files changed, 57 insertions(+), 136 deletions(-) create mode 100644 0001-Use-GCCs-__symver__-attribute.patch delete mode 100644 001-libkcapi-1.3.0-32bit-werror.patch delete mode 100644 002-libkcapi-1.3.0-s390-types.patch diff --git a/0001-Use-GCCs-__symver__-attribute.patch b/0001-Use-GCCs-__symver__-attribute.patch new file mode 100644 index 0000000..d900222 --- /dev/null +++ b/0001-Use-GCCs-__symver__-attribute.patch @@ -0,0 +1,49 @@ +From 2abf7fecb5162e4b59ba134c813ebee839eb45e9 Mon Sep 17 00:00:00 2001 +From: Simo Sorce +Date: Wed, 14 Jul 2021 10:52:01 -0400 +Subject: [PATCH] Use GCCs __symver__ attribute + +This is needed to allow LTO builds, as the __asm__ directives do not give +enough context to the compiler and the build fails when the -flto flag is +passed in. + +Unfotunately __symver__ is avilbel only startig from GCC 10, so we need +more macro juggling. + +Signed-off-by: Simo Sorce +--- + lib/internal.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/lib/internal.h b/lib/internal.h +index 29fdb7b..64dad24 100644 +--- a/lib/internal.h ++++ b/lib/internal.h +@@ -350,6 +350,16 @@ static inline int io_getevents(__attribute__((unused)) aio_context_t ctx, + #if __GNUC__ >= 4 + # define DSO_PUBLIC __attribute__ ((visibility ("default"))) + ++#if __GNUC__ >= 10 ++# define IMPL_SYMVER(name, version) \ ++ __attribute__ ((visibility ("default"))) \ ++ __attribute__((__symver__("kcapi_" #name "@@LIBKCAPI_" version))) ++ ++# define ORIG_SYMVER(name, version) \ ++ __attribute__ ((visibility ("default"))) \ ++ __attribute__((__symver__("kcapi_" #name "@LIBKCAPI_" version))) ++ ++#else + # define IMPL_SYMVER(name, version) \ + __asm__(".global impl_" #name ";"\ + ".symver impl_" #name ",kcapi_" #name "@@LIBKCAPI_" version);\ +@@ -359,6 +369,7 @@ static inline int io_getevents(__attribute__((unused)) aio_context_t ctx, + __asm__(".global orig_" #name ";"\ + ".symver orig_" #name ",kcapi_" #name "@LIBKCAPI_" version);\ + __attribute__ ((visibility ("default"))) ++#endif + + #else + # error "Compiler version too old" +-- +2.31.1 + diff --git a/001-libkcapi-1.3.0-32bit-werror.patch b/001-libkcapi-1.3.0-32bit-werror.patch deleted file mode 100644 index ef2b0b2..0000000 --- a/001-libkcapi-1.3.0-32bit-werror.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 299e5e8c38de9be99b86885c1af60dd5e1cc9888 Mon Sep 17 00:00:00 2001 -From: Ondrej Mosnacek -Date: Mon, 17 May 2021 22:19:32 +0200 -Subject: [PATCH] docproc: fix -Wconversion warnings on 32-bit - -On i686, GCC 11.1.1 complains: -``` -lib/doc/bin/docproc.c: In function 'find_all_symbols': -lib/doc/bin/docproc.c:433:17: error: conversion to 'ssize_t' {aka 'int'} from 'unsigned int' may change the sign of the result [-Werror=sign-conversion] - 433 | start = all_list_len; - | ^~~~~~~~~~~~ -lib/doc/bin/docproc.c:441:48: error: comparison of integer expressions of different signedness: 'ssize_t' {aka 'int'} and 'unsigned int' [-Werror=sign-compare] - 441 | for (i = 0; i < (int)data_len && start != all_list_len; i++) { - | ^~ -cc1: all warnings being treated as errors -``` - -Fix this by declaring all of all_list_len, i, count, and start as -size_t and remove a few casts that are no longer necessary. - -Signed-off-by: Ondrej Mosnacek -Signed-off-by: Stephan Mueller ---- - lib/doc/bin/docproc.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/lib/doc/bin/docproc.c b/lib/doc/bin/docproc.c -index 556d5d4..74b3cdb 100644 ---- a/lib/doc/bin/docproc.c -+++ b/lib/doc/bin/docproc.c -@@ -77,11 +77,11 @@ FILELINE * docsection; - static char *srctree, *kernsrctree; - - static char **all_list = NULL; --static unsigned int all_list_len = 0; -+static size_t all_list_len = 0; - - static void consume_symbol(const char *sym) - { -- unsigned int i; -+ size_t i; - - for (i = 0; i < all_list_len; i++) { - if (!all_list[i]) -@@ -361,11 +361,11 @@ static void find_all_symbols(char *filename) - { - char *vec[4]; /* kerneldoc -list file NULL */ - pid_t pid; -- ssize_t ret, i, count, start; -+ ssize_t ret; - char real_filename[PATH_MAX + 1]; - int pipefd[2]; - char *data, *str; -- size_t data_len = 0; -+ size_t i, count, start, data_len = 0; - - vec[0] = KERNELDOC; - vec[1] = LIST; -@@ -424,21 +424,21 @@ static void find_all_symbols(char *filename) - - count = 0; - /* poor man's strtok, but with counting */ -- for (i = 0; i < (int)data_len; i++) { -+ for (i = 0; i < data_len; i++) { - if (data[i] == '\n') { - count++; - data[i] = '\0'; - } - } - start = all_list_len; -- all_list_len += (unsigned int)count; -+ all_list_len += count; - all_list = realloc(all_list, sizeof(char *) * all_list_len); - if (!all_list) { - perror("realloc"); - exit(1); - } - str = data; -- for (i = 0; i < (int)data_len && start != all_list_len; i++) { -+ for (i = 0; i < data_len && start != all_list_len; i++) { - if (data[i] == '\0') { - all_list[start] = str; - str = data + i + 1; diff --git a/002-libkcapi-1.3.0-s390-types.patch b/002-libkcapi-1.3.0-s390-types.patch deleted file mode 100644 index 552de91..0000000 --- a/002-libkcapi-1.3.0-s390-types.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 00603fbe01de879eb1bd49a4475b0e619f4bb3b0 Mon Sep 17 00:00:00 2001 -From: Ondrej Mosnacek -Date: Tue, 18 May 2021 15:03:17 +0200 -Subject: [PATCH] Fix bad types in _kcapi_common_send_meta() - -The types for 'type' and 'assoclen' variables need to match the kernel -ABI, so they can't be changed to size_t. On most arches it is by chance -still working, but on s390x usign size_t here makes almost all tests -fail. Change the variables back to uint32_t pointers to fix this. - -Signed-off-by: Ondrej Mosnacek -Signed-off-by: Stephan Mueller ---- - lib/kcapi-kernel-if.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/kcapi-kernel-if.c b/lib/kcapi-kernel-if.c -index a92e2f7..4968a8a 100644 ---- a/lib/kcapi-kernel-if.c -+++ b/lib/kcapi-kernel-if.c -@@ -125,7 +125,7 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle, - - /* plaintext / ciphertext data */ - struct cmsghdr *header = NULL; -- size_t *type = NULL; -+ uint32_t *type = NULL; - struct msghdr msg; - - /* IV data */ -@@ -135,7 +135,7 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle, - 0; - - /* AEAD data */ -- size_t *assoclen = NULL; -+ uint32_t *assoclen = NULL; - size_t assoc_msg_size = handle->aead.assoclen ? - CMSG_SPACE(sizeof(*assoclen)) : 0; - -@@ -205,7 +205,7 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle, - header->cmsg_type = ALG_SET_AEAD_ASSOCLEN; - header->cmsg_len = CMSG_LEN(sizeof(*assoclen)); - assoclen = (void*)CMSG_DATA(header); -- *assoclen = handle->aead.assoclen; -+ *assoclen = (uint32_t)handle->aead.assoclen; - } - - ret = sendmsg(*_kcapi_get_opfd(handle), &msg, (int)flags); diff --git a/libkcapi.spec b/libkcapi.spec index f90a46f..2a863ce 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -1,7 +1,7 @@ # Shared object version of libkcapi. %global vmajor 1 %global vminor 3 -%global vpatch 0 +%global vpatch 1 # Do we build the replacements packages? %bcond_with replace_coreutils @@ -135,9 +135,7 @@ Source1: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc Source2: sha512hmac-openssl.sh Source3: fipshmac-openssl.sh -Patch1: 001-libkcapi-1.3.0-32bit-werror.patch -Patch2: 002-libkcapi-1.3.0-s390-types.patch - +Patch1: 0001-Use-GCCs-__symver__-attribute.patch BuildRequires: bash BuildRequires: coreutils @@ -514,6 +512,10 @@ popd %changelog +* Wed Jul 14 2021 Simo Sorce - 1.3.1-1 +- Update to new upstream release 1.3.1 +- This fixes ABI issues and incorporates previous patches + * Mon Jul 12 2021 Simo Sorce - 1.3.0-1 - Update to new upstream release 1.3.0 diff --git a/sources b/sources index 613d2f6..02e03e8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libkcapi-1.3.0.tar.xz) = 3b6fbf9b6651dec870c9181709c8e7d7882d4967fe1c4d53a59cc428fcf83e2ec1f56f09406d8918f145beb417dffbfdf4719c2c61631d8008bb049970323ed0 -SHA512 (libkcapi-1.3.0.tar.xz.asc) = 9b89ea6743e43727bc9e003bb617970f4ab389b3d740a16105ca6eeff2a3485a56664aecf957c5e30fb54f5dfa44fc0cc015dd4e9b518b16db2fad55e8cba69c +SHA512 (libkcapi-1.3.1.tar.xz) = 2240e5410e1df4b54f42182bf294ac13d82fd78d60466cafef7644bf7c9144c064ba1fd78d110d66bc41fd220ad2f211081eb64a0da5c8740716a3146d72ba30 +SHA512 (libkcapi-1.3.1.tar.xz.asc) = fb5f85401921e884e7eb7b989baed2c98371a90b61056c929bf8348e7864fc001b67d7e5bf5f799d61befbefa6ab60b296c1d781fc30069936edc3eb40134954