Thread View: linux.kernel.netdev
4 messages
4 total messages
Started by Sung Byeongchan
Thu, 08 Oct 2026 08:25
[PATCH net] qrtr: make repeated lookups from one client idempotent
Author: Sung Byeongchan
Date: Thu, 08 Oct 2026 08:25
Date: Thu, 08 Oct 2026 08:25
57 lines
8058 bytes
8058 bytes
The QRTR name service counts every NEW_LOOKUP request as a new global row,
even when one client repeats the same service and instance tuple. An
unprivileged local socket can fill all 128 rows with duplicates and prevent
an independent observer from registering a lookup.
Reuse an existing tuple owned by the same node and port. Continue through
the listing path so a repeated request retains its notification semantics
without consuming another global row.
An isolated AF_QIPCRTR test blocked an independent observer in all three
baseline runs. The observer succeeded in all three patched runs. The
127-row boundary, repeated-listing, and socket-close recovery controls
retained their expected behavior.
The demonstrated impact is bounded local cross-socket service denial. No
memory corruption or privilege escalation was observed.
This change was prepared with assistance from OpenAI Codex. I reviewed the
source change, test results, and this commit message.
Fixes: 5640227d9a21 ("net: qrtr: ns: Limit the maximum number of lookups")
Assisted-by: OpenAI Codex
Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
---
net/qrtr/ns.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
index bcb090ee79d49..ae0dc2474e5e9 100644
--- a/net/qrtr/ns.c
+++ b/net/qrtr/ns.c
@@ -547,6 +547,14 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
if (from->sq_node != qrtr_ns.local_node)
return -EINVAL;
+ list_for_each_entry(lookup, &qrtr_ns.lookups, li) {
+ if (lookup->sq.sq_node == from->sq_node &&
+ lookup->sq.sq_port == from->sq_port &&
+ lookup->service == service &&
+ lookup->instance == instance)
+ goto notify;
+ }
+
if (qrtr_ns.lookup_count >= QRTR_NS_MAX_LOOKUPS) {
pr_err_ratelimited("QRTR client node exceeds max lookup limit!\n");
return -ENOSPC;
@@ -562,6 +570,7 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
list_add_tail(&lookup->li, &qrtr_ns.lookups);
qrtr_ns.lookup_count++;
+notify:
memset(&filter, 0, sizeof(filter));
filter.service = service;
filter.instance = instance;
--
2.43.0
Re: [PATCH net] qrtr: make repeated lookups from one client idempotent
Author: netdev-bot+sinfo
Date: Thu, 08 Oct 2026 08:29
Date: Thu, 08 Oct 2026 08:29
18 lines
5960 bytes
5960 bytes
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then. The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Re: [PATCH net] qrtr: make repeated lookups from one client idempotent
Author: netdev-bot+sashiko
Date: Mon, 12 Oct 2026 08:40
Date: Mon, 12 Oct 2026 08:40
91 lines
8911 bytes
8911 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix does not close the denial of service its commit message
describes.
--
qrtr: make repeated lookups from one client idempotent
This patch adds a check to ctrl_cmd_new_lookup(). If a NEW_LOOKUP
request has the same node, port, service and instance as an existing
lookup, that row is reused and no new one is allocated. The goal is to
stop one unprivileged local socket from filling all 128 global lookup
rows with duplicates and locking out other observers.
> diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
> index bcb090ee79d49..ae0dc2474e5e9 100644
> --- a/net/qrtr/ns.c
> +++ b/net/qrtr/ns.c
> @@ -547,6 +547,14 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
> if (from->sq_node != qrtr_ns.local_node)
> return -EINVAL;
>
> + list_for_each_entry(lookup, &qrtr_ns.lookups, li) {
> + if (lookup->sq.sq_node == from->sq_node &&
> + lookup->sq.sq_port == from->sq_port &&
> + lookup->service == service &&
> + lookup->instance == instance)
> + goto notify;
> + }
> +
> if (qrtr_ns.lookup_count >= QRTR_NS_MAX_LOOKUPS) {
> pr_err_ratelimited("QRTR client node exceeds max lookup limit!\n");
> return -ENOSPC;
[Severity: High]
Does this close the denial of service described in the commit message?
The new loop only skips allocation when (sq_node, sq_port, service,
instance) exactly matches an existing row. Any other tuple falls through
to the unchanged global limit and takes a new row through list_add_tail()
and qrtr_ns.lookup_count++.
The service and instance values come straight from the client packet in
qrtr_ns_worker(), and nothing checks them:
case QRTR_TYPE_NEW_LOOKUP:
ret = ctrl_cmd_new_lookup(&sq,
le32_to_cpu(pkt->server.service),
le32_to_cpu(pkt->server.instance));
Can a single unprivileged AF_QIPCRTR socket still fill all 128 rows?
It could send NEW_LOOKUP for services 1..128, or for one service with
instances 1..128. Requests spread across several sockets would also miss
the exact-tuple check, because each autobound socket gets its own port.
Once qrtr_ns.lookup_count reaches QRTR_NS_MAX_LOOKUPS, an independent
observer still gets -ENOSPC. The rows are only freed by DEL_LOOKUP or
DEL_CLIENT from the owning port, so the attacker can hold them as long as
the socket stays open.
The test in the commit message seems to cover only identical duplicates.
The root cause looks like the single global limit, which has no
per-owner accounting:
#define QRTR_NS_MAX_LOOKUPS 128
Would per-owner accounting fit better than extending the exact-tuple
dedup? Options include a per-port quota under a global ceiling, or
per-uid or memcg based accounting.
Also, the global limit is hit by whichever client sends the next
request. So the "QRTR client node exceeds max lookup limit!" message
names the observer that was rejected, not the client that filled the
table.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261008082518.347350-1-tjdqudcks0424%40naver.com
Re: [PATCH net] qrtr: make repeated lookups from one client idempotent
Author: Simon Horman
Date: Thu, 15 Oct 2026 10:30
Date: Thu, 15 Oct 2026 10:30
101 lines
9448 bytes
9448 bytes
On Mon, Oct 12, 2026 at 08:40:54AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 1 · Medium: 0 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [High] The fix does not close the denial of service its commit message
> describes.
This does seem to be a legitimate concern. But I wonder what can be done
about it. I expect some sort of non-trivial heuristic is required, but I'm
not sure what one that works would look like. Or even what the bar for
"works" would be.
>
> --
>
> qrtr: make repeated lookups from one client idempotent
>
> This patch adds a check to ctrl_cmd_new_lookup(). If a NEW_LOOKUP
> request has the same node, port, service and instance as an existing
> lookup, that row is reused and no new one is allocated. The goal is to
> stop one unprivileged local socket from filling all 128 global lookup
> rows with duplicates and locking out other observers.
>
> > diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
> > index bcb090ee79d49..ae0dc2474e5e9 100644
> > --- a/net/qrtr/ns.c
> > +++ b/net/qrtr/ns.c
> > @@ -547,6 +547,14 @@ static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
> > if (from->sq_node != qrtr_ns.local_node)
> > return -EINVAL;
> >
> > + list_for_each_entry(lookup, &qrtr_ns.lookups, li) {
> > + if (lookup->sq.sq_node == from->sq_node &&
> > + lookup->sq.sq_port == from->sq_port &&
> > + lookup->service == service &&
> > + lookup->instance == instance)
> > + goto notify;
> > + }
> > +
> > if (qrtr_ns.lookup_count >= QRTR_NS_MAX_LOOKUPS) {
> > pr_err_ratelimited("QRTR client node exceeds max lookup limit!\n");
> > return -ENOSPC;
>
> [Severity: High]
> Does this close the denial of service described in the commit message?
>
> The new loop only skips allocation when (sq_node, sq_port, service,
> instance) exactly matches an existing row. Any other tuple falls through
> to the unchanged global limit and takes a new row through list_add_tail()
> and qrtr_ns.lookup_count++.
>
> The service and instance values come straight from the client packet in
> qrtr_ns_worker(), and nothing checks them:
>
> case QRTR_TYPE_NEW_LOOKUP:
> ret = ctrl_cmd_new_lookup(&sq,
> le32_to_cpu(pkt->server.service),
> le32_to_cpu(pkt->server.instance));
>
> Can a single unprivileged AF_QIPCRTR socket still fill all 128 rows?
> It could send NEW_LOOKUP for services 1..128, or for one service with
> instances 1..128. Requests spread across several sockets would also miss
> the exact-tuple check, because each autobound socket gets its own port.
>
> Once qrtr_ns.lookup_count reaches QRTR_NS_MAX_LOOKUPS, an independent
> observer still gets -ENOSPC. The rows are only freed by DEL_LOOKUP or
> DEL_CLIENT from the owning port, so the attacker can hold them as long as
> the socket stays open.
>
> The test in the commit message seems to cover only identical duplicates.
>
> The root cause looks like the single global limit, which has no
> per-owner accounting:
>
> #define QRTR_NS_MAX_LOOKUPS 128
>
> Would per-owner accounting fit better than extending the exact-tuple
> dedup? Options include a per-port quota under a global ceiling, or
> per-uid or memcg based accounting.
>
> Also, the global limit is hit by whichever client sends the next
> request. So the "QRTR client node exceeds max lookup limit!" message
> names the observer that was rejected, not the client that filled the
> table.
>
> [ ... ]
>
> --
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261008082518.347350-1-tjdqudcks0424%40naver.com
--
pw-bot: changes-requested
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads