Commit Diff
- Commit:
8014df0d405ec7c719abd9d73b27bdbf9806c040ed5455579d3d84b2b6973c13- From:
- Henry Ford <henryfordkjv@gmail.com>
- Via:
- Stefan Sperling <stsp@stsp.name>
- Date:
- Message:
- prevent non-root users from blocking gotctl reload requests Patch by: Henry Ford The bug fixed here is as follows, in Henry's words: If a GOTD_IMSG_RELOAD message is sent by a non root user, then gotd(8) will deny the request. However, gotd(8) will accept a GOTD_IMSG_RELOAD_SECRETS message from any client regardless of their uid. After receiving a GOTD_IMSG_RELOAD_SECRETS message gotd(8) will not accept another such message until it receives a GOTD_IMSG_RELOAD message to complete the reload request. Thus, a non root user can block any future gotctl(8) reload requests from succeeding by sending a GOTD_IMSG_RELOAD_SECRETS message to gotd(8). You can reproduce this by running the following commands with gotd(8) running: $ gotctl reload -c /dev/null gotctl: reload: Operation not permitted # gotctl reload gotctl: received unexpected privsep message
- Actions:
- Patch | Tree
--- gotd/gotd.c +++ gotd/gotd.c @@ -983,6 +983,10 @@ gotd_request(int fd, short events, void *arg) err = stop_gotd(client); break; case GOTD_IMSG_RELOAD_SECRETS: + if (client->euid != 0) { + err = got_error_set_errno(EPERM, "reload"); + break; + } if (have_reload_secrets) { err = got_error(GOT_ERR_PRIVSEP_MSG); break;
