diff options
| author | Roy Marples <roy@marples.name> | 2020-05-20 15:44:19 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-05-20 15:44:19 +0000 |
| commit | 4c0e19350f76c7a2939c90c2f5e38b14fc2630f8 (patch) | |
| tree | a92e3970e0edd7a216beb3854ad5a54bd91a5137 /src/privsep-root.c | |
| parent | aaa5b2fcd1855a4d054f100b55927e97609c5bd7 (diff) | |
| download | dhcpcd-4c0e19350f76c7a2939c90c2f5e38b14fc2630f8.tar.xz | |
privsep: Ensure we don't scribble garbage to BPF
Well, it's not garbage, it's a privsep IPC message telling us to
start BPF which the BPF process should not have recieved!
Add code to ensure this cannot happen.
Diffstat (limited to 'src/privsep-root.c')
| -rw-r--r-- | src/privsep-root.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/privsep-root.c b/src/privsep-root.c index 69b9e371..f511a43f 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -409,8 +409,10 @@ ps_root_recvmsgcb(void *arg, struct ps_msghdr *psm, struct msghdr *msg) ps_freeprocess(psp); return ret; - } - return ps_sendpsmmsg(ctx, psp->psp_fd, psm, msg); + } else if (!(psm->ps_cmd & PS_START)) + return ps_sendpsmmsg(ctx, psp->psp_fd, psm, msg); + /* Process has already started .... */ + return 0; } if (psm->ps_cmd & PS_STOP && psp == NULL) |
