]> git.baikalelectronics.ru Git - kernel.git/commit
dm verity: fix verity_parse_opt_args parsing
authorMike Snitzer <snitzer@kernel.org>
Tue, 9 Aug 2022 22:07:28 +0000 (18:07 -0400)
committerMike Snitzer <snitzer@kernel.org>
Tue, 9 Aug 2022 23:15:17 +0000 (19:15 -0400)
commitbf8ae4d813c4fd10ac50525c627dd74e1ef0ed6c
tree532890b9182551c4a7869767e1ddfc4477ad4fe5
parenta6a3b8aff40c69d69c2abf158228009cc3464efc
dm verity: fix verity_parse_opt_args parsing

Commit 16be5528a845 ("dm verity: allow optional args to alter primary
args handling") introduced a bug where verity_parse_opt_args() wouldn't
properly shift past an optional argument's additional params (by
ignoring them).

Fix this by avoiding returning with error if an unknown argument is
encountered when @only_modifier_opts=true is passed to
verity_parse_opt_args().

In practice this regressed the cryptsetup testsuite's FEC testing
because unknown optional arguments were encountered, wherey
short-circuiting ever testing FEC mode. With this fix all of the
cryptsetup testsuite's verity FEC tests pass.

Fixes: 16be5528a845 ("dm verity: allow optional args to alter primary args handling")
Reported-by: Milan Broz <gmazyland@gmail.com>>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-verity-target.c