This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Usage of C11 Annex K Bounds-checking interfaces on GCC
- From: li zi <luburyana at hotmail dot com>
- To: "gcc-info at gcc dot gnu dot org" <gcc-info at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 10 Dec 2019 03:15:13 +0000
- Subject: Usage of C11 Annex K Bounds-checking interfaces on GCC
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OH+RarixJxOXxCpNa7sPOM5b6WybETWrnigfzPCaoQE=; b=UWQCSI+36I4mkJI8KD73qcy1IgpaOHfN3EjzwU3iFn/ZMlNeKwbmC5twGSrmNiDdIckETxtL2+hGuLMkRwOB6PZqTnqo8UtEF7q6IPv4L9sPU8qxFDIsVzAs4ITmstltyOFpczrqDBhQ7mBTc91iSNpZjkKv2YCiwSbIEINn5BNUz6mp0MbIZOncpH/gypUb++5lqC5KJ6jrtJWKmECndMY5fQEF21njMW2fwDXwtLYxIVtR7HsioJKRPI2HJm9xkKfywKbao0GyA3NmgaDXfA73PEnQBNegs/+7JN3+64bF4Uc7FXfws/Vi39AfOcDFEKtO2/368EHaca1Am4iwpg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LiqdSokbrJTVnRYRwPRiSVpYM2mi84nZwMblImeBQ+11oaF5cH5Ux25j+6eAXNdZf/JbV9zcTMhyo72MaCwUM7vvP9X76OFeHsM5HDUf+y8arY9JwU9Jn8ZtokW44ETFrkHwR7PCRa21cJMbFbTtTiaevfhx7DobGpg0gR4OTo2mPxGE1TkxGbSLrt7vrhtYtJgcxPEBG2/ZfFIU6qMdx2FTLKIqmwL6gj92/B1RSaWW08SxQP5oOkbyzDHxfA9Rp2FGhH0mSgiNOzzMpGWpTudi64L2M+iu4C9+9hSOtmJCMawVvXr28drwhAKgxmoUU7cqlrxf8xCMuu8F9/9nkQ==
Hi All,
We are using gcc in our projects and we found some of the C standard functions (like memcpy, strcpy) used in gcc may induce security vulnerablities like buffer overflow. Currently we have not found any instances which causes such issues.
But we feel better to change these calls to Cll Annex K Bounds-checking interfaces like memcpy_s, strcpy_s etc. By defining a secure calls method (list of func pointers) and allowing application to register the method. I understand that this affects performance because of return value check added for xxxx_s calls, but this will relieve overflow kind of issues from code. And also currently using bounds-checking interfaces is a general industry practice.
Please share your opinion on it, and if any discussion happened in community to do some changes in future.
Thanks.
获取 Outlook for Android<https://aka.ms/ghei36>