From: "Ludovic Courtès" <ludo@gnu.org>
To: 46330@debbugs.gnu.org
Subject: bug#46330: Guile-provided GMP allocators interfere with GnuTLS
Date: Fri, 05 Feb 2021 17:59:51 +0100 [thread overview]
Message-ID: <87v9b61md4.fsf@inria.fr> (raw)
Fellow Debian hackers identified a bug causing memory corruption in
Nettle data structures used by GnuTLS when GnuTLS is used from Guile:
https://bugs.debian.org/964284
In a nutshell, Guile installs its own GMP memory allocation routines
(when ‘scm_install_gmp_memory_functions’ is true, which is the default)
so that GMP allocates via libgc. GnuTLS uses Nettle, which uses GMP, so
Nettle too ends up allocating via libgc; however, since pointers to that
memory are not scanned by libgc, they end up being reclaimed early.
In practice, memory corruption is relatively rare, to the point that we
did not notice it in Guix. In Debian, it would lead to a failure of the
‘tests/reauth.scm’ test in GnuTLS. With minor modifications to the
test, as noted in the thread above, I can reproduce it on Guix as well.
The thread above mentions possible workaround, but there’s nothing
satisfactory.
The longer-term solution is to use mini-GMP in Guile (which is also nice
as a way to reduce dependencies).
To be continued…
Ludo’.
next reply other threads:[~2021-02-05 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 16:59 Ludovic Courtès [this message]
2021-02-05 17:13 ` bug#46330: Guile-provided GMP allocators interfere with GnuTLS Ludovic Courtès
2021-02-07 22:47 ` Ludovic Courtès
2021-05-23 14:47 ` Marius Bakke
2021-05-25 20:19 ` Ludovic Courtès
2021-02-07 21:24 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9b61md4.fsf@inria.fr \
--to=ludo@gnu.org \
--cc=46330@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).