summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_files.py
diff options
context:
space:
mode:
authorShay Drory <shayd@nvidia.com>2025-12-09 14:56:11 +0200
committerPaolo Abeni <pabeni@redhat.com>2025-12-18 13:39:29 +0100
commitb35966042d20b14e2d83330049f77deec5229749 (patch)
tree541ef1c12bca602392236e9d551fd530d4a47aee /tools/lib/python/kdoc/kdoc_files.py
parent5846a365fc6476b02d6766963cf0985520f0385f (diff)
net/mlx5: fw_tracer, Validate format string parameters
Add validation for format string parameters in the firmware tracer to prevent potential security vulnerabilities and crashes from malformed format strings received from firmware. The firmware tracer receives format strings from the device firmware and uses them to format trace messages. Without proper validation, bad firmware could provide format strings with invalid format specifiers (e.g., %s, %p, %n) that could lead to crashes, or other undefined behavior. Add mlx5_tracer_validate_params() to validate that all format specifiers in trace strings are limited to safe integer/hex formats (%x, %d, %i, %u, %llx, %lx, etc.). Reject strings containing other format types that could be used to access arbitrary memory or cause crashes. Invalid format strings are added to the trace output for visibility with "BAD_FORMAT: " prefix. Fixes: 70dd6fdb8987 ("net/mlx5: FW tracer, parse traces and kernel tracing support") Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reported-by: Breno Leitao <leitao@debian.org> Closes: https://lore.kernel.org/netdev/hanz6rzrb2bqbplryjrakvkbmv4y5jlmtthnvi3thg5slqvelp@t3s3erottr6s/ Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1765284977-1363052-4-git-send-email-tariqt@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_files.py')
0 files changed, 0 insertions, 0 deletions