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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiYvRqYYCi3Wcq==Y7Zg_i9u-04sk4BtXrP03txZ0yzww@mail.gmail.com>
Date: Tue, 28 Oct 2025 12:12:38 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Christian Brauner <brauner@...nel.org>, Jens Axboe <axboe@...nel.dk>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, David Laight <david.laight.linux@...il.com>, 
	Eric Dumazet <edumazet@...gle.com>, Kuniyuki Iwashima <kuni1840@...il.com>, linux-kernel@...r.kernel.org, 
	Dave Hansen <dave.hansen@...el.com>
Subject: Re: [PATCH v2] epoll: Use user_write_access_begin() and
 unsafe_put_user() in epoll_put_uevent().

 On Tue, 28 Oct 2025 at 12:02, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Because I think the proper patch should look something like the
> attached.. For me, that generates
>
>         movabs $0x123456789abcdef,%rcx
>         cmp    %rcx,%r15
>         cmova  %rcx,%r15
>         stac
>         mov    %r12d,(%r15)
>         mov    %rax,0x4(%r15)
>         clac
>
> which honestly should be pretty much optimal.

Side note: when I say "pretty much optimal", the truly optimal
situation would be to do the address masking entirely outside the loop
in ep_send_events(), but we don't expose that interface, and we have
absolutely horrible experiences with doing user address checking
separately from the actual code that does the access, so I'm really
loathe to add that kind of logic.

So the above is *not* optimal in the sense that the

        movabs $0x123456789abcdef,%rcx
        cmp    %rcx,%r15
        cmova  %rcx,%r15

part certainly *could* be done outside the list_for_each_entry_safe()
loop in ep_send_events(), but I do not think that three simple
ALU-only instructions should make a difference here.

              Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ