Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aeed03b4-fe42-cf05-8671-40588ea3844f@gmail.com>
Date: Wed, 5 Aug 2020 16:55:32 +0200
From: Mikhail Morfikov <mmorfikov@...il.com>
To: lkrg-users@...ts.openwall.com
Subject: Re: lkrg: Fix build LKRG for kernel 5.8+

On 04/08/2020 22.00, Solar Designer wrote:
> Hi,
> 
> On Thu, Jul 09, 2020 at 05:53:43PM +0300, Andy Lavr wrote:
>> Fix for kernel 5.8+:
>>
>> --- p_lkrg_main.h.orig  2020-07-09 08:47:17.958122925 +0300
>> +++ p_lkrg_main.h       2020-07-09 11:03:47.754854373 +0300
>> @@ -60,7 +62,11 @@
>>
>>  #include <linux/signal.h>
>>  #include <linux/timex.h>
>> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
>> +#include <crypto/sha.h>
>> +#else
>>  #include <linux/cryptohash.h>
>> +#endif
>>
>>  #include <linux/stacktrace.h>
>>  #include <asm/stacktrace.h>
> 
> Thank you for this contribution, Andy!
> 
> I was hoping Adam would take care of this, but he was busy and now Linux
> 5.8 is out and we should include a fix without further delay.  So I took
> a look myself.
> 
> So Linux 5.8 in fact moved linux/cryptohash.h to crypto/sha.h.  However,
> what do we need that header file for?  Per my analysis, we only make use
> of it on older kernels (< 4.4.72 or < RHEL 7.4) for the one use of
> md5_transform() in get_random_long().  On newer kernels, we simply use
> the kernel-provided get_random_long().  Further, 5.8's crypto/sha.h
> doesn't declare md5_transform() anyway (linux/cryptohash.h on much older
> kernels did).
> 
> So I think a cleaner fix would be to wrap #include <linux/cryptohash.h>
> inside an #if with the same condition that we use to decide whether to
> define a custom get_random_long().  And longer-term I'd like to revisit
> that custom get_random_long() and its safety.
> 
> I've just pushed that fix to:
> 
> https://github.com/openwall/lkrg
> 
> And yes, we're moving from Bitbucket to GitHub.
> 
> Thanks again,
> 
> Alexander
> 

It looks like that lkrg stopped building on kernel 5.7. 
I was able to build lkrg on 5.7.12 but after today's git pull, 
I'm unable to build for the same kernel with the following error:

# cat /var/lib/dkms/lkrg/0.8.1+git20200804/build/make.log
DKMS make.log for lkrg-0.8.1+git20200804 for kernel 5.7.12-amd64 (x86_64)
2020-08-05T16:49:59 CEST
make: Entering directory '/usr/src/linux-headers-5.7.12-amd64'
  AR      /var/lib/dkms/lkrg/0.8.1+git20200804/build/built-in.a
  CC [M]  /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/ksyms/p_resolve_ksym.o
  CC [M]  /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/hashing/p_lkrg_fast_hash.o
  CC [M]  /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/comm_channel/p_comm_channel.o
  CC [M]  /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/integrity_timer/p_integrity_timer.o
In file included from /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/comm_channel/p_comm_channel.c:18:
/var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/comm_channel/../../p_lkrg_main.h:66:50: error: missing binary operator before token "("
   66 |          RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 4)))
      |                                                  ^
In file included from /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/integrity_timer/p_integrity_timer.c:18:
/var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/integrity_timer/../../p_lkrg_main.h:66:50: error: missing binary operator before token "("
   66 |          RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 4)))
      |                                                  ^
In file included from /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/ksyms/p_resolve_ksym.c:19:
/var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/ksyms/../../p_lkrg_main.h:66:50: error: missing binary operator before token "("
   66 |          RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 4)))
      |                                                  ^
In file included from /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/hashing/p_lkrg_fast_hash.c:22:
/var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/hashing/../../p_lkrg_main.h:66:50: error: missing binary operator before token "("
   66 |          RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 4)))
      |                                                  ^
make[1]: *** [scripts/Makefile.build:272: /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/hashing/p_lkrg_fast_hash.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:272: /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/ksyms/p_resolve_ksym.o] Error 1
make[1]: *** [scripts/Makefile.build:272: /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/comm_channel/p_comm_channel.o] Error 1
make[1]: *** [scripts/Makefile.build:272: /var/lib/dkms/lkrg/0.8.1+git20200804/build/src/modules/integrity_timer/p_integrity_timer.o] Error 1
make: *** [Makefile:1749: /var/lib/dkms/lkrg/0.8.1+git20200804/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.7.12-amd64'




Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.