net: qrtr: ns: Limit the maximum number of lookups
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Thu, 9 Apr 2026 17:34:13 +0000 (23:04 +0530)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 Apr 2026 22:34:06 +0000 (15:34 -0700)
commit5640227d9a21c6a8be249a10677b832e7f40dc55
tree30dbbb9493933be825183adf6d62f707574b2fd9
parentd5ee2ff98322337951c56398e79d51815acbf955
net: qrtr: ns: Limit the maximum number of lookups

Current code does no bound checking on the number of lookups a client can
perform. Though the code restricts the lookups to local clients, there is
still a possibility of a malicious local client sending a flood of
NEW_LOOKUP messages over the same socket.

Fix this issue by limiting the maximum number of lookups to 64 globally.
Since the nameserver allows only atmost one local observer, this global
lookup count will ensure that the lookups stay within the limit.

Note that, limit of 64 is chosen based on the current platform
requirements. If requirement changes in the future, this limit can be
increased.

Cc: stable@vger.kernel.org
Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260409-qrtr-fix-v3-2-00a8a5ff2b51@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/qrtr/ns.c