mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
dynamic parameter filter bug fixes
This commit is contained in:
parent
962d814e52
commit
abe082e7d0
@ -192,6 +192,7 @@ char*
|
||||
get_prot_param(char *param)
|
||||
{
|
||||
int i, filter_size;
|
||||
ParFilterDynamic *elem;
|
||||
|
||||
if (param == NULL)
|
||||
return NULL;
|
||||
@ -209,6 +210,13 @@ get_prot_param(char *param)
|
||||
}
|
||||
}
|
||||
|
||||
for (elem = filter_dynamic; elem != NULL; elem = elem->next) {
|
||||
if (elem->prot && elem->ptype == PARAM_PTR
|
||||
&& !strncmp(param, (char*)(elem->param), MAX_PARAM_LEN)) {
|
||||
return (char*)(elem->param);
|
||||
}
|
||||
}
|
||||
|
||||
log_warn(LD_BUG, "(Sandbox) Parameter %s not found", param);
|
||||
return param;
|
||||
}
|
||||
@ -272,6 +280,13 @@ add_dynamic_param_filter(char *syscall, char ptype, char pindex, intptr_t val)
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: and so on ..?
|
||||
if (!strcmp(syscall, "open")) {
|
||||
(*elem)->syscall = SCMP_SYS(open);
|
||||
} else if (!strcmp(syscall, "rt_sigaction")) {
|
||||
(*elem)->syscall = SCMP_SYS(rt_sigaction);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -81,6 +81,8 @@ typedef struct pfd_elem ParFilterDynamic;
|
||||
void sandbox_set_debugging_fd(int fd);
|
||||
int tor_global_sandbox(void);
|
||||
char* get_prot_param(char *param);
|
||||
int add_dynamic_param_filter(char *syscall, char ptype, char pindex,
|
||||
intptr_t val);
|
||||
|
||||
#endif /* SANDBOX_H_ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user