From patchwork Fri Oct 2 11:15:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 8911 Received: (qmail 96707 invoked by alias); 2 Oct 2015 11:15:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 96698 invoked by uid 89); 2 Oct 2015 11:15:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 2 Oct 2015 11:15:07 +0000 From: Joseph Myers To: Florian Weimer CC: Carlos O'Donell , GNU C Library Subject: Re: [PATCH] Harden put*ent functions against data injection [BZ #18724] In-Reply-To: <560E5096.3040306@redhat.com> Message-ID: References: <55B64BE2.9060905@redhat.com> <55B68DBE.2050009@redhat.com> <560E5096.3040306@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 i386 build fixed thus. Committed. Fix i386 build after put*ent hardening changes. The recent put*ent hardening changes broke the build for i386. i386 defines internal_function to __attribute__ ((regparm (3), stdcall)), which affects type compatibility, so requiring internal_function to be used consistently on declarations and definitions. This patch adds internal_function to the definitions of the new functions using it on their declarations. Tested for i386 that this fixes the build. 2015-10-02 Joseph Myers * nss/rewrite_field.c (__nss_rewrite_field): Use internal_function. * nss/valid_field.c (__nss_valid_field): Likewise. * nss/valid_list_field.c (__nss_valid_list_field): Likewise. diff --git a/nss/rewrite_field.c b/nss/rewrite_field.c index fb9d274..2535457 100644 --- a/nss/rewrite_field.c +++ b/nss/rewrite_field.c @@ -24,6 +24,7 @@ overwritten with a pointer the caller has to free if the function returns successfully. On failure, return NULL. */ const char * +internal_function __nss_rewrite_field (const char *value, char **to_be_freed) { *to_be_freed = NULL; diff --git a/nss/valid_field.c b/nss/valid_field.c index 5fcddc5..061c121 100644 --- a/nss/valid_field.c +++ b/nss/valid_field.c @@ -24,6 +24,7 @@ const char __nss_invalid_field_characters[] = NSS_INVALID_FIELD_CHARACTERS; does not contain characters not permitted in NSS database fields. */ _Bool +internal_function __nss_valid_field (const char *value) { return value == NULL diff --git a/nss/valid_list_field.c b/nss/valid_list_field.c index 98ab93b..80ab12b 100644 --- a/nss/valid_list_field.c +++ b/nss/valid_list_field.c @@ -24,6 +24,7 @@ static const char invalid_characters[] = NSS_INVALID_FIELD_CHARACTERS ","; /* Check that all list members match the field syntax requirements and do not contain the character ','. */ _Bool +internal_function __nss_valid_list_field (char **list) { if (list == NULL)