Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 19 Mar 2024 14:25:35 +0100
From: Matthias Apitz <guru@...xarea.de>
To: yescrypt@...ts.openwall.com
Subject: yescrypt && mmap(,,,,MAP_HUGETLB) && oom-kill


Hello,

Our C-written application server are using yescrypt from the libc of the
SuSE SLES 15 Linux OS to crypt or check provided password from the
library patrons. This works all fine.

When the servers are stressed by automated test systems, we encounter the
following situation (and it took us some days of debuging with GDB to
understand that the crash is while the C-function
crypt(clear-pw, hash-of-clearpw) gets executed, because we suspected
first our own code and then the PostgreSQL database layer):

A bad example looks like this in strace: the server gets killed by SIGKILL,
from the oom-kill (as logs in /var/log/messages):

11:24:13.133548 sendto(3, "Q\0\0\0\25fetch d02ben_seq\0", 22, MSG_NOSIGNAL, NULL, 0) = 22 <0.000024>
11:24:13.133960 recvfrom(3, "T\0\0\21\275\0\246ctid\0\0007]\343\377\377\0\0\0\33\0\6\377\377\377\377\0\0d0"..., 16384, 0, NULL, NULL) = 5986 <0.000016>
11:24:13.134111 recvfrom(3, 0x22b7e80, 16384, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable) <0.000013>
11:24:13.136472 mmap(NULL, 1075838976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = -1 ENOMEM (Cannot allocate memory) <0.000053>
11:24:13.136579 mmap(NULL, 1073766464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fadab8ad000 <0.000016>
11:24:14.607035 +++ killed by SIGKILL +++

a "good" example where the server survives is here executing the same
code:

29319 sendto(3, "Q\0\0\0\25fetch d02ben_seq\0", 22, MSG_NOSIGNAL, NULL, 0) = 22
29319 poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
29319 recvfrom(3, "T\0\0\21\275\0\246ctid\0\0007]\343\377\377\0\0\0\33\0\6\377\377\377\377\0\0d0"..., 16384, 0, NULL, NULL) = 5964
29319 recvfrom(3, 0x22d7be0, 16384, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
29319 mmap(NULL, 1075838976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = -1 ENOMEM (Cannot allocate memory)
29319 mmap(NULL, 1073766464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa0acaad000
29319 munmap(0x7fa0acaad000, 1073766464) = 0
29319 write(2, "SRP-22658: SRVOpacBenutzerPruefu"..., 150) = 150

What does this mean exactly and how this can be avoided to crash our
servers in production?

Thanks

	matthias


-- 
Matthias Apitz, ✉ guru@...xarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

I am not at war with Russia.
Я не воюю с Россией.
Ich bin nicht im Krieg mit Russland.

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.