From nobody Mon Feb 21 13:48:50 2022 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 2EA521839877; Mon, 21 Feb 2022 13:48:53 +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 4K2Ntq3kWLz3Pjb; Mon, 21 Feb 2022 13:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451332; 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=FpFLScZbTscl/dEDsKS1rVJfX8MiI5PL/1AxYXttIjo=; b=XBdRyrn4YD8QlQFcuSyozV57OffZTIOfdetlenDoUPDEIUOESB9wAIs8LnMFrYKl7nAnex R3HoWp303TUI9BpvckKY8yLtJSg+8eK3+gX6xNuTaxh7ZRmo3AGm1X1qbPVq1qlNYgYiBO ROP6I0UZmlahdDxcGjvWR06S7bCdUQftYtWD9Q65Bc+3/LTp1Wqp/uRjwYduuRI2I3+L6f Lni/qqyO3/DaM5lxpKyQ9lbUOLWG8F1Hl9d8bm9qhUZmPJKsdvvdZhmuZxhFKcdr9svGZ3 35RG5/d5Mk9zJk+sosav6YfiCoWVfhn29nKs97A35svBDmAcgjhdjDMeukHccQ== 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 01CC21131C; Mon, 21 Feb 2022 13:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21LDmocX091821; Mon, 21 Feb 2022 13:48:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21LDmov5091820; Mon, 21 Feb 2022 13:48:50 GMT (envelope-from git) Date: Mon, 21 Feb 2022 13:48:50 GMT Message-Id: <202202211348.21LDmov5091820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0737ef6fbce4 - stable/13 - linux: make ptrace(2) return EIO when trying to peek invalid address 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: trasz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0737ef6fbce49026d67ecf2cf898b31365005009 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451332; 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=FpFLScZbTscl/dEDsKS1rVJfX8MiI5PL/1AxYXttIjo=; b=Kq8Mv6/5YPxio/O8fIYEkkFiH1Zu4vpOP45zHZZxbwd+FJWlGCzme/tDL3Gmh4hPwzjDmj azzL1DJPV8lHiuLy6PkbXhSoKua4wivP688fNuN3Sq0QQzc9CCX8M6VoJ8QnvOSAchH6uW aSh5NP+RF3gCBYUrsYSz2GYGFVCcfRZvccXSM1wgjNAZT52+r3B7rvXbaFy3rJ4LuquejB 9ogWbZ7bX7UMc5sSpDbbMzGFE5J5+mh/xeyLjl9iyXvoBrMwZYVUzEUB3D6wB+rU0YLIV3 ncabEqjtCyGfCFGyHWdXQn+b3OoRzUJCkdZtg0NtmOmU3YPlbqeMwp+sXX1MCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645451332; a=rsa-sha256; cv=none; b=I/vtU+rKoCe8Vtmw1xDCDr2oTWxZSxP/vSj0LwTFHr7RDgbLJsoWfu3W4Ig2F6bRKV3GhC l2cl7+RIvswDtm/mlQ6MnZFO8wIBhWbW5bkmRudskVgEOCgKAuZTCSeAFUOUx5hhewZHVZ wJut2FgDjHzKw/m3h+/tcoXcFWNzETQQ+M8P8b1YWsUlAZwEuqJGaHa96+h0Si5737vUfp 7Cm31p73ZLRkVvDzJbK3THd6/kauIDey4RoVXQBg91sLQbh0fN4/z5zvXoQN2CJ7zG+fDr kWKcWN+/3Uul4h/nmJ5e8L/xQKz2rcmHrhrpqDhQ7iEwAv4Z3XDb6nYLGU8Fsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0737ef6fbce49026d67ecf2cf898b31365005009 commit 0737ef6fbce49026d67ecf2cf898b31365005009 Author: Edward Tomasz Napierala AuthorDate: 2021-04-24 10:37:06 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-02-21 13:19:30 +0000 linux: make ptrace(2) return EIO when trying to peek invalid address Previously we've returned the error from native ptrace(2), ENOMEM. This confused Linux strace(2). Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29925 (cherry picked from commit 77651151f3caec7d2440404f8c0f1819757d1d5d) --- sys/amd64/linux/linux_ptrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 8fb87a8536b6..6516453dd5e4 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -282,6 +282,8 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) error = kern_ptrace(td, PT_READ_I, pid, addr, 0); if (error == 0) error = copyout(td->td_retval, data, sizeof(l_int)); + else if (error == ENOMEM) + error = EIO; td->td_retval[0] = error; return (error);