From patchwork Tue Nov 28 08:57:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 119809 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1435035qgn; Tue, 28 Nov 2017 00:59:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMZqvBIhGVxQkNjlW7s+8ofSpF4bZ4uMOUJE4GBn+Pb2IA5Tf/0F7pg+IB2EFiFQYUfPxb4E X-Received: by 10.159.230.16 with SMTP id u16mr4266057plq.41.1511859543103; Tue, 28 Nov 2017 00:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511859543; cv=none; d=google.com; s=arc-20160816; b=NAoqoW6MokrCf1OoU9kSwKWhjcOM4nasAdIsOvFgOXxMmlYtKyRmHhvFDIvAydiisO tlDGyfrf/BL8S27XAxzNU5i9uvI4KEexgsHAPImY45CRJ6ZccRtWTphscgZxGdzDBjPR jifA3UvRV0vM4RD7GEUAZQXpUjYSkSw98zC0dhJPtOw+Z/2VCg1+7WTM1KlyVBGKla1a 1LvyR4sGb0P8ES+KM+/j7Mbt05poqqiv7OaIV7vj2DNqnQvrTCCYn0otHsDxdnZ83Cb6 9fg5sPDsjR2uApysInNMX8hXqUSybeOkR6sJRUsOaGSiJKeBT7N0jDXTribl/ZY5SYz/ xp2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=qx2UMYEijifIdnVKxb5647+X5hkT8XjT3frtbEzeqEA=; b=jU2iBIAkJCzH0CPyppbxu6P/WUnLS31+Z+Gzzi+tSHNUR0MfUZfygXKHdNd+jJRGoS YPT+kVbY7C5ZRt4xE6zVeuLe+ZzCBNrIScv8Z2TF41YjRvdzw2k377pLhVQOC9CLE//v Pi2YWfoESPVnWcNtX20avhplxMmtEaunV/nI//PBe5qmPP+XDiJTMvM+P78Z0IWoT3xS vcr62K3EQk0ll+eR6SuShKtWLJP8L1fQgzIQY3r2QyOyxeECqZgBuyTdaQZcjEqQUo4R KjoAdMrSRulnt4YMw/TJdK6ozTkrydVKNyjf+wpcyr2yk002xwb6AEOLJd2EC9JbubJd ZlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XrTz8d3e; spf=pass (google.com: domain of newlib-return-15377-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15377-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b3si24495873pgr.683.2017.11.28.00.59.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2017 00:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-15377-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XrTz8d3e; spf=pass (google.com: domain of newlib-return-15377-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15377-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=Bn+3FQD++JV/UpijQS6abV0hcT6QQp38TUdPaSzaoaZACEVU27Ie7 B3jYHDNHxmqjkUKqFuWEVFhhHmOhLVgQLB1gYa10ZPUy7hPUxrgHdh85hwX7i4Pv hSUpKQEQzgVcY6JrB6FTUxz7y3ohyDjMOIVCrchtlCwM9czExiQQTk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=MfBKGek2Et+Rrs8ilB1ehsTg+Lk=; b=XrTz8d3eLa4QM9lhb+QWjvI8qYIy YBdZPrsIr8U6uM2AJVVNbY3CrRkb/UJcA7W0cb8GGKAhToNLuOxfzrE9X5w27p93 wVH6ZFz5IWpQvy39x6QzHL2MnNR2+W2BH3FX9/BYNNd45JJyhsTtaeG+QW5EosBf y5mycD+aI55xbk8= Received: (qmail 83333 invoked by alias); 28 Nov 2017 08:58:31 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 81958 invoked by uid 89); 28 Nov 2017 08:58:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=BAYES_00, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 08:58:08 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0857E81DE1 for ; Tue, 28 Nov 2017 08:58:07 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-142.rdu2.redhat.com [10.10.120.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8436E5D753 for ; Tue, 28 Nov 2017 08:58:06 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH v3 0/9] Add Stack Smashing Protection and Object Size Checking Date: Tue, 28 Nov 2017 02:57:46 -0600 Message-Id: <20171128085755.5928-1-yselkowi@redhat.com> This has also been pushed to the topic/ssp branch. Yaakov Selkowitz (9): ssp: add APIs for Stack Smashing Protection ssp: add Object Size Checking common code ssp: add Object Size Checking for string.h functions ssp: add Object Size Checking for strings.h functions ssp: add Object Size Checking for stdio.h functions, part 1 ssp: add Object Size Checking for unistd.h functions, part 1 ssp: add build infrastructure cygwin: export SSP functions cygwin: create libssp compatibility import library newlib/Makefile.am | 4 + newlib/Makefile.in | 4 + newlib/libc/Makefile.am | 4 +- newlib/libc/Makefile.in | 15 +- newlib/libc/configure | 3 +- newlib/libc/configure.in | 2 +- newlib/libc/include/ssp/ssp.h | 72 ++++ newlib/libc/include/ssp/stdio.h | 83 ++++ newlib/libc/include/ssp/string.h | 114 ++++++ newlib/libc/include/ssp/strings.h | 55 +++ newlib/libc/include/ssp/unistd.h | 53 +++ newlib/libc/include/stdio.h | 6 + newlib/libc/include/string.h | 4 + newlib/libc/include/strings.h | 6 +- newlib/libc/include/sys/features.h | 18 +- newlib/libc/include/sys/unistd.h | 11 + newlib/libc/ssp/Makefile.am | 71 ++++ newlib/libc/ssp/Makefile.in | 714 +++++++++++++++++++++++++++++++++ newlib/libc/ssp/chk_fail.c | 13 + newlib/libc/ssp/fgets_chk.c | 55 +++ newlib/libc/ssp/gets_chk.c | 78 ++++ newlib/libc/ssp/memcpy_chk.c | 54 +++ newlib/libc/ssp/memmove_chk.c | 50 +++ newlib/libc/ssp/mempcpy_chk.c | 21 + newlib/libc/ssp/memset_chk.c | 49 +++ newlib/libc/ssp/snprintf_chk.c | 59 +++ newlib/libc/ssp/sprintf_chk.c | 63 +++ newlib/libc/ssp/stack_protector.c | 45 +++ newlib/libc/ssp/stpcpy_chk.c | 58 +++ newlib/libc/ssp/stpncpy_chk.c | 56 +++ newlib/libc/ssp/strcat_chk.c | 62 +++ newlib/libc/ssp/strcpy_chk.c | 55 +++ newlib/libc/ssp/strncat_chk.c | 73 ++++ newlib/libc/ssp/strncpy_chk.c | 55 +++ newlib/libc/ssp/vsnprintf_chk.c | 51 +++ newlib/libc/ssp/vsprintf_chk.c | 60 +++ winsup/cygwin/Makefile.in | 5 +- winsup/cygwin/common.din | 20 + winsup/cygwin/include/cygwin/version.h | 7 +- 39 files changed, 2215 insertions(+), 13 deletions(-) create mode 100644 newlib/libc/include/ssp/ssp.h create mode 100644 newlib/libc/include/ssp/stdio.h create mode 100644 newlib/libc/include/ssp/string.h create mode 100644 newlib/libc/include/ssp/strings.h create mode 100644 newlib/libc/include/ssp/unistd.h create mode 100644 newlib/libc/ssp/Makefile.am create mode 100644 newlib/libc/ssp/Makefile.in create mode 100644 newlib/libc/ssp/chk_fail.c create mode 100644 newlib/libc/ssp/fgets_chk.c create mode 100644 newlib/libc/ssp/gets_chk.c create mode 100644 newlib/libc/ssp/memcpy_chk.c create mode 100644 newlib/libc/ssp/memmove_chk.c create mode 100644 newlib/libc/ssp/mempcpy_chk.c create mode 100644 newlib/libc/ssp/memset_chk.c create mode 100644 newlib/libc/ssp/snprintf_chk.c create mode 100644 newlib/libc/ssp/sprintf_chk.c create mode 100644 newlib/libc/ssp/stack_protector.c create mode 100644 newlib/libc/ssp/stpcpy_chk.c create mode 100644 newlib/libc/ssp/stpncpy_chk.c create mode 100644 newlib/libc/ssp/strcat_chk.c create mode 100644 newlib/libc/ssp/strcpy_chk.c create mode 100644 newlib/libc/ssp/strncat_chk.c create mode 100644 newlib/libc/ssp/strncpy_chk.c create mode 100644 newlib/libc/ssp/vsnprintf_chk.c create mode 100644 newlib/libc/ssp/vsprintf_chk.c -- 2.15.0