Strictly validate lctl set_param parameter keys against allowlist in upcall server - #608
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces strict argument validation for the lctl set_param command to prevent unauthorized upcall configurations and path traversals. Feedback focuses on a critical security vulnerability where attackers could bypass the upcall substring check using globbing/wildcard characters or backslashes. It is recommended to disallow backslashes in the parameter key and restrict globbing characters in the final component of the parameter name, as well as to add robust test cases covering these bypass scenarios.
078533c to
d54c5e7
Compare
d54c5e7 to
d7247ab
Compare
…upcall server Enforce strict allowlist validation in the upcall IPC server for lctl set_param parameter keys (supporting osc.*, mdc.*, llite.*, and ldlm.*) while disallowing flags and upcall hook parameters. Bug: b/524246779
d7247ab to
5150750
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces stricter argument validation for the lctl set_param command by restricting parameter keys to specific allowed prefixes (osc., mdc., llite., ldlm.) and blocking keys containing the substring "upcall". It also adds comprehensive unit tests to verify these validation rules. The review feedback identifies a critical security vulnerability where the "upcall" block can be bypassed using wildcard characters (e.g., up*all) that lctl expands. It is recommended to explicitly disallow wildcard characters in the final parameter name component and to add corresponding test cases to verify this behavior.
…meter name Disallow wildcard characters (*, ?, [, ]) and backslashes in the leaf component of lctl set_param parameter keys to prevent bypassing the upcall block. Add corresponding test cases for wildcard, question mark, character class, and escape bypass attempts.
What this PR does
Enforces strict security allowlist validation in the upcall IPC server for
lctl set_paramparameter keys executed on behalf of the host Lustre kernel/udev proxy on Container-Optimized OS (COS) nodes.Context & Motivation
On COS nodes, Lustre kernel udev events and IAM upcalls communicate with the privileged CSI driver container over a Unix domain socket (
ipc.sock). Whilelctl set_paramis an authorized subcommand, unrestricted parameter setting poses a security risk because attackers could configure kernel upcall binary paths (e.g.ptlrpc.*.upcall,mdt.*.identity_upcall,osc.*.upcall) that execute as root on the host.Implementation Details
Following review and confirmation with Lustre performance experts:
osc.*: Object Storage Client tunables (e.g.osc.*.max_dirty_mb,max_rpcs_in_flight,checksums) and dynamic mount target connections (osc.<fs>-<target>-osc-<addr>.import).mdc.*: Metadata Client tunables (mdc.*.max_rpcs_in_flight) and dynamic target connections (mdc.<fs>-<target>-mdc-<addr>.import).llite.*: Client VFS/caching tunables (llite.*.max_read_ahead_mb,enable_compression,opencache_*,statahead_*).ldlm.*: Lustre Distributed Lock Manager namespace tunables (ldlm.namespaces.*.lru_size,ldlm.*.*mdc*.lru_max_age).-nand-P) are rejected because client nodes on GKE do not require them (-Pis exclusive to MGS persistent configs).upcallkeyword.