public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gjduck at gmail dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug nss/30626] New: Empty passwd service line causes getpwuid() to crash (SEGV) Date: Tue, 11 Jul 2023 04:16:24 +0000 [thread overview] Message-ID: <bug-30626-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=30626 Bug ID: 30626 Summary: Empty passwd service line causes getpwuid() to crash (SEGV) Product: glibc Version: 2.37 Status: UNCONFIRMED Severity: normal Priority: P2 Component: nss Assignee: unassigned at sourceware dot org Reporter: gjduck at gmail dot com Target Milestone: --- Created attachment 14960 --> https://sourceware.org/bugzilla/attachment.cgi?id=14960&action=edit getpwuid.c Configuring "passwd" with an empty service line seems to cause getpwuid() to crash: __nss_configure_lookup("passwd", ""); struct passwd *pw = getpwuid(uid); // <---- SEGV See the attached PoC, tested with glibc-2.37 (latest dev head) on Ubuntu 23.04. The steps to reproduce: $ gcc -o getpwuid getpwuid.c $ ./getpwuid Segmentation fault The same bug also can be induced by udpating "passwd" in /etc/nsswitch.conf with an empty service line: # /etc/nsswitch.conf ... passwd: However, testing using this method risks bricking your system. -- You are receiving this mail because: You are on the CC list for the bug.
reply other threads:[~2023-07-11 4:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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 * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-30626-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).