From: sashiko-bot@kernel.org
To: "Breno Rodrigues Alves" <breno3011alves@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-input@vger.kernel.org,
dmitry.torokhov@gmail.com, linux-clk@vger.kernel.org,
media-ci@linuxtv.org
Subject: Re: [PATCH v11 3/3] media: dvb-core: extirpate defective and unsafe ULE debug block
Date: Sat, 05 Sep 2026 14:12:32 +0000 [thread overview]
Message-ID: <20260905141233.39A1F1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260905140113.21638-3-breno3011alves@gmail.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [Low] The patch introduces a severe compilation failure by modifying the call to `dvb_net_ule_check_crc()` to pass 3 arguments instead of 4, without updating the function's signature to match.
Pre-existing issues:
- [Critical] The network device is unregistered after flushing the workqueues, allowing callbacks to queue works during unregistration, which leads to a Use-After-Free.
- [Critical] Missing bounds checks when parsing ULE extension headers allows malformed packets to cause out-of-bounds memory reads.
--
commit e9caeb2ec9c58e63757d73d1d8a17bcadf35a678
Author: Breno Rodrigues Alves <breno3011alves@gmail.com>
media: dvb-core: extirpate defective and unsafe ULE debug block
This commit removes the unmaintained DVB_ULE_DEBUG code block from
dvb_net.c and its Kconfig definition. It aims to eliminate race
conditions and clean up unused function signature parameters.
> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index a2159b2bc1766..5060b8866de8a 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
[ ... ]
> @@ -843,7 +803,7 @@ static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len)
> *(tail - 2) << 8 |
> *(tail - 1);
>
> - dvb_net_ule_check_crc(&h, iov, ule_crc, expected_crc);
> + dvb_net_ule_check_crc(&h, ule_crc, expected_crc);
[Severity: Low]
Does this change miss updating the function signature of
dvb_net_ule_check_crc()?
It looks like the invocation now passes 3 arguments, but the function
definition for dvb_net_ule_check_crc() still expects the iov array as its
second argument, which causes a compilation failure due to too few arguments.
>
> /* Prepare for next SNDU. */
> reset_ule(h.priv);
While reviewing this code, I also noticed a couple of issues that are not
introduced by this patch, but might be worth addressing:
[Severity: Critical]
This is a pre-existing issue, but I noticed a potential use-after-free
when unregistering the network device.
In dvb_net_remove_if(), the workqueues are flushed before the device is
unregistered:
flush_work(&priv->set_multicast_list_wq);
flush_work(&priv->restart_net_feed_wq);
pr_info("removed network interface %s\n", net->name);
unregister_netdev(net);
When unregister_netdev() is called, callbacks can be triggered (such as
ndo_set_rx_mode mapping to dvb_net_set_multicast_list) which schedule work
back onto set_multicast_list_wq. Could this result in a use-after-free
when the pending work executes later, since the priv memory gets freed
during teardown?
[Severity: Critical]
This is a pre-existing issue, but it looks like there might be an
out-of-bounds read when parsing ULE extension headers.
The handle_ule_extensions() loop iterates over extension headers using
handle_one_ule_extension(), which reads memory and advances the pointer:
p->ule_next_hdr += ext_len;
p->ule_sndu_type = ntohs( *(__be16 *)(p->ule_next_hdr-2) );
Is it possible for a malformed payload to specify extension lengths that
push p->ule_next_hdr past the end of the allocated skb buffer? The loop
appears to continue without bounds checking against skb->len, which could
cause a page fault on malicious inputs.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260905140113.21638-1-breno3011alves@gmail.com?part=3
next prev parent reply other threads:[~2026-09-05 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 14:01 [PATCH v11 1/3] interconnect: mediatek: fix Makefile typo for mt8196 Breno Rodrigues Alves
2026-09-05 14:01 ` [PATCH v11 2/3] regulator: mtk-spmi: fix Makefile typo for mt6316 Breno Rodrigues Alves
2026-09-05 14:03 ` sashiko-bot
2026-09-05 14:01 ` [PATCH v11 3/3] media: dvb-core: extirpate defective and unsafe ULE debug block Breno Rodrigues Alves
2026-09-05 14:12 ` sashiko-bot [this message]
2026-09-05 14:03 ` [PATCH v11 1/3] interconnect: mediatek: fix Makefile typo for mt8196 sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260905141233.39A1F1F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=breno3011alves@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox