shared/conf-parser: fix crash when specifiers cannot be resolved in config_parse_device_allow()
oss-fuzz #6885.
This commit is contained in:
parent
0d032da993
commit
20d52ab60e
1
TODO
1
TODO
|
@ -528,6 +528,7 @@ Features:
|
||||||
* maybe add a generator that looks for "systemd.run=" on the kernel cmdline for container usercases...
|
* maybe add a generator that looks for "systemd.run=" on the kernel cmdline for container usercases...
|
||||||
|
|
||||||
* test/:
|
* test/:
|
||||||
|
- add unit tests for config_parse_device_allow()
|
||||||
|
|
||||||
* seems that when we follow symlinks to units we prefer the symlink
|
* seems that when we follow symlinks to units we prefer the symlink
|
||||||
destination path over /etc and /usr. We should not do that. Instead
|
destination path over /etc and /usr. We should not do that. Instead
|
||||||
|
|
|
@ -410,7 +410,6 @@ int config_parse_socket_listen(const char *unit,
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
if (r != -EAFNOSUPPORT)
|
if (r != -EAFNOSUPPORT)
|
||||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse address value, ignoring: %s", rvalue);
|
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse address value, ignoring: %s", rvalue);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3511,6 +3510,7 @@ int config_parse_device_allow(
|
||||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||||
"Failed to resolve specifiers in %s, ignoring: %m",
|
"Failed to resolve specifiers in %s, ignoring: %m",
|
||||||
rvalue);
|
rvalue);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = strcspn(t, WHITESPACE);
|
n = strcspn(t, WHITESPACE);
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
service
|
||||||
|
[Service]
|
||||||
|
DeviceAllow=%D
|
|
@ -30,4 +30,5 @@ fuzz_regression_tests = '''
|
||||||
fuzz-dns-packet/oss-fuzz-5465
|
fuzz-dns-packet/oss-fuzz-5465
|
||||||
fuzz-dns-packet/issue-7888
|
fuzz-dns-packet/issue-7888
|
||||||
fuzz-unit-file/oss-fuzz-6884
|
fuzz-unit-file/oss-fuzz-6884
|
||||||
|
fuzz-unit-file/oss-fuzz-6885
|
||||||
'''.split()
|
'''.split()
|
||||||
|
|
Loading…
Reference in New Issue