gecko-dev/security
Jed Davis 9d31470f82 Bug 1855341 - Fix Linux sandbox broker readlink emulation when the result is truncated. r=gcp
Normally, when `readlink` is called with a buffer that's smaller than
the symlink target, the string will be silently truncated and `readlink`
returns the number of bytes actually written (== the buffer size); the
caller is expected to detect this and enlarge the buffer as needed.

In the broker protocol, the client sends the buffer size in the request,
and then reads the response directly into the buffer.  The bug is that
the broker ignores the requested size and sends the entire response; as
a result, the response is truncated by `recvmsg` and the `MSG_TRUNC`
flag is set.  We don't expect `MSG_TRUNC`, so this either sets off a
diagnostic assertion or else fails with the implausible error `EMFILE`
("Too many open files", because it's treated the same as `MSG_CTRUNC`).

The fix simply is for the broker to respect the client's advertised
buffer size as intended; the error handling is also improved.

Note that `EMSGSIZE` is not used as a pseudo-error here, even though
"Message too long" might make sense as an error message, to avoid
confusion with the real `EMSGSIZE` that can be returned by `sendmsg`.

Differential Revision: https://phabricator.services.mozilla.com/D192530
2023-12-04 17:46:00 +00:00
..
certverifier Bug 1611381 - attempt to detect more self-signed certificates r=jschanck 2023-12-01 16:42:25 +00:00
ct Bug 1861620 - CTTestUtils: simplify the code by removing some unnecessary else r=sylvestre DONTBUILD 2023-11-01 08:02:54 +00:00
mac/hardenedruntime Bug 1865128 - Use full bundle id in entitlements r=haik,releng-reviewers,taskgraph-reviewers,bhearsum 2023-11-20 23:41:42 +00:00
manager Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot 2023-12-04 10:09:36 +00:00
nss Bug 1856659 - land NSS NSS_3_95_RTM UPGRADE_NSS_RELEASE, r=nss-reviewers,jschanck 2023-11-16 22:58:56 +00:00
rlbox Bug 1854519 - Fix build bustages. a=test-fix CLOSED TREE 2023-09-29 01:32:05 +03:00
sandbox Bug 1855341 - Fix Linux sandbox broker readlink emulation when the result is truncated. r=gcp 2023-12-04 17:46:00 +00:00
.eslintrc.js
generate_mapfile.py
moz.build Bug 1851092 - land NSS NSS_3_94_RTM UPGRADE_NSS_RELEASE, r=nss-reviewers,jschanck 2023-10-02 20:43:59 +00:00
nss.symbols