Message ID | cover.1594974444.git.fweimer@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CCF23938C2D; Fri, 17 Jul 2020 08:30:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CCF23938C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594974604; bh=SJ8b3/KDjerrUoV391zdM2EjepbHzb+x1e57l4xAMNs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xlg90z/83A5sn0f224dvmChOBX4aUTrDvI8AIChCKU79ZzAj4sHp2TUYtAXn9yrOR fO5d86IFWEvBPGdrAmkQXFus+qgs5RIeDLJs6OVWiExJ323tK7+ntx7yjYqsVZq4fD CzPTLLZEAdGtTToyST2VeZkZntRwJgpHZYPjH6v4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 <libc-alpha@sourceware.org>; 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 <libc-alpha@sourceware.org>; 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 <libc-alpha@sourceware.org>; Fri, 17 Jul 2020 08:29:57 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 00/11] Fix fgetsgent_r data corruption bug (20338) Message-Id: <cover.1594974444.git.fweimer@redhat.com> 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 <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Florian Weimer <fweimer@redhat.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
Fix fgetsgent_r data corruption bug (20338)
|
|
Message
Florian Weimer
July 17, 2020, 8:29 a.m. UTC
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.h> 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
Comments
On 7/17/20 4:29 AM, Florian Weimer via Libc-alpha wrote: > 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. OK for 2.32. Thanks for undertaking the refactor and the fix. The end result looks much better than the existing code and uses a lot of the same functionality but just organized better. I tested on x86_64 and i686 also and I didn't see any failures. Thanks for testing under valgrind which is also important. This series is OK for 2.32 to fix the underlying bug 20338 which has started to get visibility as it impacts systemd users. > 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.h> > 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 >