mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
um: vector: reject too many interface arguments
uml_parse_vector_ifspec() stores parsed key/value pairs in the fixed struct arglist token and value arrays, which are both sized to MAXVARGS. The parser increments numargs as it discovers pairs, but it never checks whether another slot is still available before writing into the arrays. Reject interface specifications that exceed MAXVARGS instead of writing past the end of the fixed argument arrays. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260424070106.1-uml-vector-v2-pengpeng@iscas.ac.cn Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
28ada50b74
commit
9756ecdbff
|
|
@ -93,6 +93,9 @@ struct arglist *uml_parse_vector_ifspec(char *arg)
|
|||
len = strlen(arg);
|
||||
for (pos = 0; pos < len; pos++) {
|
||||
if (next_starts) {
|
||||
if (result->numargs >= MAXVARGS)
|
||||
goto cleanup;
|
||||
|
||||
if (parsing_token) {
|
||||
result->tokens[result->numargs] = arg + pos;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user