From patchwork Mon Feb 25 04:15:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10828217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 111061805 for ; Mon, 25 Feb 2019 04:16:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8AF62ABE9 for ; Mon, 25 Feb 2019 04:16:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D72932ABF0; Mon, 25 Feb 2019 04:16:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id D97DF2ABE9 for ; Mon, 25 Feb 2019 04:16:32 +0000 (UTC) Received: (qmail 27880 invoked by uid 550); 25 Feb 2019 04:16:29 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 27849 invoked from network); 25 Feb 2019 04:16:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ruUSGtR9etN4YTUqd 6RCSzMhjpzc44SJj9Bq253ykjs=; b=xuLBIB5twd+RtqIWIY571Alp7DNgml6Ji TxEd5E+1POVcIc0gPdE49LizOptqR2Kw52WmDO6aN9GO5wxXGtv8wPquP3NFTA6K BtmGWAU6QkQhcQ/3122nv7j/I4KbwmqCTfhWUvvlSxHB/I9S6mbkhLiKzN/hg4va VSngUX6P2KCTtoAmctOmwRK8ur7tEaa0eT/Leyd0I0J8L+zUps92l/HgbznBOe5d ElX7SMzxWVdgtXk0wKgW5g54ZSw/A4AwFG1XRAkq6cRzNG7YItx1uHvXQGGqgI1q y5ZfL3+FiyV0v2qiCpcJ8UXRq7BS5HrYgbKY+yqGSKwWoOGUTmqOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrudehgdeijeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghinhcu vedrucfjrghrughinhhgfdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecuffhomh grihhnpehlkhhmlhdrohhrghenucfkphepuddvgedrudegledruddvvddrfeenucfrrghr rghmpehmrghilhhfrhhomhepthhosghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsth gvrhfuihiivgeptd X-ME-Proxy: From: "Tobin C. Harding" To: Kees Cook Cc: "Tobin C. Harding" , Jann Horn , Andy Shevchenko , Randy Dunlap , Rasmus Villemoes , Stephen Rothwell , Andy Lutomirski , Daniel Micay , Arnd Bergmann , Miguel Ojeda , "Gustavo A. R. Silva" , Shuah Khan , Greg Kroah-Hartman , Alexander Shishkin , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/1] lib/string: Add strscpy_pad() function Date: Mon, 25 Feb 2019 15:15:33 +1100 Message-Id: <20190225041534.27186-1-tobin@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Hi, This patch set was formerly Subject: [PATCH 0/6] lib: Add safe string funtions[sic] And FTR can be seen here: https://lkml.org/lkml/2019/2/18/1428 The v1 patch set has been reduced to a single patch by dropping the strscpy_from_user() stuff and by rolling all the docs changes into the main patch as suggested. This patch adds the function strscpy_pad() named after consensus was reached on the v1 email thread (linked to above). Thanks to Kees for the extreme test case coverage. test_basic() is probably redundant but is left in for the benefit of any poor sucker who has to debug a regression using test_fully(). The test module is _not_ tied into kselftest. As discussed on v1, there are some issues with tools/testing/selftest/lib/ at the moment. I intend on working on those issues as suggested but it does not seem totally relevant to this patch so instead of slowing this one down with my poor knowledge of how kselftest works it seems better to do this separately. thanks for looking at this, Tobin. Tobin C. Harding (1): lib/string: Add strscpy_pad() function include/linux/string.h | 4 + lib/Kconfig.debug | 3 + lib/Makefile | 1 + lib/string.c | 47 +++++++++-- lib/test_strscpy.c | 175 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 223 insertions(+), 7 deletions(-) create mode 100644 lib/test_strscpy.c