Whamcloud - gitweb
LU-15056 nrs: length of a tbf rule should be checked 24/45124/6
authorEtienne AUJAMES <eaujames@ddn.com>
Mon, 4 Oct 2021 18:42:31 +0000 (20:42 +0200)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Jan 2022 21:59:39 +0000 (21:59 +0000)
commit1937c6cd75a2346b353f4cb6aacda8d0b6df804d
tree74c4c9600117fc53e89e28c99a8d23ba03f17ef1
parentc9901b68b44c9c6b8713a74c28f78137dca314ce
LU-15056 nrs: length of a tbf rule should be checked

The maximum size of a tbf rule name is 16 bytes (MAX_TBF_NAME). This
length is not verify before applying the rule. This causes a buffer
overflow at name copy.

This patch adds a str length verification inside name_is_invalid().
The test sanityn 77p checks if an error is returned when user try to
register a rule with an invalid name.

Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I93c73083b6e81ab9070a860e702e56b0cb498352
Reviewed-on: https://review.whamcloud.com/45124
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/nrs_tbf.c
lustre/tests/sanityn.sh