From patchwork Mon Feb 18 23:23:04 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: 10818945 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 43E491399 for ; Mon, 18 Feb 2019 23:24:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EB992B74D for ; Mon, 18 Feb 2019 23:24:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21F162B7DC; Mon, 18 Feb 2019 23:24: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 5ECA22B74D for ; Mon, 18 Feb 2019 23:24:32 +0000 (UTC) Received: (qmail 26544 invoked by uid 550); 18 Feb 2019 23:24:20 -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 26459 invoked from network); 18 Feb 2019 23:24:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=FNg57b3mZQ18XqGRkwxeXlfXTue/1VAjFPcRQ/di6iA=; b=HkFG0q7f Pu0O2WG+TdH1jEASZUAmFu1oOySZ7YTFPwGO/sywuOaU89tP18BFzlCaINLXDk1Z rQmyGGsE5acxTw4ANliQQ4FhEwqWhIvfyi55XOxZXdm3ryfBMSw0PEXXJ/+VeIcl 95vAzRzSrD+C4C6ooGbxCjhLP5Fd0Wtl5syu+4bnF/aDdyL4EHZzu7yK973Q02Sm 5eoiUjsBpPlNzU4Muy1t3f/FSwaDHliQ50YB5fuffy2Aw3TB2A3sh4OnxjIJrZyD bFJNKgAui4sW92LfSmzTKCvZDplh3etucmrYKgcJ9PqMlRKeYndVRbdBfk116WPU qWTrR67bBJDhQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtddvgddtjeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpedfvfhosghi nhcuvedrucfjrghrughinhhgfdcuoehtohgsihhnsehkvghrnhgvlhdrohhrgheqnecukf hppeduvddurdeggedrvddtvddrudeftdenucfrrghrrghmpehmrghilhhfrhhomhepthho sghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: From: "Tobin C. Harding" To: Kees Cook Cc: "Tobin C. Harding" , Shuah Khan , Alexander Shishkin , Greg Kroah-Hartman , Andy Shevchenko , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] lib/string: Fix erroneous 'overflow' documentation Date: Tue, 19 Feb 2019 10:23:04 +1100 Message-Id: <20190218232308.11241-3-tobin@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218232308.11241-1-tobin@kernel.org> References: <20190218232308.11241-1-tobin@kernel.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Current documentation uses 'overflow' to describe a situation where less data is written to a buffer than buffer size not more. 'overflow' is the wrong word here - since we don't typically say 'underflow' change the whole sentence. Fix erroneous 'overflow' documentation for under filled buffer. Signed-off-by: Tobin C. Harding --- lib/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/string.c b/lib/string.c index 38e4ca08e757..7f1d72db53c5 100644 --- a/lib/string.c +++ b/lib/string.c @@ -173,8 +173,8 @@ EXPORT_SYMBOL(strlcpy); * * Preferred to strncpy() since it always returns a valid string, and * doesn't unnecessarily force the tail of the destination buffer to be - * zeroed. If the zeroing is desired, it's likely cleaner to use strscpy() - * with an overflow test, then just memset() the tail of the dest buffer. + * zeroed. If the zeroing is desired, it's likely cleaner to use strscpy(), + * check the return size, then just memset() the tail of the dest buffer. */ ssize_t strscpy(char *dest, const char *src, size_t count) {