From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 2C5BA3938C2D for ; Fri, 17 Jul 2020 08:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2C5BA3938C2D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-7BKmNR6qN0eVXRho14ZXNw-1; Fri, 17 Jul 2020 04:29:58 -0400 X-MC-Unique: 7BKmNR6qN0eVXRho14ZXNw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 207C7107ACCA for ; Fri, 17 Jul 2020 08:29:58 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-136.ams2.redhat.com [10.36.112.136]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 999405C298 for ; Fri, 17 Jul 2020 08:29:57 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 00/11] Fix fgetsgent_r data corruption bug (20338) Message-Id: Date: Fri, 17 Jul 2020 10:29:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 08:30:02 -0000 We have recently seen an uptick in reports of this bug. The __libc_readline_unlocked removal and the nss_compat mmap fix for bug 26258 could potentially be dropped from this series. Tested on i686-linux-gnu. I verified that the test case crashes with glibc 2.31 on both i686 and x86-64, and not just results in failures under valgrind. Thanks, Florian Florian Weimer (11): nss_files: Consolidate file opening in __nss_files_fopen nss_compat: Do not use mmap to read database files (bug 26258) nss_files: Consolidate line parse declarations in nss_files: Use generic result pointer in parse_line libio: Add fseterr_unlocked for internal use nss: Add __nss_fgetent_r grp: Implement fgetgrent_r using __nss_fgetent_r gshadow: Implement fgetsgent_r using __nss_fgetent_r (bug 20338) pwd: Implement fgetpwent_r using __nss_fgetent_r shadow: Implement fgetspent_r using __nss_fgetent_r libio: Remove __libc_readline_unlocked grp/fgetgrent_r.c | 54 +------ gshadow/Makefile | 2 +- gshadow/fgetsgent_r.c | 41 +---- gshadow/tst-fgetsgent_r.c | 192 +++++++++++++++++++++++ include/grp.h | 6 - include/gshadow.h | 6 - include/netdb.h | 13 -- include/netinet/ether.h | 6 - include/nss_files.h | 84 ++++++++++ include/pwd.h | 6 - include/rpc/netdb.h | 6 - include/shadow.h | 6 - include/stdio.h | 20 +-- libio/Makefile | 4 +- libio/Versions | 1 - libio/readline.c | 170 --------------------- libio/tst-readline.c | 237 ----------------------------- nss/Makefile | 4 +- nss/Versions | 1 + nss/nss_compat/compat-grp.c | 6 +- nss/nss_compat/compat-initgroups.c | 6 +- nss/nss_compat/compat-pwd.c | 6 +- nss/nss_compat/compat-spwd.c | 6 +- nss/nss_fgetent_r.c | 55 +++++++ nss/nss_files/files-XXX.c | 82 ++++------ nss/nss_files/files-alias.c | 5 +- nss/nss_files/files-initgroups.c | 6 +- nss/nss_files/files-netgrp.c | 5 +- nss/nss_files/files-parse.c | 6 +- nss/nss_files_fopen.c | 47 ++++++ nss/nss_parse_line_result.c | 46 ++++++ nss/nss_readline.c | 99 ++++++++++++ pwd/fgetpwent_r.c | 43 +----- shadow/fgetspent_r.c | 43 +----- 34 files changed, 609 insertions(+), 711 deletions(-) create mode 100644 gshadow/tst-fgetsgent_r.c create mode 100644 include/nss_files.h delete mode 100644 libio/readline.c delete mode 100644 libio/tst-readline.c create mode 100644 nss/nss_fgetent_r.c create mode 100644 nss/nss_files_fopen.c create mode 100644 nss/nss_parse_line_result.c create mode 100644 nss/nss_readline.c -- 2.26.2