From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BDB8421899 for ; Fri, 15 May 2026 08:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835241; cv=none; b=mjzvtEPqyrtmvsPzMj191/ttoZLKyMdqtIefh2l4/NXfXSk1L2U3ky0fJyP7HEqrxpgTT7uLj8pumqeb7AouoS0gX68fSTiAXMMfJPdtKOc90fgJYC+lZzhsM8XEobY2LknH5yHCxS8DouWGJBCCx1WA2IPRBUjqpEt5xnm3dXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778835241; c=relaxed/simple; bh=I1Ryjzq/BtvyWDk5QuWeBax+Ws63hkxQPqI19n2NeT0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=CmaeSr1B1lTqPAiVksZZi6itiBEGNIVGUADJWgUIrMd7sAB/yKU7Py6b2wyzL25OkwpobVIoTFhGAH3eTe6EgKjMXp027+wquuE5ye2TcFVj2W8ZVZl3pPJTedOJw8VIoVebgIvPj3aJPObJNFnXtwkTNKfnBK1ie/a+/VXWypQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K62G8QKd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K62G8QKd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEAFCC2BCC7; Fri, 15 May 2026 08:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778835241; bh=I1Ryjzq/BtvyWDk5QuWeBax+Ws63hkxQPqI19n2NeT0=; h=Subject:To:Cc:From:Date:From; b=K62G8QKdy3qJ/eHUgtmA+6698sFRyTtPk4oC2Z9flbW+kIMXB41KQoc3c1iYwIaV1 nHIH9dc9EIhTz4Sy8mvxUjx8bbhbYxb9Nqeanv0W9y0C2xUszummNZ1EkxhL4QAQsc /BN6OuwHeyueD+dDiRg9AsQV2NvcAC5Jod58GxLg= Subject: FAILED: patch "[PATCH] drm/v3d: Reject empty multisync extension to prevent infinite" failed to apply to 6.18-stable tree To: ashutoshdesai993@gmail.com,mcanal@igalia.com Cc: From: Date: Fri, 15 May 2026 10:51:41 +0200 Message-ID: <2026051541-twisty-generic-1b1b@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x fb44d589bf3148e13452185a6e772a7efbf2d684 # git commit -s git send-email --to '' --in-reply-to '2026051541-twisty-generic-1b1b@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From fb44d589bf3148e13452185a6e772a7efbf2d684 Mon Sep 17 00:00:00 2001 From: Ashutosh Desai Date: Wed, 15 Apr 2026 05:00:00 +0000 Subject: [PATCH] drm/v3d: Reject empty multisync extension to prevent infinite loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v3d_get_extensions() walks a userspace-provided singly-linked list of ioctl extensions without any bound on the chain length. A local user can craft a self-referential extension (ext->next == &ext) with zero in_sync_count and out_sync_count, which bypasses the existing duplicate- extension guard: if (se->in_sync_count || se->out_sync_count) return -EINVAL; The guard never fires because v3d_get_multisync_post_deps() returns immediately when count is zero, leaving both fields at zero on every iteration. The result is an infinite loop in kernel context, blocking the calling thread and pegging a CPU core indefinitely. Fix this by rejecting a multisync extension where both in_sync_count and out_sync_count are zero in v3d_get_multisync_submit_deps(). An empty multisync carries no synchronization information and serves no useful purpose, so returning -EINVAL for such an extension is the correct defense against this attack vector. Fixes: e4165ae8304e ("drm/v3d: add multiple syncobjs support") Cc: stable@vger.kernel.org Signed-off-by: Ashutosh Desai Link: https://patch.msgid.link/20260415050000.3816128-1-ashutoshdesai993@gmail.com Signed-off-by: MaĆ­ra Canal diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c index 18f2bf1fe89f..fc74351efad5 100644 --- a/drivers/gpu/drm/v3d/v3d_submit.c +++ b/drivers/gpu/drm/v3d/v3d_submit.c @@ -393,6 +393,11 @@ v3d_get_multisync_submit_deps(struct drm_file *file_priv, if (multisync.pad) return -EINVAL; + if (!multisync.in_sync_count && !multisync.out_sync_count) { + drm_dbg(&v3d->drm, "Empty multisync extension\n"); + return -EINVAL; + } + ret = v3d_get_multisync_post_deps(file_priv, se, multisync.out_sync_count, multisync.out_syncs); if (ret)