From nobody Fri Jun 17 19:38:55 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 56E4D85B9BC; Fri, 17 Jun 2022 19:38:57 +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 4LPq9C6j5qz3QnG; Fri, 17 Jun 2022 19:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494737; 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=UDFszNWarBP0Fz8Py6TKlB2D+jDDMw/3tBTUwEAp2S8=; b=ktAVs88L7J3v9tq9w6YwVfKig5OVmg9N4Zp+XuleSoVO0s+dSfiXXXdKFA+Svyyy+umZSP YH+PhWXmijk+wvqB+L/EHqVkWYscQFfSOl3UM5N/uaJcmsdNnSki6pvc95Zvj0PHwZVgcY zj/wDPHcJYzoFsfYcVFywRhQqDnABHJIZii/D1xfdFSjM3tf6JYLMmT0gO+zlg7US6bNTZ EIV35fFqQR58K6StqjB0unhsdjPzAXSBrxIMZz2nKVDempFhLBTBDPvaDZL/coD6p2eae7 ld4veaz/WO1d/3KwqIpso9mHwVMyRz+FJDKIcH2n3yZHwEZzvnwlDT/raRSI0Q== 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 AD50C25D89; Fri, 17 Jun 2022 19:38:55 +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 25HJctVW015331; Fri, 17 Jun 2022 19:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJctVS015330; Fri, 17 Jun 2022 19:38:55 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:55 GMT Message-Id: <202206171938.25HJctVS015330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: aeddbb898e1a - stable/13 - linux(4): readlink should fail if bufzis <= 0. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aeddbb898e1a14ece7f467d222be1604e5857b27 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494736; 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=UDFszNWarBP0Fz8Py6TKlB2D+jDDMw/3tBTUwEAp2S8=; b=ckK1Cjyx3hymybk25qH5DDPU3thi7BMRljVW9IQLwCWdKIg+9tcb/hQQUSGXB8YJuTDfbD RTKCaq2vhU2wf1rEhZ0VBflBZy+m1hwC3SrOxhVAQyJR5s7iK6RSazdlhJuZJ/+tSO2QbT RyZcEJeQoggSmRHr6xuSe0yLtHgaG38M/Kn7BnqAUNOs6h+kXDggtvRTtdjEoSyj2tYB9l NbFCTOrmg8yvU7D44y8YpQgAxMCF6DazHPV//WGXfhUv9r011vNhIN727tPgo6tG5/nyK6 tgdsJ9YfTRNwEbr3AdluVwwvoNeLenx0BgGK3A0HoQfabP8ryK6EyeW+5jaK0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494736; a=rsa-sha256; cv=none; b=ayUjLxcjfsrvqW+KhYxQBN1d4boNDfKJta/VSNp6ZmFc8oq5Xd1BPT0/NreJyO3JeDwxYW 3LlffBUIvbX9JqMvSXJQA86io6sjoISiwnAM2kcDFu26mSuIo3vj4rTuabNW8MQ+HzEPxK +vWJKoVbr/S2NNhZvLklqNBbTyqzRcNgli3B99Cs+FrNeqefE0LSkZSiqHWL00lPlm77/s XqoVAZ6PQXg+P3lF9P+QiqEJvwFEDTVzoyRI0Xt9zdZfQOpf+CzJW31zW2NVnTVJYP9EwK lXR7wfm06g7gei8eQEUH0ynQd43I6dhR0WARqKSNx+o2gAFVwOFCTc6duTGVWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=aeddbb898e1a14ece7f467d222be1604e5857b27 commit aeddbb898e1a14ece7f467d222be1604e5857b27 Author: Dmitry Chagin AuthorDate: 2022-03-31 18:21:41 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:48 +0000 linux(4): readlink should fail if bufzis <= 0. MFC after: 2 weeks (cherry picked from commit d6ccce0aa267db8ee57736e944520e2967896340) --- sys/compat/linux/linux_file.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 6a1402c09456..8926e760fc39 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1042,6 +1042,9 @@ linux_readlink(struct thread *td, struct linux_readlink_args *args) char *name; int error; + if (args->count <= 0) + return (EINVAL); + if (!LUSECONVPATH(td)) { return (kern_readlinkat(td, AT_FDCWD, args->name, UIO_USERSPACE, args->buf, UIO_USERSPACE, args->count)); @@ -1060,6 +1063,9 @@ linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) char *name; int error, dfd; + if (args->bufsiz <= 0) + return (EINVAL); + dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; if (!LUSECONVPATH(td)) { return (kern_readlinkat(td, dfd, args->path, UIO_USERSPACE,