From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92002 invoked by alias); 17 Jan 2020 14:04:54 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 91947 invoked by uid 89); 17 Jan 2020 14:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=__pid_t X-Spam-Status: No, score=-18.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2020 14:04:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579269880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u255Z6W8zFUXQ+Yle3cgF/GhqPq6ew1AEWgVloF62QY=; b=a7MOyCQoGMbpr089xreK179VaRNmHYcWr3aZYjLTYO18c2dXTHGShQoe5Lifg7GYzQruqY X+qffP4fHlqHqRXuR9CloMkbDsKaRZU915J3kUfw4bTvZ/SC50k3rmtT5Ec93+CkRark8D ZXP4CF3/8dM/LLhBLpIMYYG+3KB1jw4= 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-365-xC5MLvsRNg-ifG3JlYdZMA-1; Fri, 17 Jan 2020 09:04:39 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45858800D41 for ; Fri, 17 Jan 2020 14:04:38 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-117-165.ams2.redhat.com [10.36.117.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9B5D81212 for ; Fri, 17 Jan 2020 14:04:37 +0000 (UTC) Received: by oldenburg2.str.redhat.com (Postfix, from userid 1000) id 684468299EE3; Fri, 17 Jan 2020 15:04:36 +0100 (CET) Date: Wed, 01 Jan 2020 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.30 COMMITTED] login: Add nonstring attributes to struct utmp, struct utmpx [BZ #24899] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20200117140436.684468299EE3@oldenburg2.str.redhat.com> From: Florian Weimer X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: xC5MLvsRNg-ifG3JlYdZMA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00005.txt.bz2 Commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c ("The -Wstringop-truncation option new in GCC 8 detects common misuses") added __attribute_nonstring__ to bits/utmp.h, but it did not update the parallel bits/utmpx.h header. In struct utmp, the nonstring attribute for ut_id was missing. (cherry picked from commit c2adefbafcdd2519ff43eca6891c77cd7b29ab62) 2019-08-15 Florian Weimer [BZ #24899] * sysdeps/gnu/bits/utmpx.h (struct utmpx): Add __attribute_nonstring__ to ut_line, ut_id, ut_user, ut_host. * sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmpx): Likewise. * sysdeps/gnu/bits/utmp.h (struct utmp): Add __attribute_nonstring__ to ut_id. * sysdeps/unix/sysv/linux/s390/bits/utmpx.h (struct utmp): Likewise. diff --git a/NEWS b/NEWS index b0ab63a83b..ae6c815515 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ The following bugs are resolved with this release: [24880] login: Use struct flock64 in utmp [24986] alpha: new getegid, geteuid and getppid syscalls used unconditionally + [24899] login: Add nonstring attributes to struct utmp, struct utmpx [24902] login: pututxline could fail to overwrite existing entries [25189] Don't use a custom wrapper macro around __has_include [25203] libio: Disable vtable validation for pre-2.1 interposed handles diff --git a/bits/utmp.h b/bits/utmp.h index 3c02dd4f3f..854b342164 100644 --- a/bits/utmp.h +++ b/bits/utmp.h @@ -61,7 +61,8 @@ struct utmp pid_t ut_pid; /* Process ID of login process. */ char ut_line[UT_LINESIZE] __attribute_nonstring__; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ char ut_user[UT_NAMESIZE] __attribute_nonstring__; /* Username. */ char ut_host[UT_HOSTSIZE] diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h index 472a7d57d3..2beadbf587 100644 --- a/sysdeps/gnu/bits/utmpx.h +++ b/sysdeps/gnu/bits/utmpx.h @@ -56,10 +56,14 @@ struct utmpx { short int ut_type; /* Type of login. */ __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE]; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE]; /* Username. */ - char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ + char ut_line[__UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[__UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h index 862115c6f8..0569c3b784 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h +++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h @@ -61,7 +61,8 @@ struct utmp pid_t ut_pid; /* Process ID of login process. */ char ut_line[UT_LINESIZE] __attribute_nonstring__; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ char ut_user[UT_NAMESIZE] __attribute_nonstring__; /* Username. */ char ut_host[UT_HOSTSIZE] diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h index ea3e860a2d..737d9dca05 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h +++ b/sysdeps/unix/sysv/linux/s390/bits/utmpx.h @@ -56,10 +56,14 @@ struct utmpx { short int ut_type; /* Type of login. */ __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE]; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE]; /* Username. */ - char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ + char ut_line[__UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[__UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */