From nobody Wed Dec 21 20:12:11 2022 X-Original-To: dev-commits-src-main@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 4Ncl3H5hNBz1GyC0; Wed, 21 Dec 2022 20:12:11 +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 4Ncl3H5CRnz4LKS; Wed, 21 Dec 2022 20:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671653531; 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=O45nmioA5XD++lMTFOoo2WBrZltLOX6WE/kcCaRGrUQ=; b=x8q3Ja88THV9mMP4M8+QYTtDNhwx/f4WF1saUQjREwVlzioJhcxCFaD89WBmKCpdUImW/F RyxAwZE2KCG4RHDQf2EUobeZ9dsoD5s+R0prQwx0PDuzVFfH7X0tHrVihfiF7a7wX+I53M sc9+7Jfxxd6Sm227Y5lvobi3hjy+4XLX3K4V4S51kHAmivhS3hrIVWZxShaOEQbQdb3aEV OxTD+VotwU/N4+F/oL8P+FyFeeqzSyAAWn5HkzKd5PmeygGupUhfL88UWhGZyCKugdDIMR 4csFiQJIoZexjOQVk5pUvQisnARIIrGpOtnBVQ8GD4JKTiOfs1zMS5QAR6EiHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671653531; 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=O45nmioA5XD++lMTFOoo2WBrZltLOX6WE/kcCaRGrUQ=; b=tqL08yP/5ZbHuKDsXcSnvx6pOfZSFHNFF/Z5ZlwCVg4UZKk5ywSHmkDL1zdNmUy4EW9fO9 YX4GZ1lLyja2ir81UXltsHZLbOghpg7bAOo+Mr6mYbe2LCi2Hw2XwiVSonygDRGwTdCJ7N XybJehhLhwCODcei0sbLA0cXo8SuejOspoZWZOX89sMkrPgvznUD0AQg/XkKMYLmsMJu7w gjKaPKe2BX2QlPt9yHGRRTzpkrPJTX3VeNTrMSTpx0EE+S7okb5s2Jv3YqmMzHAERu5AXn FGbTtZ+TxtGNONCkMJxUgNOLiKj7OwjCncVDjiOt7XJINOdWSdBfKYL/n3jyRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671653531; a=rsa-sha256; cv=none; b=YuMyO/2U7pwLCIvpAax8b69iBb1Tvo5ls1cVP7XgLlJ5K+pP/r2/XQHX0Mj8iSesa2edxN sXIlAk+fJQmE+ZncbbponqkTtf36Ap2mB3xoVZtHEjR3OsQL4oCxpvMuMugzu8Kqq3zJ5d jJy1fewgy/mEXr/6PdoppHs6rgQYXBDmY1cQkNZKEN91g7k5zjnPbFL+53N6ePk85MP5PM UXkCRit2ypzCW5OlGyRTZqmmS1o/f+Q6ZFkNWEcPcTdbBm4Eb05PvwUpTmgD47S3/JYKdf 5EkZ5QByJIuy7pkyrLAOebeVHrTHkwqM76THTMEbhiW9RSOdeR0Sa9W5b4iKUw== 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 4Ncl3H4H52zShw; Wed, 21 Dec 2022 20:12:11 +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 2BLKCBCs012095; Wed, 21 Dec 2022 20:12:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BLKCBaY012094; Wed, 21 Dec 2022 20:12:11 GMT (envelope-from git) Date: Wed, 21 Dec 2022 20:12:11 GMT Message-Id: <202212212012.2BLKCBaY012094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ccd8c4488afb - main - linuxkpi: seq_read: Fix off by one error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccd8c4488afb15c2b866b58d5aa9dd994f300f95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ccd8c4488afb15c2b866b58d5aa9dd994f300f95 commit ccd8c4488afb15c2b866b58d5aa9dd994f300f95 Author: Emmanuel Vadot AuthorDate: 2022-12-21 11:42:24 +0000 Commit: Emmanuel Vadot CommitDate: 2022-12-21 20:11:31 +0000 linuxkpi: seq_read: Fix off by one error strscpy needs the buffer length not the string length (so including the '\0'). Reviewed by: bz Fixes: f697b9432d9c ("linuxkpi: drm-kmod debugfs support") Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37771 --- sys/compat/linuxkpi/common/src/linux_seq_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_seq_file.c b/sys/compat/linuxkpi/common/src/linux_seq_file.c index c358e4ae7dc1..d4d8ef059ac4 100644 --- a/sys/compat/linuxkpi/common/src/linux_seq_file.c +++ b/sys/compat/linuxkpi/common/src/linux_seq_file.c @@ -67,7 +67,7 @@ seq_read(struct linux_file *f, char *ubuf, size_t size, off_t *ppos) return (-EINVAL); size = min(rc - *ppos, size); - rc = strscpy(ubuf, sbuf_data(sbuf) + *ppos, size); + rc = strscpy(ubuf, sbuf_data(sbuf) + *ppos, size + 1); /* add 1 for null terminator */ if (rc > 0)