[PATCH] key: Change initialization of struct keyctl_dh_params
by Mat Martineau
Using a designated initializer with struct keyctl_dh_params has broken
due to a kernel header file change to one of the member names,
introduced in kernel v4.19-rc3:
https://lore.kernel.org/lkml/1735b3a4-2792-0ce4-3bf4-94fee5b50ff6@infrade...
If the member names are dropped from the initializer then the code will
compile and work correctly before or after the kernel header change.
---
Thanks for reporting the breakage, Andreas.
ell/key.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ell/key.c b/ell/key.c
index 6b16e55..b45ebc6 100644
--- a/ell/key.c
+++ b/ell/key.c
@@ -202,9 +202,7 @@ static long kernel_dh_compute(int32_t private, int32_t prime, int32_t base,
{
long result;
- struct keyctl_dh_params params = { .private = private,
- .prime = prime,
- .base = base };
+ struct keyctl_dh_params params = { private, prime, base };
result = syscall(__NR_keyctl, KEYCTL_DH_COMPUTE, ¶ms, payload, len,
NULL);
--
2.19.0
3 years, 9 months
[PATCH 1/3] hwdb: Allow loading of v2 or v3 hwdb.bin files
by Mat Martineau
The hwdb trie entry has been extended in a reverse-compatible way, but
ELL had a strict check for the size of struct trie_entry that caused the
load to fail. Instead of requiring an exact size, only make sure the
entry is not too small.
---
ell/hwdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ell/hwdb.c b/ell/hwdb.c
index 29b7557..0d5f95a 100644
--- a/ell/hwdb.c
+++ b/ell/hwdb.c
@@ -136,7 +136,7 @@ LIB_EXPORT struct l_hwdb *l_hwdb_new(const char *pathname)
if (L_LE64_TO_CPU(hdr->child_size) != sizeof(struct trie_child))
goto failed;
- if (L_LE64_TO_CPU(hdr->entry_size) != sizeof(struct trie_entry))
+ if (L_LE64_TO_CPU(hdr->entry_size) < sizeof(struct trie_entry))
goto failed;
if (L_LE64_TO_CPU(hdr->header_size) + L_LE64_TO_CPU(hdr->nodes_size) +
--
2.18.0
3 years, 9 months