Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 11 Jun 2020 20:16:29 +0200
From: Adam Zabrocki <pi3@....com.pl>
To: lkrg-users@...ts.openwall.com
Subject: Re: RE: ISRA optimized functions

On Thu, Jun 11, 2020 at 08:04:52PM +0200, Mikhail Morfikov wrote:
> On 11/06/2020 19:59, Adam Zabrocki wrote:
> > On Thu, Jun 11, 2020 at 07:29:33PM +0200, Mikhail Morfikov wrote:
> >> On 11/06/2020 18:44, Adam Zabrocki wrote:
> >>> Hi,
> >>>
> >>> On Wed, Jun 10, 2020 at 09:18:44AM +0200, Mikhail Morfikov wrote:
> >>>> I just tested and:
> >>>>
> >>>> # cat /proc/version
> >>>> Linux version 5.7.1-amd64 (morfik@...fikownia) (gcc version 10.1.0 (Debian 10.1.0-3), GNU ld (GNU Binutils for Debian) 2.34) #3 SMP PREEMPT Wed Jun 10 07:21:29 CEST 2020
> >>>>
> >>>> # dkms status
> >>>> lkrg, 0.7+git20200609, 5.7.1-amd64, x86_64: installed
> >>>>
> >>>> # modprobe -v p_lkrg
> >>>> insmod /lib/modules/5.7.1-amd64/updates/dkms/p_lkrg.ko
> >>>>
> >>>> # lsmod
> >>>> Module                  Size  Used by
> >>>> p_lkrg                225280  0
> >>>>
> >>>> In the syslog I have the following messages now:
> >>>>
> >>>> kernel: p_lkrg: loading out-of-tree module taints kernel.
> >>>> kernel: [p_lkrg] Loading LKRG...
> >>>> kernel: [p_lkrg] System does NOT support SMAP. LKRG can't enforce SMAP validation :(
> >>>> kernel: Freezing user space processes ... (elapsed 0.031 seconds) done.
> >>>> kernel: OOM killer disabled.
> >>>> kernel: [p_lkrg] 8/23 UMH paths were whitelisted...
> >>>> kernel: [p_lkrg] [kretprobe] register_kretprobe() for <lookup_fast> failed! [err=-22]
> >>>> kernel: [p_lkrg] Trying to find ISRA name for <lookup_fast>
> >>>> kernel: [p_lkrg] ISRA version not found!
> >>>> kernel: [p_lkrg] LKRG won't enforce pCFI validation on 'lookup_fast'
> >>>> kernel: [p_lkrg] LKRG initialized successfully!
> >>>> kernel: OOM killer enabled.
> >>>> kernel: Restarting tasks ... done.
> >>>>
> >>>> So what to do with this *lookup_fast* ?
> >>>>
> >>>
> >>> It is not critical hook,  that's why LKRG continue initialization. If you have 
> >>> set log_level=3 then you should see an extra message printing such information.
> >>> However, can you please run the following command and provide the result?
> >>>
> >>> # cat /proc/kallsyms|grep lookup_fast
> >>>
> >>> I'm just curious
> >>
> >> Here it is:
> >>
> >> # cat /proc/kallsyms|grep lookup_fast
> >> ffffffffa16f05d0 t lookup_fast.constprop.0
> > 
> > You compiler enforced constprop optimization on that function. You can manually 
> > replace the name of lookup_fast to lookup_fast.constprop.0 and it will work 
> > fine. This function is ISRA safe and should CONSTPROP safe as well.
> > 
> > 
> >> ffffffffa2202580 t nft_hash_lookup_fast
> >> ffffffffc019a026 t p_pcfi_lookup_fast_entry.cold        [p_lkrg]
> >> ffffffffc01b3520 d p_pcfi_lookup_fast_kretprobe [p_lkrg]
> >> ffffffffc0191db0 t p_pcfi_lookup_fast_ret       [p_lkrg]
> >> ffffffffc0191fa0 t p_install_pcfi_lookup_fast_hook      [p_lkrg]
> >> ffffffffc0191dc0 t p_pcfi_lookup_fast_entry     [p_lkrg]
> >> ffffffffc0191fd0 t p_uninstall_pcfi_lookup_fast_hook    [p_lkrg]
> >> ffffffffc01bad74 b p_pcfi_lookup_fast_kretprobe_state   [p_lkrg]
> >>
> > 
> > 
> > 
> > 
> I didn't change anything -- it's the default gcc10 config in Debian Sid. 
> I just moved from gcc9->gcc10.
> 

I meant "your compiler". You must have enabled optimization flag during 
compilation (-02? -03?). However, as I mentioned you can manually replace the 
name of lookup_fast to lookup_fast.constprop.0 and it will work fine. This 
function is ISRA safe and should CONSTPROP safe as well.



-- 
pi3 (pi3ki31ny) - pi3 (at) itsec pl
http://pi3.com.pl

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.