From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379556; b=CjjRBzryJ5vrBEcZ+goHdh25MsTiNZ7LLjgod4lDdEQiudw3V0YBOOp43BkNjyAhp5b8 4mlQRlqD303Hsj32PY0xM0C44AdE13EQYsXzGXYmS1TW4HpWWTvuNbyGlZhDU+R39oomA PU0FU9NVHTptTsoKDp4ZXrKorlNeoEQCg0YykCKLkIU83q+25T7kmPMTk7EQEychyOtBz zEOrHXukKwzuIUk3kZJXAdgtlFDCUeDL1QKTP5qZAfz9XxoaLU76m17j4+Pn6KPbcsANk 0auzANzOFwkJG/Yd8VqoU9WQVbREeeFBKZzalfMzv6/9JEzIpFZTmxaMcV2ogP3uPtw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379556; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=M9VXJMtf9bs8gAhHcfVORpUI2xOpqfZ8D9A15/GViII=; b=JL5EvLyTgq6IIi7H/vdyK7szquK2ZZxgcfwDf1Y4H0Mz/GJ8DK7E98d+hdewOyn5BuRT B1D/nrNmLw7MQdSie84Mbm+VhQDKhlsOsLArLDjgKuQgh1zT6cXSxI2K4Qz6Q0rLp5SyD oiIDLTrK6NHnw+DztpYMeLp3Vu/dUTopmJnm6Hz2MTi4cNPlRpPYX4FgElnLFNVDOU5ys f5ssnEs/xOSGTVhoZuqmvZS48bw1mQLufJbhL791rzShYKAHbbZt9ACA5R3elntha72DQ GB5He5wLuYBUz2ctisy6i0p9kZI0+I8BkwCaEb8GjqBKVd+Evr1fh2cjWpje8xkQ8VQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=aw4BV0Hs; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 867B9606A322; Fri, 4 Dec 2026 10:19:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=aw4BV0Hs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 017261F000CE; Fri, 4 Dec 2026 10:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379556; bh=M9VXJMtf9bs8gAhHcfVORpUI2xOpqfZ8D9A15/GViII=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aw4BV0HsFSZydMfXCwlxI4qcSIkcGQqPvUSqFuemrFzGxSsUtIxnwjTL1Nz8S4qEl VX9rykPzW2vhmQY2ss4Nvjz5VXxdbeAARYMnwelnPUtFKGgALhV8pZEUO1qQi3Zp7f B4X4664prbnfyrrQNXoRArnzhby6vO/AI6EmITKs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bas Nieuwenhuizen , Faith Ekstrand , Alex Deucher , Sasha Levin Subject: [PATCH 6.1 0005/1059] drm/amdgpu: Check cs flags. Date: Fri, 4 Dec 2026 18:52:16 +0900 Message-ID: <20261204100644.140125521@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bas Nieuwenhuizen [ Upstream commit f5ea64f9fcd921bc4e2307a262e19450b8a58524 ] Had no validation before. libdrm_amdgpu memsets this, even for the raw/raw2 functions. We have a lot of functions touching the ioctl struct, no strong opinion on where this is placed, but I thought early would be good. Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Faith Ekstrand Signed-off-by: Alex Deucher (cherry picked from commit 4d01e15e76358f60ef6734462d2b6d9972b9dfbc) Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 710bf84e2ab48..d086c2a2329db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -202,6 +202,9 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, int ret; int i; + if (cs->in.flags) + return -EINVAL; + chunk_array = memdup_array_user(u64_to_user_ptr(cs->in.chunks), cs->in.num_chunks, sizeof(uint64_t)); -- 2.53.0