From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id CC9A8385841A; Wed, 22 Nov 2023 07:40:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC9A8385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700638832; bh=FHlmhuq8QdmENyRdns1mV43KAAW2fX1yPSM8U5e9FUg=; h=From:To:Subject:Date:From; b=CmrGvI9oEmj2tuoAJCrdcBzfXDoJ8ayqrmMePWHF0JTuiAP382+KwRBUGcQ/wx4+s krRtGv9VdDOObkYASmb7DC9xLv0hQ6wWaA5DI0QSxymnWWUgYS6aCMx29WlVhsPYrw AtwPq2PxzZSlJTVyml/AQ978NACmc0Pcil2/4N9Y= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] posix: Revert the removal of the crypt prototype from X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 780c33920281c5d5cc42a1e578bdc9218e675405 X-Git-Newrev: 5d7f1bce7d8eea31f4baeb68bcc3124b35acc751 Message-Id: <20231122074032.CC9A8385841A@sourceware.org> Date: Wed, 22 Nov 2023 07:40:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d7f1bce7d8eea31f4baeb68bcc3124b35acc751 commit 5d7f1bce7d8eea31f4baeb68bcc3124b35acc751 Author: Florian Weimer Date: Wed Nov 22 08:38:33 2023 +0100 posix: Revert the removal of the crypt prototype from Many applications still rely on this prototype. Rebuilds without this prototype result in an implicit function declaration, which can introduce security vulnerabilities due to 32-bit pointer truncation. Diff: --- NEWS | 5 ++++- posix/unistd.h | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 139cfef1b0..8c1c149f91 100644 --- a/NEWS +++ b/NEWS @@ -52,7 +52,10 @@ Deprecated and removed features, and other changes affecting compatibility: * libcrypt has been removed from the GNU C Library. The configure options "--enable-crypt" and "--enable-nss-crypt" are no longer available. , libcrypt.a, and libcrypt.so.1 will not be - installed, and will not declare the crypt function. + installed. For now continues to declare the crypt + function by default, to avoid introducing vulnerabilities into + existing applications due to a missing prototype. This declaration + is deprecated and may be removed in a future glibc release. The replacement for libcrypt is libxcrypt, maintained separately from GNU libc, but available under compatible licensing terms, and providing diff --git a/posix/unistd.h b/posix/unistd.h index 1f9cd8cbf0..5b91ad4aaa 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -1150,6 +1150,19 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff, extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ +#ifdef __USE_MISC +/* One-way hash PHRASE, returning a string suitable for storage in the + user database. SALT selects the one-way function to use, and + ensures that no two users' hashes are the same, even if they use + the same passphrase. The return value points to static storage + which will be overwritten by the next call to crypt. + + This declaration is deprecated; applications should include + instead. */ +extern char *crypt (const char *__key, const char *__salt) + __THROW __nonnull ((1, 2)); +#endif + #ifdef __USE_XOPEN /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the