[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Tue Oct 31 10:20:33 UTC 2017


The branch master has been updated
       via  3ba70235be29cc39df7d859df2894c9de2961019 (commit)
       via  bee9c8a4ffd3ec65bb56aaa04423c4f6f9c4012c (commit)
      from  f19a5ff9ab85313f5b30cfc9fbed3a2eea60a59d (commit)


- Log -----------------------------------------------------------------
commit 3ba70235be29cc39df7d859df2894c9de2961019
Author: Baptiste Jonglez <git at bitsofnetworks.org>
Date:   Mon Oct 30 11:38:09 2017 +0100

    afalg: Fix kernel version check
    
    The check should reject kernel versions < 4.1.0, not <= 4.1.0.
    
    The issue was spotted on OpenSUSE 42.1 Leap, since its linux/version.h
    header advertises 4.1.0.
    
    CLA: trivial
    Fixes: 7f458a48 ("ALG: Add AFALG engine")
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4617)

commit bee9c8a4ffd3ec65bb56aaa04423c4f6f9c4012c
Author: Baptiste Jonglez <git at bitsofnetworks.org>
Date:   Mon Oct 30 11:36:06 2017 +0100

    afalg: Use eventfd2 syscall instead of eventfd
    
    The eventfd syscall is deprecated and is not available on aarch64, causing
    build to fail:
    
        engines/e_afalg.c: In function 'eventfd':
        engines/e_afalg.c:108:20: error: '__NR_eventfd' undeclared (first use in this function)
             return syscall(__NR_eventfd, n);
                            ^
    
    Instead, switch to the newer eventfd2 syscall, which is supposed to be
    supported by all architectures.
    
    This kind of issues would be avoided by simply using the eventfd(2)
    wrapper from the libc, but there must be subtle reasons not to...
    
    Tested on a aarch64 system running OpenSUSE Leap 42.1 (gcc118 from
    https://cfarm.tetaneutral.net/machines/list/ ) and also cross-compiling
    for aarch64 with LEDE (kernel 4.9).
    
    This properly fixes #1685.
    
    CLA: trivial
    Fixes: 7f458a48 ("ALG: Add AFALG engine")
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4617)

-----------------------------------------------------------------------

Summary of changes:
 engines/e_afalg.c | 4 ++--
 test/afalgtest.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index 7e68255..2f5ee4c 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -24,7 +24,7 @@
 #define K_MAJ   4
 #define K_MIN1  1
 #define K_MIN2  0
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2) || \
+#if LINUX_VERSION_CODE < KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2) || \
     !defined(AF_ALG)
 # ifndef PEDANTIC
 #  warning "AFALG ENGINE requires Kernel Headers >= 4.1.0"
@@ -105,7 +105,7 @@ static ossl_inline int io_setup(unsigned n, aio_context_t *ctx)
 
 static ossl_inline int eventfd(int n)
 {
-    return syscall(__NR_eventfd, n);
+    return syscall(__NR_eventfd2, n, 0);
 }
 
 static ossl_inline int io_destroy(aio_context_t ctx)
diff --git a/test/afalgtest.c b/test/afalgtest.c
index 62dcdb2..18025ab 100644
--- a/test/afalgtest.c
+++ b/test/afalgtest.c
@@ -29,7 +29,7 @@ static ENGINE *e;
 # define K_MAJ   4
 # define K_MIN1  1
 # define K_MIN2  0
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2)
+# if LINUX_VERSION_CODE < KERNEL_VERSION(K_MAJ, K_MIN1, K_MIN2)
 /*
  * If we get here then it looks like there is a mismatch between the linux
  * headers and the actual kernel version, so we have tried to compile with


More information about the openssl-commits mailing list