lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Aug 2020 10:27:04 +0200
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     George Spelvin <lkml@....org>
Cc:     Amit Klein <aksecurity@...il.com>,
        Eric Dumazet <edumazet@...gle.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Andy Lutomirski <luto@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        netdev@...r.kernel.org, Willy Tarreau <w@....eu>
Subject: Re: [DRAFT PATCH] random32: make prandom_u32() output unpredictable

I run a perf session looks like this in my KDE/Plasma desktop-environment:

[ PERF SESSION ]

 1016  2020-08-13 09:57:24 echo 1 > /proc/sys/kernel/sched_schedstats
 1017  2020-08-13 09:57:24 echo prandom_u32 >>
/sys/kernel/debug/tracing/set_event
 1018  2020-08-13 09:57:24 echo traceon >
/sys/kernel/debug/tracing/events/random/prandom_u32/trigger
 1019  2020-08-13 09:57:25 echo 1 > /sys/kernel/debug/tracing/events/enable

 1020  2020-08-13 09:57:32 sysctl -n kernel.sched_schedstats
 1021  2020-08-13 09:57:32 cat /sys/kernel/debug/tracing/events/enable
 1022  2020-08-13 09:57:32 grep prandom_u32 /sys/kernel/debug/tracing/set_event
 1023  2020-08-13 09:57:33 cat
/sys/kernel/debug/tracing/events/random/prandom_u32/trigger

root# /home/dileks/bin/perf record -a -g -e random:prandom_u32 sleep 5

Simple-Test: Press F5 in Firefox in each opened tab (5 tabs in total)

root# /home/dileks/bin/perf report --no-children --stdio > /tmp/perf-report.txt

- Sedat -

[ perf-report.txt ]

# To display the perf.data header info, please use
--header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 273  of event 'random:prandom_u32'
# Event count (approx.): 273
#
# Overhead  Command          Shared Object      Symbol
# ........  ...............  .................  ...............
#
    27.47%  firefox-esr      [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

    13.19%  DNS Resolver #9  [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               |
               |--5.86%--__ip4_datagram_connect
               |          ip4_datagram_connect
               |          __sys_connect
               |          __x64_sys_connect
               |          do_syscall_64
               |          entry_SYSCALL_64_after_hwframe
               |          |
               |          |--4.40%--__libc_connect
               |          |          0x2c1
               |          |
               |           --1.47%--connect
               |                     PR_GetAddrInfoByName
               |
               |--2.93%--udp_lib_get_port
               |          inet_dgram_connect
               |          __sys_connect
               |          __x64_sys_connect
               |          do_syscall_64
               |          entry_SYSCALL_64_after_hwframe
               |          |
               |          |--2.20%--__libc_connect
               |          |          0x2c1
               |          |
               |           --0.73%--connect
               |                     PR_GetAddrInfoByName
               |
               |--2.20%--__ip_select_ident
               |          __ip_make_skb
               |          ip_make_skb
               |          udp_sendmsg
               |          __sys_sendto
               |          __x64_sys_sendto
               |          do_syscall_64
               |          entry_SYSCALL_64_after_hwframe
               |          __libc_send
               |
                --2.20%--netlink_autobind
                          netlink_bind
                          __sys_bind
                          __x64_sys_bind
                          do_syscall_64
                          entry_SYSCALL_64_after_hwframe
                          bind
                          getaddrinfo
                          PR_GetAddrInfoByName

    12.45%  FS Broker 7060   [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

     8.79%  FS Broker 6334   [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

     8.06%  FS Broker 7161   [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

     8.06%  FS Broker 7195   [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

     7.33%  FS Broker 7126   [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               shmem_mknod
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7a6f6d2e67726f2f

     7.33%  Socket Thread    [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               tcp_v4_connect
               __inet_stream_connect
               inet_stream_connect
               __sys_connect
               __x64_sys_connect
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __libc_connect

     4.40%  Cache2 I/O       [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               __ext4_new_inode
               ext4_create
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x61632e2f736b656c

     1.10%  Xorg             [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               __shmem_file_setup
               create_shmem
               i915_gem_object_create_region
               i915_gem_create_ioctl
               drm_ioctl_kernel
               drm_ioctl
               __se_sys_ioctl
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               ioctl

     0.73%  QSGRenderThread  [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               shmem_get_inode
               __shmem_file_setup
               create_shmem
               i915_gem_object_create_region
               i915_gem_create_ioctl
               drm_ioctl_kernel
               drm_ioctl
               __se_sys_ioctl
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               ioctl

     0.37%  DOM Worker       [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               __ext4_new_inode
               ext4_create
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x6f6d2e2f736b656c

     0.37%  cupsd            [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               __ext4_new_inode
               ext4_create
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x7263736275732f73

     0.37%  mozStorage #8    [kernel.kallsyms]  [k] prandom_u32
            |
            ---prandom_u32
               prandom_u32
               __ext4_new_inode
               ext4_create
               path_openat
               do_filp_open
               do_sys_openat2
               __x64_sys_openat
               do_syscall_64
               entry_SYSCALL_64_after_hwframe
               __open64
               0x6f6d2e2f736b656c



# Samples: 0  of event 'dummy:HG'
# Event count (approx.): 0
#
# Overhead  Command  Shared Object  Symbol
# ........  .......  .............  ......
#


#
# (Tip: Print event counts in CSV format with: perf stat -x,)
#

- EOF -

Powered by blists - more mailing lists