From nobody Sun Sep 24 15:49:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rtr6p4r0Kz4v7SG; Sun, 24 Sep 2023 15:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rtr6p3pGFz3KsX; Sun, 24 Sep 2023 15:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695570594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+JEAyoCCKNlpeOjB9CVDL41N3YgFEVjX+7Ufdw0Y5o=; b=Oc5HputFS+8DFeS10unPwBkGuIsfbmIRMq6CsDI6POgSl/lsXx9l4C+prdBF4BQf/r35C8 uTNlMyeaYg7MgkS4p9aYABa7kdZ93Q8rTk+rCs91JfY0GtOQ2dxOU60RQDG6kJH5Cicjme P3ITsmeYEuLXgtt8dF5zR72lmfA64wvgpFaROd4xqAgwKu9oiBIuwaSPUJLEpSPemmgeZ8 16K3N5eQVnFxh17FkveveDmGyQL09sFuzZdiAsFcK1T7j2wLVscTLEfNqadyX9B42KUjUm g9R+2xsdOTGCILvDiAZx8vRUHilAjZs0X+JvE7bEy6sbDH4REpAk9vqvvNkM+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695570594; a=rsa-sha256; cv=none; b=SF1AgkUuyGj/7ectbOOfVKiJhi29AcCjON40WsKUbRVLJoSIB+xKmetpLX65TM6c41zzBe +3cYVEZ4Gltf44vaT/CBPEP6DQQUSHAMMCUM5m4RvphNzJYlrS1o1wKfUO2WAfy0Wddswm cziP0qA1J6NDjCTq6oVZzwIhDGhamW/FLWTzF20tDvak1/g7JlyugBVPoeFyFt9a8hMQzW aXjaZ5ptEQkTCxfvDWLp51Hhi9aWjKEsRefAVzWAhedchDqG2oKxvIrloo1SF/V1XxfKkc 4AaVG2IZtQs9rXLcd8p4khPYtbVSHYJGl0L6AB5hpL5HSmZad4DAUeZ6TV41/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695570594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+JEAyoCCKNlpeOjB9CVDL41N3YgFEVjX+7Ufdw0Y5o=; b=IJICeWkXdWaMCZzj+yS5ZJn0kCrGKUJfw8cByvPbG3kWZOykOQTNLtfXHacTHrINUxCh2E okcLd7o3C6H3Qo1DDQLg1uo3Z4cwWNsR/gA76pQgBbphxlu/H4oe6HALUhSsfRlxw4fVAf fmTj5OIcAO/aZbNh9IDUZXFrMzacH3FIGVwnR7sWqkBP+ZZ9jarR5q915hYScauVTjabF1 0ngSoA+UKbkWM1DzpRJ110qEOWNHRfLi6R05ecGjH+fIEcWFbZ8/TwdtH9aWxkTBMbw9PH vaYlzQwBbKZeoTU1dZ6ZJiS5JN2KcgB78/tP8NOsKlSWaV2bhAbp9EJhiu6BQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rtr6p2tHRzsmg; Sun, 24 Sep 2023 15:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38OFnsxq028710; Sun, 24 Sep 2023 15:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38OFnsFU028707; Sun, 24 Sep 2023 15:49:54 GMT (envelope-from git) Date: Sun, 24 Sep 2023 15:49:54 GMT Message-Id: <202309241549.38OFnsFU028707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0e6bf38b578b - stable/13 - memcpy.3: remove BUGS section allowing overlapping strings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e6bf38b578b7b0a5bef0d8dbfb1fe6b1d9868f9 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0e6bf38b578b7b0a5bef0d8dbfb1fe6b1d9868f9 commit 0e6bf38b578b7b0a5bef0d8dbfb1fe6b1d9868f9 Author: Ed Maste AuthorDate: 2021-08-24 13:20:18 +0000 Commit: Ed Maste CommitDate: 2023-09-24 15:48:33 +0000 memcpy.3: remove BUGS section allowing overlapping strings The removed text claimed that memcpy is implemented using bcopy and thus strings may overlap. Use of bcopy is an implementation detail that is no longer true, even if the implementation (on some archs) does allow overlap. In any case behaviour is undefined per the C standard if memcpy is called with overlapping objects, and this man page already claimed that src and dst may not overlap. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31192 (cherry picked from commit 37296464defda0aa769c39ab554deb4875aef000) --- lib/libc/string/memcpy.3 | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3 index c1aa2d4dd8f5..5ce43d5dfe75 100644 --- a/lib/libc/string/memcpy.3 +++ b/lib/libc/string/memcpy.3 @@ -85,19 +85,3 @@ The function conforms to .St -isoC . -.Sh BUGS -In this implementation -.Fn memcpy -and -.Fn mempcpy -are implemented using -.Xr bcopy 3 , -and therefore the strings may overlap. -On other systems, copying overlapping strings may produce surprises. -Programs intended to be portable should use -.Xr memmove 3 -when -.Fa src -and -.Fa dst -may overlap.