Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE-2022-37704 - privilege escalation form amandabackup user to root -fix #197

Conversation

seetharaman-rajagopal
Copy link
Contributor

Fixes done for security issue.
Add functions to validated the commandline options.
previously "rundump” application was not doing any option filtering. Now it does.
Using getopt() to filter the backlist option. (like -F)

@@ -160,14 +162,17 @@ main(

Copy link
Contributor

@pcahyna pcahyna Feb 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing { here.
Since the block below now has multiple statements, the else above matches only the first one
and validate_dump_option(argc, argv); is always executed. This breaks legitimate xfsdump usage, because it aborts when using the -F option.

# else
# if defined(VXDUMP)
dump_program = VXDUMP;
# else
dump_program = "dump";
validate_dump_option(argc, argv);
# endif
# endif
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing } here.

@pcahyna
Copy link
Contributor

pcahyna commented Feb 26, 2023

This is unfortunately insufficient. dump has an undocumented obsolete option syntax where all options can be provided in the first argument together without a leading -, and their parameters (for options that take parameters) after. So

dump -B 1 -f foo -F bar baz

can also be (and is) specified as

dump BfF 1 foo bar baz

See the function obsolete() in dump/main.c.

@pcahyna
Copy link
Contributor

pcahyna commented Feb 26, 2023

validate_xfsdump_options() is also missing after the first dump_program = XFSDUMP; statement. See #205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants