Simon McVittie
d4f0cf25ba
credentials: Invalid Linux struct ucred means "no information"
...
On Linux, if getsockopt SO_PEERCRED is used on a TCP socket, one
might expect it to fail with an appropriate error like ENOTSUP or
EPROTONOSUPPORT. However, it appears that in fact it succeeds, but
yields a credentials structure with pid 0, uid -1 and gid -1. These
are not real process, user and group IDs that can be allocated to a
real process (pid 0 needs to be reserved to give kill(0) its documented
special semantics, and similarly uid and gid -1 need to be reserved for
setresuid() and setresgid()) so it is not meaningful to signal them to
high-level API users.
An API user with Linux-specific knowledge can still inspect these fields
via g_credentials_get_native() if desired.
Similarly, if SO_PASSCRED is used to receive a SCM_CREDENTIALS message
on a receiving Unix socket, but the sending socket had not enabled
SO_PASSCRED at the time that the message was sent, it is possible
for it to succeed but yield a credentials structure with pid 0, uid
/proc/sys/kernel/overflowuid and gid /proc/sys/kernel/overflowgid. Even
if we were to read those pseudo-files, we cannot distinguish between
the overflow IDs and a real process that legitimately has the same IDs
(typically they are set to 'nobody' and 'nogroup', which can be used
by a real process), so we detect this situation by noticing that
pid == 0, and to save syscalls we do not read the overflow IDs from
/proc at all.
This results in a small API change: g_credentials_is_same_user() now
returns FALSE if we compare two credentials structures that are both
invalid. This seems like reasonable, conservative behaviour: if we cannot
prove that they are the same user, we should assume they are not.
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-23 10:05:44 -05:00
..
2018-01-05 13:01:03 +00:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:05:44 -05:00
2017-05-29 19:53:34 +02:00
2018-04-18 15:37:33 +01:00
2018-02-21 13:57:10 +00:00
2021-06-23 10:05:44 -05:00
2018-02-21 13:57:10 +00:00
2018-02-21 13:57:10 +00:00
2016-07-19 14:18:49 +01:00
2009-03-31 19:39:16 -04:00
2017-11-10 11:47:57 +00:00
2012-04-20 15:02:48 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-12 21:04:30 +01:00
2017-11-07 14:50:23 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-03-13 12:51:38 +00:00
2018-01-03 11:08:37 +00:00
2017-10-26 18:51:51 +02:00
2017-05-29 19:53:34 +02:00
2017-07-24 19:52:48 +02:00
2014-02-06 12:02:53 +00:00
2017-11-01 12:54:14 +00:00
2017-05-29 19:53:34 +02:00
2017-12-04 11:42:58 +00:00
2017-05-29 19:53:34 +02:00
2017-10-26 14:08:42 +02:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-05 20:42:06 +00:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:05:44 -05:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:05:44 -05:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-16 11:15:02 +00:00
2018-02-02 10:05:55 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-21 14:20:59 +00:00
2017-05-29 19:53:34 +02:00
2017-11-17 11:28:43 +00:00
2017-05-29 19:53:34 +02:00
2018-06-13 13:35:35 +01:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:05:44 -05:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-12-04 10:38:01 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-15 16:42:26 +00:00
2018-01-12 15:29:29 +00:00
2017-04-10 10:38:31 +01:00
2015-01-30 16:58:40 +01:00
2018-01-05 19:29:35 +00:00
2018-01-05 19:29:35 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-11 16:03:05 +00:00
2017-05-29 19:53:34 +02:00
2017-06-05 16:07:52 +01:00
2017-05-29 19:53:34 +02:00
2017-11-17 11:28:43 +00:00
2017-05-29 19:53:34 +02:00
2018-11-06 12:07:47 +00:00
2017-05-29 19:53:34 +02:00
2018-01-12 15:29:29 +00:00
2017-05-29 19:53:34 +02:00
2017-08-07 17:31:31 +01:00
2017-05-29 19:53:34 +02:00
2017-06-28 19:50:57 -04:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-10-11 16:36:20 +01:00
2017-05-29 19:53:34 +02:00
2017-12-04 11:42:58 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-12 11:33:12 +00:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-11-28 14:28:50 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-08 16:28:34 +01:00
2018-01-08 16:28:34 +01:00
2017-08-03 10:21:13 +01:00
2017-05-29 17:57:39 -04:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-06-13 14:08:50 +01:00
2021-06-23 10:03:59 -05:00
2018-01-15 18:26:56 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-12 16:36:16 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-06-09 16:45:09 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2016-06-15 16:15:12 -04:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-04 11:01:40 -05:00
2017-08-18 14:46:23 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-09 10:47:14 +01:00
2018-08-03 11:53:09 +01:00
2017-05-29 19:53:34 +02:00
2017-11-07 13:46:56 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-08-18 14:46:23 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-04 22:19:30 +01:00
2016-06-15 16:15:12 -04:00
2018-02-08 16:39:32 +00:00
2012-12-06 13:30:31 -05:00
2013-01-13 13:05:15 -05:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2018-01-04 11:01:40 -05:00
2018-01-04 11:01:40 -05:00
2018-01-18 10:12:26 +00:00
2018-01-04 11:01:40 -05:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-10-26 14:08:42 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-10-02 15:30:23 +01:00
2021-06-23 10:03:59 -05:00
2017-09-12 12:32:20 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-12-19 18:51:00 +08:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-11-06 12:07:47 +00:00
2017-11-01 12:46:38 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-12-04 11:42:58 +00:00
2017-05-29 19:53:34 +02:00
2018-04-18 15:37:33 +01:00
2017-05-29 19:53:34 +02:00
2017-11-01 12:46:38 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-17 11:28:43 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-28 14:14:19 +00:00
2017-05-29 19:53:34 +02:00
2018-01-08 11:50:26 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-28 15:07:27 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-06-03 10:30:17 +02:00
2017-06-03 10:30:17 +02:00
2018-02-01 14:58:28 +00:00
2018-01-09 16:24:27 +00:00
2018-01-09 16:24:27 +00:00
2018-08-16 16:53:53 -04:00
2017-05-29 19:53:34 +02:00
2018-09-13 14:11:30 +01:00
2017-05-29 19:53:34 +02:00
2018-02-28 17:39:04 +00:00
2017-05-29 19:53:34 +02:00
2018-08-17 00:03:32 +00:00
2017-05-29 19:53:34 +02:00
2017-12-04 11:42:58 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-23 14:24:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-08 15:16:19 +00:00
2017-06-03 10:30:17 +02:00
2017-10-17 14:10:31 +01:00
2017-05-29 19:53:34 +02:00
2017-12-11 11:40:14 +00:00
2018-02-13 08:04:24 -06:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-31 22:37:18 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-03-26 10:58:37 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-01 14:58:28 +00:00
2017-11-29 17:50:27 +00:00
2018-02-01 14:58:29 +00:00
2017-05-29 19:53:34 +02:00
2017-11-27 12:36:03 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-01 14:58:28 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-15 03:24:29 -08:00
2017-05-29 19:53:34 +02:00
2017-11-14 15:13:44 -08:00
2017-05-29 19:53:34 +02:00
2017-12-06 10:33:52 +00:00
2016-01-08 12:31:18 +09:00
2016-01-08 12:31:18 +09:00
2017-11-04 20:05:37 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-02 14:41:00 +01:00
2021-06-23 10:03:59 -05:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:03:59 -05:00
2021-06-23 10:03:59 -05:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-10-26 13:48:39 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-02-01 14:58:28 +00:00
2017-05-29 19:53:34 +02:00
2018-04-24 15:49:29 -04:00
2017-10-16 11:14:57 +01:00
2017-12-04 11:42:58 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-12 15:29:29 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-29 17:50:27 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-12-25 00:12:06 -08:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-08-30 13:25:35 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-10-26 18:51:51 +02:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-03-26 10:51:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-09-13 17:38:42 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-01-08 19:17:01 -06:00
2018-01-08 19:17:01 -06:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-07 14:51:12 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-09-21 12:05:06 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-06-29 07:11:54 +00:00
2017-10-26 00:19:23 +01:00
2017-08-03 10:21:13 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-08-03 11:53:09 +01:00
2017-05-29 19:53:34 +02:00
2018-08-03 11:53:09 +01:00
2018-08-03 11:53:09 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-12 16:36:16 +01:00
2017-05-29 19:53:34 +02:00
2017-10-11 13:18:49 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-08-16 16:53:53 -04:00
2018-01-18 10:12:26 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-06-01 11:00:28 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2021-06-23 10:03:59 -05:00
2018-08-22 18:08:46 +02:00
2017-06-03 10:30:17 +02:00
2018-08-16 16:54:14 -04:00
2017-06-03 10:30:17 +02:00
2017-06-03 10:30:17 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00