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 D37AC823DD; Mon, 23 Mar 2026 14:19:50 +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=1774275590; cv=none; b=kN43m+SzkgXDbmiXNmZ/BOrTqfT2+gwOMLfRgxG5U7RnlXXIN+y/SXJlzx1rF39U9nIj95TRr+vHar+od/WA11bAsjApslTc9KjucKFY+jxJuYFiJg3NY/C2PuqEd7JzWyZ1kKZP2BZusHJ60Yd//+9s1f1D2SwVX3qCv+oyF0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275590; c=relaxed/simple; bh=hyms3pw32nuP2MayusLOerTfXZ+aDxM4pHy/LJfyBvY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ge2MmPGri28YGVUJY9A0ymS3oLKDJR7LXpr+C69WtieghqeKYhXUQ4Q4SvIF3bfXcxNzlLe/fWSOWEZAjCWpHbJBlGZva3ifQTZb1uRZN1S64SIVHjhoKQWvH9Zdzl61wMy8gyAALEGa+uryqsmNZKFutLqCmaR9KUlCFjBYOyQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0l1rboKH; 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="0l1rboKH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57EA2C4CEF7; Mon, 23 Mar 2026 14:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774275590; bh=hyms3pw32nuP2MayusLOerTfXZ+aDxM4pHy/LJfyBvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0l1rboKHReK/74hoEy8cOqCbCSd6zhoqCt1bCMavAmmQUQ8wBGKxk+d0yJGBoEjQh Ztx8142X8VarCr6WaWjm8WnFxd284ckaLd6WG3isPOcCboLPA18hrJ6BTso0fzxlI4 3610dxatmn0lG/ExKlBIJx8DuQwFUj84NGMRwRLs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ariel Silver , Mauro Carvalho Chehab Subject: [PATCH 6.12 154/460] media: dvb-net: fix OOB access in ULE extension header tables Date: Mon, 23 Mar 2026 14:42:30 +0100 Message-ID: <20260323134530.355645464@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ariel Silver commit 24d87712727a5017ad142d63940589a36cd25647 upstream. The ule_mandatory_ext_handlers[] and ule_optional_ext_handlers[] tables in handle_one_ule_extension() are declared with 255 elements (valid indices 0-254), but the index htype is derived from network-controlled data as (ule_sndu_type & 0x00FF), giving a range of 0-255. When htype equals 255, an out-of-bounds read occurs on the function pointer table, and the OOB value may be called as a function pointer. Add a bounds check on htype against the array size before either table is accessed. Out-of-range values now cause the SNDU to be discarded. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Ariel Silver Signed-off-by: Ariel Silver Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-core/dvb_net.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c @@ -228,6 +228,9 @@ static int handle_one_ule_extension( str unsigned char hlen = (p->ule_sndu_type & 0x0700) >> 8; unsigned char htype = p->ule_sndu_type & 0x00FF; + if (htype >= ARRAY_SIZE(ule_mandatory_ext_handlers)) + return -1; + /* Discriminate mandatory and optional extension headers. */ if (hlen == 0) { /* Mandatory extension header */