Message ID | 20191101161639.26034-2-hauke@hauke-m.de |
---|---|
State | Accepted |
Delegated to: | John Crispin |
Headers | show |
Series | [OpenWrt-Devel,procd,1/2] instance: ujail: Fix allocated size for no_new_privs parameter | expand |
diff --git a/service/instance.c b/service/instance.c index 4bb2207..3098ff3 100644 --- a/service/instance.c +++ b/service/instance.c @@ -337,8 +337,12 @@ instance_run(struct service_instance *in, int _stdout, int _stderr) ULOG_WARN("Seccomp support for %s::%s not available\n", in->srv->name, in->name); #endif - if (in->has_jail) + if (in->has_jail) { argc = jail_run(in, argv); + if (argc != in->jail.argc) + ULOG_WARN("expected %i jail params, used %i for %s::%s\n", + in->jail.argc, argc, in->srv->name, in->name); + } blobmsg_for_each_attr(cur, in->command, rem) argv[argc++] = blobmsg_data(cur);
Warn when the number of allocated parameters for the jail argv does not match the number of used parameters. This normally leads to a buffer overflow. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- service/instance.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)