Commit Graph

842 Commits

Author SHA1 Message Date
Omar Polo 1a04137e18 tag 1.8.3 -- "Lightbulb Sun" bugfix release
gmid 1.8.3 "Lightbulb Sun" bugfix release
=========================================

Released March 27, 2022.

signify(1) pubkeys for this release:
RWTy3UJQzpxBUAymBwb2EGLLm0b3H/1n8hzhaC9HYFYzNuTavGt9QSwC


Bug Fixes
~~~~~~~~~

    * fix a possible out-of-bound access in the CGI handling.  It was
      introduced last October during a refactoring, but due to how
      many malloc(3) implementations works this hasn't been found
      until now.  Otto' malloc is more strict fortunately.
2022-03-27 12:59:57 +00:00
Omar Polo ea27eaaa83 fix an out-of-bound access in start_cgi
Long time ago, client->req was a static buffer so the memcpy was safe.
However, it's been since moved to a dynamically allocated string, so
it's very often smaller than sizeof(req.buf) (1024), hence the out of
bound access which results in a SIGSEGV very often on OpenBSD thanks to
Otto' malloc.

The situation with the iri parser, client->req and how the request is
forwarded to the other process needs to be improved: this is just a fix
to address the issue quickly, a better one would be to restructure the
iri parser APIs and rethink how the info is forwarded to the ex process.
2022-03-27 12:52:59 +00:00
Omar Polo 6084a9a5ba prefer sizeof(x) instead of datalen 2022-03-27 12:52:58 +00:00
Omar Polo 62a46b03c6 tag 1.8.2 -- "Lightbulb Sun" bugfix release
gmid 1.8.2 "Lightbulb Sun" bugfix release
=========================================

Released March 26, 2022.

signify(1) pubkeys for this release:
RWTy3UJQzpxBUAymBwb2EGLLm0b3H/1n8hzhaC9HYFYzNuTavGt9QSwC


Bug Fixes
~~~~~~~~~

    * fix a CGI timing issue: if a connection handled by a CGI scripts
      is interrupted with the right timing it causes the server
      process to exit with "fatal in client_by_id: invalid id X".


New Features
~~~~~~~~~~~~

    * add a new block `type { ... }' to define mime types mapping.


Improvements
~~~~~~~~~~~~

    * use shell built-in `command' instead of which(1), prodded by
      cage and Allen Sobot.

    * configure script: allow to set MANDIR from cmdline (Allen Sobot)

    * add systemd-sysusers sample file in contrib/ (Nakaya)

    * [linux/seccomp] allow fstatat64(2), llseek(2) and sigreturn(2),
      needed by glibc on armv7.  (Tobias Berger)

    * [linux/seccomp] tightens rules by allowing openat(2) only with
      the O_RDONLY flag.
2022-03-26 13:22:22 +00:00
Omar Polo da613aba4b bump Mdocdate 2022-03-26 13:22:13 +00:00
Omar Polo 57d2fca4b4 add target `test' alias for `regress' 2022-03-26 11:57:27 +00:00
Omar Polo 3fdc457c8d swap try_client_by_id with client_by_id
i.e. allow client_by_id to fail and return NULL.

Initially I thought it was a good idea to shut down a server process
if we receive an invalid client id as reply from one of our requests
to the executor process.  This turned out not to be correct since a
client can (read: will) disconnect in the delay beteewn we acknowledge
their request and the cgi script execution.

The fastcgi and proxy handler already handled this situation, so
they're unaffected.

This allows an attacker to make gmid unresponsible by just making
enough requests until they hit the right timing.
2022-03-26 11:32:26 +00:00
Omar Polo 409a2599b3 move to a different server 2022-03-26 11:18:02 +00:00
Omar Polo 91971201e5 break out if check_reply fails
it's not a problem when we have only one check_reply at then end,
since $? is kept across function boundaries, but when we have multiple
checks we need to quit on the first error.
2022-03-26 10:56:06 +00:00
Omar Polo 894e998423 sync imsg-buffer.c
original commit from eric@:

 change the barrier so that fd's are always passed and received with
 the first byte of the imsg they belong to.

 idea, tweaks and ok claudio@
2022-03-19 14:54:31 +00:00
Omar Polo c7949fd545 sync recallocarary.c
original commit from claudio@:

 Type-cast getpagesize() from int to size_t for the comparison with d.
 getpagesize() will only return positive numbers (there is no negative
 page size system) and it can not fail.
 Should fix some compiler warnings seen in -portable projects.
 OK otto@
2022-03-19 14:52:11 +00:00
Omar Polo e5d82d9472 const-ify some tables
matches found with

	% grep -R '=[	 ]*{' . | fgrep -v const
2022-03-19 11:02:42 +00:00
Omar Polo 9db5e7051e get rid of `which` in the configure too
should have been done already in 12fcba2; reminded by Allen Sobot,
thanks!
2022-03-18 16:31:05 +00:00
Omar Polo 5f966fbe41 configure: allow to set MANDIR from args
diff by Allen Sobot (chilledfrogs at disroot dot org), thanks!
2022-03-18 16:23:45 +00:00
Omar Polo a00e67f1bf mention gmid.sysusers in contrib together with gmid.service
related to github issue #14
2022-03-09 16:43:22 +00:00
Omar Polo efd54f4f8a add missing newline 2022-03-09 16:35:28 +00:00
Nakaya 3c04ffc096 add description about systemd-sysusers on quickstart 2022-03-09 17:33:33 +01:00
Nakaya bff125b842 add systemd-sysusers' config file 2022-03-09 17:33:33 +01:00
Omar Polo 12fcba2f80 use shell built-in `command' instead of which(1)
it's specified by POSIX AFAIK and requires less redirections.
2022-02-27 16:24:45 +00:00
Omar Polo cd3e28ffe4 fix email 2022-02-26 14:19:30 +00:00
Omar Polo 74994ae7e5 sync changelog 2022-02-26 14:19:24 +00:00
Omar Polo e0bf950dff document the type { ... } block 2022-02-26 14:13:46 +00:00
Omar Polo fb1212266f add tests for the type block 2022-02-26 14:02:45 +00:00
Omar Polo ee219d702e add type { ... } block to define mime types mapping
The `map' rule is powerful but quite annoying to use if you have/need
lots of entries (and clutters the configuration file too.)

The `type' block is blatantly stolen from httpd(8) and allows for a way
more nice usage:

	type {
		include "/usr/share/misc/mime.types"
	}

or even

	type {
		text/markdown		md markdown
		text/x-perl		pl pm
		# ...
	}
2022-02-26 14:00:20 +00:00
Omar Polo 88971f9a4e add missing token include to the list of tokens 2022-02-26 13:49:24 +00:00
Omar Polo d98ae929b2 don't log errno, it's always zero after libtls returns
The libevent error value is much more interesting!
see github issue #13
2022-02-19 18:11:05 +00:00
Omar Polo ed78e81b9c remove paragraph "locally installed libressl" + some tweaks
libtls is now widely available, it's at least on gentoo, arch, void,
alpine, fedora and debian sid; there's no need to show how to compile to
a locally installed one.
2022-02-18 09:09:23 +00:00
Omar Polo c273bc0e41 sync changelog 2022-02-13 16:21:37 +00:00
Omar Polo 4f0e893cd3 tightens seccomp filter: allow only openat(O_RDONLY)
be more strict and allow an openat only with the O_RDONLY flag.  This
is kind of redundant with landlock, but still good to have.  Landlock
is not yet widely available and won't kill the process upon policy
violation; furthermore, landlock can be disabled at boot time.

tested on GNU and musl libc on arch and alpine amd64.
2022-02-13 16:20:27 +00:00
Omar Polo 94c5f99ab0 sort syscalls in seccomp filter 2022-02-13 15:32:10 +00:00
Omar Polo 67347fb021 sync changelog 2022-02-13 15:29:20 +00:00
Tobias Berger d0e0be1e43 Allow Arch-Armv7 syscalls in sandbox.c 2022-02-13 15:29:33 +01:00
Omar Polo c6ae2561a0 update the site for the release 2022-02-10 23:14:32 +00:00
Omar Polo b4b432e78e sync changelog 2022-02-10 23:14:17 +00:00
Omar Polo f2dbf375a0 tag 1.8.1 -- "Lightbulb Sun" bugfix release
gmid 1.8.1 "Lightbulb Sun" bugfix release
=========================================

Released Feb 10, 2022.

signify(1) pubkeys for this release:
RWTy3UJQzpxBUAymBwb2EGLLm0b3H/1n8hzhaC9HYFYzNuTavGt9QSwC


Bug fixes
---------

    * fix landlock usage on linux: don't assume that access
      capabilities not listed are implicitly denied, because they are
      not.  Mickaël Salaün, the landlock author, found the same error
      on game of trees:

> In a nutshell, the ruleset's handled_access_fs is required for
> backward and forward compatibility (i.e. the kernel and user space may
> not know each other's supported restrictions), hence the need to be
> explicit about the denied-by-default access rights.

      In practice this affects only linux and only partially: thanks
      to the design of the daemon and the seccomp filter the effects
      of this mistake in handling landlock are fortunately limited.
      However, in theory at least, gmid could be for e.g. tricked into
      truncating existing files, so it's highly suggested to update.


Improvements
------------

All by Anna “CyberTailor”, thanks!

    * don't skip unit tests when SKIP_RUNTIME_TEST is set
    * add `gg' to the regress target dependencies
    * fix the "implicit declaration of asprintf" warning
    * sync vim syntax
2022-02-10 22:51:32 +00:00
Omar Polo 98c6f8de41 fix landlock usage
Mickaël Salaün, the landlock author, pointed out the same error on the
got implementation.  The assumption that not listed access
capabilities are implicitly denied is completely wrong:

> In a nutshell, the ruleset's handled_access_fs is required for
> backward and forward compatibility (i.e. the kernel and user space may
> not know each other's supported restrictions), hence the need to be
> explicit about the denied-by-default access rights.
2022-02-10 22:29:51 +00:00
Anna “CyberTailor” be88c5d657 sync vim syntax 2022-02-03 11:13:45 +01:00
Anna “CyberTailor” 1f1f381068 include gmid.h before other headers to get all the prototypes
> implicit declaration of function 'asprintf'; did you mean 'vsprintf'?
2022-02-03 11:13:45 +01:00
Anna “CyberTailor” e20755180f add gg to `make regress` dependencies 2022-02-03 11:13:44 +01:00
Anna “CyberTailor” c1a72dab7a typo 2022-02-03 11:13:43 +01:00
Anna “CyberTailor” 1ca7a0f3bf don't skip unit tests when SKIP_RUNTIME_TESTS is set
IRI and Punycode tests don't run gmid binary and can be safely executed.
2022-02-03 11:13:41 +01:00
Omar Polo f525aa55b8 start new release cycle 2022-02-03 09:57:51 +00:00
Omar Polo a14b9f779f prepare 1.8 release 2022-01-30 13:35:45 +00:00
Omar Polo de721c431c add changelog for 1.8 2022-01-30 13:35:45 +00:00
Omar Polo 135307cfb0 install gg too 2022-01-30 13:35:45 +00:00
Omar Polo d78dbe8db5 fix gg -P flag description: the `:' is in the optional part 2022-01-30 13:31:29 +00:00
Omar Polo 5266f50060 posixify lib.sh: use = instead of == for test(1) 2022-01-30 13:31:29 +00:00
Omar Polo 7ac42a178b typo 2022-01-30 13:05:13 +00:00
Omar Polo d23cd12c68 sync changelog 2022-01-30 13:05:13 +00:00
Omar Polo c586dfead7 rename MIME section to "MEDIA TYPES" 2022-01-30 10:15:10 +00:00