]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
4 months agorelease: Default to gpg2 to avoid SHA1 signatures dhcpcd-9
Roy Marples [Tue, 25 Feb 2025 11:54:01 +0000 (11:54 +0000)] 
release: Default to gpg2 to avoid SHA1 signatures

Fixes #457

13 months agoDHCP: Don't enforce the message came port 67
Roy Marples [Mon, 8 May 2023 14:52:11 +0000 (15:52 +0100)] 
DHCP: Don't enforce the message came port 67

RFC2131 and updates make no mention of what the source port
should or must be.

Update for #179.

13 months agoprivsep: Allow zero length messages through
Roy Marples [Sat, 15 Jun 2024 09:04:06 +0000 (10:04 +0100)] 
privsep: Allow zero length messages through

They should be handled gracefully without privsep anyway.
Fix for #179.

23 months agoDo not crash on dhcpcd test run (#231)
Petr Menšík [Fri, 4 Aug 2023 16:45:25 +0000 (18:45 +0200)] 
Do not crash on dhcpcd test run (#231)

Check if state->bpf is allocated before attempting to write there.

23 months agodhcpcd: Fix off-by-one overflow when read() writes full BUFSIZ (#236)
Tobias Heider [Sat, 12 Aug 2023 19:59:21 +0000 (21:59 +0200)] 
dhcpcd: Fix off-by-one overflow when read() writes full BUFSIZ (#236)

23 months agoman: Sync with master branch
Roy Marples [Wed, 23 Aug 2023 09:07:25 +0000 (10:07 +0100)] 
man: Sync with master branch

Fixes #230

2 years agoRelease dhcpcd-9.5.2 v9.5.2
Roy Marples [Wed, 19 Jul 2023 13:31:13 +0000 (14:31 +0100)] 
Release dhcpcd-9.5.2

2 years agoprivsep: Send only what we have put in the buffer to script env
Roy Marples [Wed, 19 Jul 2023 11:42:49 +0000 (12:42 +0100)] 
privsep: Send only what we have put in the buffer to script env

Rather then sending the whole buffer size.
If there is an error writing the last option, it may not be
NUL terminated correctly causing an assert.
Even so, we should not write the failed option to the environment
either as it would be a false positive for an empty option.

2 years agocommon: Allow hwaddr_ntoa to print an empty string
Roy Marples [Mon, 3 Jul 2023 12:11:05 +0000 (13:11 +0100)] 
common: Allow hwaddr_ntoa to print an empty string

This fixes #218 where we get a zero hardware address length in
an ARP packet or a length that overflows the string buffer.

2 years agocommon: Improve valid_domain and check correct return
Roy Marples [Mon, 3 Jul 2023 11:52:19 +0000 (12:52 +0100)] 
common: Improve valid_domain and check correct return

Improvement for #218.

2 years agoLinux: fix disabling of kernel RA autoconf
Roy Marples [Thu, 18 May 2023 11:27:10 +0000 (12:27 +0100)] 
Linux: fix disabling of kernel RA autoconf

Well, that was a big whups leaving it turned on.
Thanks to Klaus Frank for the spot.
Fixes #176.

2 years agoconfigure: --prefix also sets $prefix for compat with autoconf
Roy Marples [Mon, 17 Oct 2022 13:30:03 +0000 (14:30 +0100)] 
configure: --prefix also sets $prefix for compat with autoconf

Fixes #139

2 years agochore: stat isn't portable, wc is
Roy Marples [Fri, 21 Apr 2023 13:58:25 +0000 (14:58 +0100)] 
chore: stat isn't portable, wc is

2 years agochore: include filesize in the distinfo
Roy Marples [Fri, 21 Apr 2023 10:08:32 +0000 (11:08 +0100)] 
chore: include filesize in the distinfo

2 years agochore: fix release v9.5.1
Roy Marples [Thu, 20 Apr 2023 11:12:14 +0000 (12:12 +0100)] 
chore: fix release

2 years agoRelease dhcpcd-9.5.1
Roy Marples [Thu, 20 Apr 2023 11:05:04 +0000 (12:05 +0100)] 
Release dhcpcd-9.5.1

2 years agochore: update build system to publish signed github releases
Roy Marples [Thu, 20 Apr 2023 11:00:32 +0000 (12:00 +0100)] 
chore: update build system to publish signed github releases

We rely on the GitHub CLI tools to do this.
We publish the compressed source tarball and a detached PGP
signature for it.
We add the SHA256 checksum of the tarball as a note on the release.
Automatic links to the changes are also given.

2 years agobpf: for SMALL systems skip the bpfN checks
Roy Marples [Fri, 14 Apr 2023 10:08:24 +0000 (11:08 +0100)] 
bpf: for SMALL systems skip the bpfN checks

2 years agobpf: Always open /dev/bpf directly
Roy Marples [Thu, 13 Apr 2023 16:43:11 +0000 (17:43 +0100)] 
bpf: Always open /dev/bpf directly

Ignore _PATH_BPF as that's really a NetBSDism.
If /dev/bpf throws a wobbly then try /dev/bpfN for older kernels.

This allows cloning BPF on more BSD systems.

2 years agoRelease dhcpcd-9.5.0 v9.5.0
Roy Marples [Tue, 11 Apr 2023 13:01:06 +0000 (14:01 +0100)] 
Release dhcpcd-9.5.0

2 years agoprivsep-linux: fix SECCOMP_AUDIT_ARCH missing ppc64le (#181)
CHEN Xiangyu [Thu, 9 Feb 2023 10:41:52 +0000 (18:41 +0800)] 
privsep-linux: fix SECCOMP_AUDIT_ARCH missing ppc64le (#181)

when dhcpcd running on ppc64le platform, it would be killed by SIGSYS.

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
2 years agooptions: Fix prior
Roy Marples [Tue, 7 Feb 2023 17:02:29 +0000 (17:02 +0000)] 
options: Fix prior

For #184.

2 years agooptions: Match exact string for environment changes
Roy Marples [Tue, 7 Feb 2023 16:39:27 +0000 (16:39 +0000)] 
options: Match exact string for environment changes

So that domain_name doesn't overwrite domain_name_servers.
Fixes #184.

2 years agoFix incorrect CTASSERT in ND_OPT_DNSSL (#178)
Klaus Frank [Thu, 26 Jan 2023 10:23:55 +0000 (10:23 +0000)] 
Fix incorrect CTASSERT in ND_OPT_DNSSL (#178)

Fix incorrect CTASSERT in ND_OPT_DNSSL

2 years agoprivsep: Correct prior for dhcpcd-9
Roy Marples [Mon, 9 Jan 2023 16:42:00 +0000 (16:42 +0000)] 
privsep: Correct prior for dhcpcd-9

2 years agoprivsep: Unload dev early if we are not the root process
Roy Marples [Mon, 9 Jan 2023 16:35:37 +0000 (16:35 +0000)] 
privsep: Unload dev early if we are not the root process

No point listening to it and newer udev throws an error
trying to unload when chrooted so this fixes that.

2 years agocompat: Remove literal suffix from md5.h
Roy Marples [Mon, 9 Jan 2023 11:16:13 +0000 (11:16 +0000)] 
compat: Remove literal suffix from md5.h

Modern compilers no longer complain without it, but do with it.

2 years agolinux: clean some more compiler warnings
Roy Marples [Mon, 9 Jan 2023 11:15:13 +0000 (11:15 +0000)] 
linux: clean some more compiler warnings

gcc-12 and clang-14 no longer emit any errors

2 years agolinux: Fix compile warning using clang
Roy Marples [Mon, 9 Jan 2023 10:09:45 +0000 (10:09 +0000)] 
linux: Fix compile warning using clang

2 years agoconfigure: Ensure that we use the return of the functions we test
Roy Marples [Sun, 8 Jan 2023 22:10:21 +0000 (22:10 +0000)] 
configure: Ensure that we use the return of the functions we test

As newer compiler defaults warn if they are not used.
Should fix #163.

2 years agoprivsep: Try sending error if we cannot send the message.
Roy Marples [Fri, 6 Jan 2023 11:14:45 +0000 (11:14 +0000)] 
privsep: Try sending error if we cannot send the message.

There is an error sending a reply from an INET6 sysctl RT dump
on FreeBSD-14 using the dhcpcd-9 branch.
It seems to be related to capsicum and doesn't happen on FreeBSD-13.
We should handle the error gracefully and allow dhcpcd to try to
contuinue regardless.

2 years agooptions: Fix parsing of strings.
Roy Marples [Fri, 23 Dec 2022 17:35:29 +0000 (17:35 +0000)] 
options: Fix parsing of strings.

If we are not passed a buffer we should blindly return the
result of trying to parse it has as a hex string - it will be zero.
Fixes 133.

2 years agoif: Again fix prior on NetBSD
Roy Marples [Fri, 23 Dec 2022 16:15:58 +0000 (16:15 +0000)] 
if: Again fix prior on NetBSD

2 years agoif: Fix issue with prior with privsep enabled
Roy Marples [Fri, 23 Dec 2022 16:13:09 +0000 (16:13 +0000)] 
if: Fix issue with prior with privsep enabled

Addition to #157.

2 years agoDHCP: Set option buffer length to 0 when freeing
Roy Marples [Fri, 23 Dec 2022 14:24:59 +0000 (14:24 +0000)] 
DHCP: Set option buffer length to 0 when freeing

As we test length of buffer when reallocating.
Fixes #156.

2 years agoif: Add if_freeifaddrs so we can free ifaddrs on all code paths
Roy Marples [Fri, 23 Dec 2022 13:54:22 +0000 (13:54 +0000)] 
if: Add if_freeifaddrs so we can free ifaddrs on all code paths

Fixes #157.

2 years agoFix prior when asking dhcpcd to exit and it's not running
Roy Marples [Fri, 2 Sep 2022 11:02:25 +0000 (12:02 +0100)] 
Fix prior when asking dhcpcd to exit and it's not running

2 years agodhcpcd: Fix sending interface specific commands to manager process
Roy Marples [Thu, 1 Sep 2022 19:48:40 +0000 (20:48 +0100)] 
dhcpcd: Fix sending interface specific commands to manager process

Seems to have been broken for a while .... good to have this fixed.

2 years agoNormalise `dhcpcd is not running` message
Roy Marples [Wed, 31 Aug 2022 19:04:11 +0000 (20:04 +0100)] 
Normalise `dhcpcd is not running`  message

2 years agoDHCP: Only test not BOUND when finishing DAD
Roy Marples [Tue, 30 Aug 2022 16:23:27 +0000 (17:23 +0100)] 
DHCP: Only test not BOUND when finishing DAD

This fixes using a last lease on initial boot when the DHCP
server is not present.

2 years agoDHCP6: T1, T2, vltime and pltime SHOULD be zero from client messages
Roy Marples [Mon, 29 Aug 2022 16:58:18 +0000 (17:58 +0100)] 
DHCP6: T1, T2, vltime and pltime SHOULD be zero from client messages

See RFC 8415 21.4, 21.6, 21.21 and 21.22.
As such it's impossible to request a lease time as such and we
MUST use the vltimes and pltimes sent by the server.

This addresses the concern in #116 but does fix it as it's not a dhcpcd
problem.

2 years agocapsicum: Fix an issue with the cherry pick of NET_RT_DUMP sysctl
Roy Marples [Fri, 26 Aug 2022 10:36:55 +0000 (11:36 +0100)] 
capsicum: Fix an issue with the cherry pick of NET_RT_DUMP sysctl

2 years agoDHCP6: we multicast, not broadcast
Roy Marples [Fri, 26 Aug 2022 10:22:05 +0000 (11:22 +0100)] 
DHCP6: we multicast, not broadcast

We have always multicast, just used the wrong terminology.
Addresses #122.

2 years agoprivsep: Allow newfstatat syscall as well
Roy Marples [Fri, 26 Aug 2022 08:24:50 +0000 (09:24 +0100)] 
privsep: Allow newfstatat syscall as well

Allows newer glibc variants to work apparently.
As reported in #84 and #89.

2 years agoprivsep: Allow getrandom sysctl for newer glibc
Roy Marples [Fri, 26 Aug 2022 08:08:36 +0000 (09:08 +0100)] 
privsep: Allow getrandom sysctl for newer glibc

Fixes #120

2 years agoOpenBSD: Fix compile with prior
Roy Marples [Wed, 24 Aug 2022 09:17:42 +0000 (10:17 +0100)] 
OpenBSD: Fix compile with prior

2 years agoClean some compile warnings with prior
Roy Marples [Wed, 24 Aug 2022 09:10:48 +0000 (10:10 +0100)] 
Clean some compile warnings with prior

2 years agocapsicum: sysctl NET_RT_DUMP is a privileged operation
Roy Marples [Wed, 24 Aug 2022 09:04:19 +0000 (10:04 +0100)] 
capsicum: sysctl NET_RT_DUMP is a privileged operation

2 years agoBSD: Fix an error parsing the routing table
Roy Marples [Tue, 23 Aug 2022 12:57:17 +0000 (13:57 +0100)] 
BSD: Fix an error parsing the routing table

Also report any errors reading the routing table.

3 years agooptions: Ensure that we correctly read auth tokens.
Roy Marples [Fri, 29 Jul 2022 07:00:09 +0000 (08:00 +0100)] 
options: Ensure that we correctly read auth tokens.

3 years agohooks: Use command -v rather than type
Roy Marples [Thu, 24 Feb 2022 12:53:02 +0000 (12:53 +0000)] 
hooks: Use command -v rather than type

command -v is now required by POSIX, type is technically an extension.

3 years agoBump dates for prior
Roy Marples [Thu, 24 Feb 2022 06:34:10 +0000 (06:34 +0000)] 
Bump dates for prior

3 years agoFixes manual page typos found by Lintian
Martin-Éric Racine [Thu, 24 Feb 2022 06:28:21 +0000 (06:28 +0000)] 
Fixes manual page typos found by Lintian

3 years agoFix compile issue with prior
Roy Marples [Sun, 5 Dec 2021 11:04:16 +0000 (11:04 +0000)] 
Fix compile issue with prior

3 years agodhcpcd.8: remove reference to 02-dump hook script
Roy Marples [Sat, 13 Nov 2021 14:10:31 +0000 (14:10 +0000)] 
dhcpcd.8: remove reference to 02-dump hook script

This hook script was removed a while ago.
Fixes #72.

3 years agoAdd epair(4) to the ignored interface types list (#73)
Ben Woods [Sat, 13 Nov 2021 13:53:58 +0000 (21:53 +0800)] 
Add epair(4) to the ignored interface types list (#73)

The FreeBSD epair(4) interface type can be thought of as a virtual patch cable.
The epair interfaces come in pairs, with network traffic being passed between the 2 pairs.
The basic intent is to provide connectivity between two virtual network stack instances.
This interface type does not typically require an IP address, as it is passing traffic
between other virtual networks/interfaces which obtain their own IP address.
Therefore, add this interface type to the list that will be ignored by dhcpcd.

3 years agoprivsep: Only set RLIMIT_NOFILES for supported platforms
Roy Marples [Sat, 13 Nov 2021 14:08:54 +0000 (14:08 +0000)] 
privsep: Only set RLIMIT_NOFILES for supported platforms

Basically only for NetBSD, DragonFlyBSD, kqueue or epoll platforms.
All others will use poll(2) and return EINVAL if nfds > RLIMIT_NOFILES.

Trying to work out our nfs limit relies on already listening to
all FD's which may not be the case and was problematic.
Luckily all platforms aside from Solaris have new file creation
sandboxed away aside from accept(2) so this should still be safe.

3 years agoRevert "eloop: Allow eloop to process all fds returned from poll(2)"
Roy Marples [Fri, 12 Nov 2021 16:24:32 +0000 (16:24 +0000)] 
Revert "eloop: Allow eloop to process all fds returned from poll(2)"

This stops dumping leases when privsep is compiled out.
This change works fine on master, but we also have eloop using
more of a native poll(2) style interface.
Easier for now to just revert this on the dhcpcd-9 branch.

This reverts commit fe2b82eec25da908c3a1a71c2dc2402d9ff70e31.

3 years agocontrol: Don't log eloop errors when freeing
Roy Marples [Fri, 12 Nov 2021 14:41:24 +0000 (14:41 +0000)] 
control: Don't log eloop errors when freeing

We might not be actively listening to or awaiting writes from the fd.

3 years agoRelease dhcpcd-9.4.1 v9.4.1
Roy Marples [Fri, 22 Oct 2021 11:56:19 +0000 (12:56 +0100)] 
Release dhcpcd-9.4.1

3 years agoprivsep: and again on OpenBSD
Roy Marples [Wed, 20 Oct 2021 10:21:38 +0000 (11:21 +0100)] 
privsep: and again on OpenBSD

3 years agoprivsep: Fix compile on Dragonfly BSD
Roy Marples [Wed, 20 Oct 2021 09:23:19 +0000 (10:23 +0100)] 
privsep: Fix compile on Dragonfly BSD

3 years agoREADME.md: Remove non existant man page links.
Roy Marples [Mon, 18 Oct 2021 14:25:35 +0000 (15:25 +0100)] 
README.md: Remove non existant man page links.

They have not been online for sometime and are unlikely to return.
While here, correct the commit log location.

Fixes #39

3 years agoDHCP: Set INFORM state only when we are about to inform
Roy Marples [Thu, 14 Oct 2021 05:31:11 +0000 (06:31 +0100)] 
DHCP: Set INFORM state only when we are about to inform

As we may not find an address right away.
While here, tidy up and comment code about deriving the address
when none is specified for inform and static setups.

3 years agoDHCP: Fix infinite INFORM messages
Kaelan Mikowicz [Thu, 14 Oct 2021 05:14:45 +0000 (22:14 -0700)] 
DHCP: Fix infinite INFORM messages

When an address is configured on the interface, do not send an
INFORM message if the interface is already bound.

Fixes #48

3 years agoprivsep: Fix getting interface VLANID on BSD (#58)
Philip Paeps [Tue, 12 Oct 2021 08:07:28 +0000 (16:07 +0800)] 
privsep: Fix getting interface VLANID on BSD (#58)

Include relevant headers for the definition of SIOCGETVLAN.  This fixes
DHCPv6 Prefix Delegation where a prefix is delegated to several VLAN
interfaces on the same physical interface.

3 years agoDHCP6: Don't spam the log when a RA repeatedly triggers an INFORM
Roy Marples [Fri, 1 Oct 2021 15:25:53 +0000 (16:25 +0100)] 
DHCP6: Don't spam the log when a RA repeatedly triggers an INFORM

This can occur if the RA reduces the prefix times in accordance
with it's own lifetimes for example.
dhcpcd only checks if the RA contents have changed to trigger a
new INFORM.

As such, only log about new INFORMs.

Fixes #46.

3 years agoprivsep: Enforce proper alignment of serialized struct cmsghdr
Marian Cingel [Tue, 31 Aug 2021 12:33:20 +0000 (13:33 +0100)] 
privsep: Enforce proper alignment of serialized struct cmsghdr

Fixes #43.

3 years agoDHCP6: Only send FQDN for SOLICIT, REQUEST, RENEW, or REBIND messages.
Roy Marples [Tue, 31 Aug 2021 09:57:44 +0000 (10:57 +0100)] 
DHCP6: Only send FQDN for SOLICIT, REQUEST, RENEW, or REBIND messages.

As per RFC 4704 section 5.
Fixes #44.

3 years agoFix rt_cmp_dest() for equivalent network prefixes with different netmasks. (#52)
Stefan Sperling [Tue, 31 Aug 2021 09:31:15 +0000 (11:31 +0200)] 
Fix rt_cmp_dest() for equivalent network prefixes with different netmasks. (#52)

When rt_add() decides that it must delete+add a route in order to change
the routing table entry, a wrong RB tree lookup result can throw it off
the rails. In the case observed, a static /64 prefix was deleted from
vlan1 while dhcpcd intended to delete its reject route bound to lo0.

Given two routes in the table, the loopback reject route installed by
dhcpd for my /48 prefix, and a cloning route for a /64 prefix on vlan1:

2001:db8::/48 ::1         UGR        0        0 32768    56 lo0
2001:db8::/64 2001:db8::1 UCn        1        2     -     4 vlan1

When searching the OS routing table dhcpcd attempts to tell routes apart
based only on the masked destination address. In the above case the masked
destinations look identical. The only difference is the length of the netmask.
The function rt_cmp_dest() didn't detect this and returned the /64 route
while dhcpcd was in fact searching for the /48 route.

This patch fixes the lookup by running rt_cmp_netmask() if the masked
destination comparison via sa_cmp() leaves us with a tie. With this change
dhcpcd deletes the /48 route as intended, and leaves the /64 route alone.

I had to move the rt_cmp_dest() function down since it needs to use the
static helper function rt_cmp_netmask(), which happened to be defined
just below rt_cmp_dest().

Why am I using an overlapping static prefix? The answer is that my ISP
assigns a static /48 prefix but won't route IPv6 unless my router sends
a DHCPv6 request when it connects via PPPoE. I configure static IPv6 subnets
on LAN interfaces and have configured dhcpcd to obtain a /48 prefix lease
without setting addresses on any internal interfaces.
My dhcpcd.conf contains:
  ipv6only
  noipv6rs
  duid
  persistent
  option rapid_commit
  require dhcp_server_identifier
  script ""
  allowinterfaces pppoe0
  interface pppoe0
    ia_pd 1 /2001:db8::/48

This problem was found on OpenBSD, in case that matters for reproduction
of the issue.

3 years agoUpdate man pages for default metric changes (#51)
Peter Fabinski [Tue, 31 Aug 2021 09:29:25 +0000 (05:29 -0400)] 
Update man pages for default metric changes (#51)

* Update man pages for metric changes in 3547ed19

* Make metric man changes additive

3 years agoFix parsing of hex/octal escapes in strings (#42)
Craig McQueen [Fri, 20 Aug 2021 07:57:18 +0000 (17:57 +1000)] 
Fix parsing of hex/octal escapes in strings (#42)

4 years agoconfigure: test -a|o is not POSIX
Issam E. Maghni [Tue, 4 May 2021 16:33:02 +0000 (12:33 -0400)] 
configure: test -a|o is not POSIX

4 years agoIPv4LL: Don't remove statically assigned addresses
Roy Marples [Mon, 19 Jul 2021 20:22:44 +0000 (21:22 +0100)] 
IPv4LL: Don't remove statically assigned addresses

Fixes #37.

While here, don't open a DHCP port for static addresses either
when not in manager mode.

4 years agoBSD: Find the correct interface for tunneled routes
Roy Marples [Tue, 9 Feb 2021 10:11:54 +0000 (10:11 +0000)] 
BSD: Find the correct interface for tunneled routes

Should disard a harmless diagnostic.

4 years agosrc/privsep-linux.c: add support for m68k (#29)
Fabrice Fontaine [Mon, 8 Mar 2021 10:05:16 +0000 (11:05 +0100)] 
src/privsep-linux.c: add support for m68k (#29)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoREADME.md: remove dead reference to phabricator
Roy Marples [Mon, 8 Mar 2021 09:43:50 +0000 (09:43 +0000)] 
README.md: remove dead reference to phabricator

4 years agosrc/privsep-linux.c: add support for arc (#28)
Fabrice Fontaine [Mon, 8 Feb 2021 06:23:54 +0000 (07:23 +0100)] 
src/privsep-linux.c: add support for arc (#28)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_{ARCOMPACT,ARCV2} is only defined
since kernel 5.2 and
https://github.com/torvalds/linux/commit/67f2a8a29311841ba6ab9b0e2d1b8f1e9978cd84

Detection of arc compact and arc v2 have been "copy/pasted" from
https://github.com/wbx-github/uclibc-ng/commit/afab56958f1cbb47b831ee3ebff231dfbae74af2

Fixes:
 - http://autobuild.buildroot.org/results/d29083700a80dd647621eed06faeeae03f0587d3

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agosrc/privsep-linux.c: add support for or1k (#27)
Fabrice Fontaine [Sun, 7 Feb 2021 08:43:14 +0000 (09:43 +0100)] 
src/privsep-linux.c: add support for or1k (#27)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_OPENRISC is defined since kernel 3.7:
https://github.com/torvalds/linux/commit/e2bebb4ae6d9ac4ffc524db67f7ecb205a173f77

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years ago src/privsep-linux.c: add support for nios2 (#23)
Fabrice Fontaine [Sun, 31 Jan 2021 10:12:21 +0000 (11:12 +0100)] 
 src/privsep-linux.c: add support for nios2 (#23)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_NIOS2 is only defined since kernel
5.2 and
https://github.com/torvalds/linux/commit/1660aac45e5b49a5ace29fb5b73254617533fcbd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoForce TOP as we know which directory we are in.
Roy Marples [Fri, 5 Feb 2021 22:41:16 +0000 (22:41 +0000)] 
Force TOP as we know which directory we are in.

4 years agosrc/privsep-linux: fix build on sparc (#26)
Fabrice Fontaine [Fri, 5 Feb 2021 08:25:12 +0000 (09:25 +0100)] 
src/privsep-linux: fix build on sparc (#26)

Fix the following build failure:

privsep-linux.c:203: warning: "AUDIT_ARCH_SPARC64" redefined
  203 | #    define AUDIT_ARCH_SPARC64
      |
In file included from privsep-linux.c:35:
/srv/storage/autobuild/run/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/linux/audit.h:392: note: this is the location of the previous definition
  392 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
      |
In file included from privsep-linux.c:36:
privsep-linux.c:215:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  215 |  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
      |                                      ^~~~~~~~~~~~~~~~~~

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agosrc/privsep-linux.c: add support for sh (#25)
Fabrice Fontaine [Fri, 5 Feb 2021 08:05:54 +0000 (09:05 +0100)] 
src/privsep-linux.c: add support for sh (#25)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_{SH,SHEL,SH64,SHEL64} are defined at
least since kernel 3.7 and
https://github.com/torvalds/linux/commit/607ca46e97a1b6594b29647d98a32d545c24bdff

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoRename Privileged Actioneer to Privileged Proxy
Roy Marples [Tue, 2 Feb 2021 17:09:25 +0000 (17:09 +0000)] 
Rename Privileged Actioneer to Privileged Proxy

Sadly actioneer is not a real word.

4 years agoRename Master to Manager
Roy Marples [Tue, 2 Feb 2021 16:54:09 +0000 (16:54 +0000)] 
Rename Master to Manager

4 years ago src/privsep-linux.c: add support for microblaze (#24)
Fabrice Fontaine [Sun, 31 Jan 2021 20:57:40 +0000 (21:57 +0100)] 
 src/privsep-linux.c: add support for microblaze (#24)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_MICROBLAZE is only defined since
kernel 3.18 and
https://github.com/torvalds/linux/commit/ce5d112827e5c2e9864323d0efd7ec2a62c6dce0

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoA belated welcome to 2021
Roy Marples [Sun, 31 Jan 2021 10:33:21 +0000 (10:33 +0000)] 
A belated welcome to 2021

4 years agoTypo with prior
Roy Marples [Sun, 31 Jan 2021 10:08:11 +0000 (10:08 +0000)] 
Typo with prior

4 years agoLinux: Add support for NDS32BE SECCOMP
Roy Marples [Sun, 31 Jan 2021 07:37:03 +0000 (07:37 +0000)] 
Linux: Add support for NDS32BE SECCOMP

4 years ago src/privsep-linux.c: add support for xtensa (#22)
Fabrice Fontaine [Sun, 31 Jan 2021 02:35:10 +0000 (03:35 +0100)] 
 src/privsep-linux.c: add support for xtensa (#22)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_XTENSA is only defined since kernel
5.0 and
https://github.com/torvalds/linux/commit/98c3115a4ec56f03056efd9295e0fcb4c5c57a85

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoimport-src: Improve target so we don't create empty files
Roy Marples [Sat, 30 Jan 2021 12:21:15 +0000 (12:21 +0000)] 
import-src: Improve target so we don't create empty files

4 years agoimport-src: adjust build target so all .in files are pre-built
Roy Marples [Sat, 30 Jan 2021 11:46:06 +0000 (11:46 +0000)] 
import-src: adjust build target so all .in files are pre-built

While here, if we cannot find ypbind to work out how the hook script
should be configured, guess according to OS.

4 years agosrc/privsep-linux.c: add support for nds32 (#21)
Fabrice Fontaine [Sat, 30 Jan 2021 11:10:08 +0000 (12:10 +0100)] 
src/privsep-linux.c: add support for nds32 (#21)

Fix the following build failure:

privsep-linux.c:206:4: error: #error "Platform does not support seccomp filter yet"
 #  error "Platform does not support seccomp filter yet"
    ^~~~~
In file included from privsep-linux.c:36:
privsep-linux.c:213:38: error: 'SECCOMP_AUDIT_ARCH' undeclared here (not in a function); did you mean 'SECCOMP_ALLOW_ARG'?
  BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
                                      ^~~~~~~~~~~~~~~~~~

It should be noted that AUDIT_ARCH_NDS32 is only defined since kernel
5.2 and
https://github.com/torvalds/linux/commit/fa562447e154334523daa44c0b60625d71a345f5

Fixes:
 - http://autobuild.buildroot.org/results/af8ba07ea0c12ab8cd24d528ef98db05521f3d36

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoBSD: Plug a memory leak
Roy Marples [Thu, 28 Jan 2021 23:24:49 +0000 (23:24 +0000)] 
BSD: Plug a memory leak

4 years agoprivsep: move setting signals to after clearing eloop
Roy Marples [Wed, 27 Jan 2021 14:11:52 +0000 (14:11 +0000)] 
privsep: move setting signals to after clearing eloop

4 years agoWhitespace
Roy Marples [Wed, 27 Jan 2021 13:45:34 +0000 (13:45 +0000)] 
Whitespace

4 years agoprivsep: Ensure BPF listener pid is logged in debug
Roy Marples [Wed, 27 Jan 2021 13:37:31 +0000 (13:37 +0000)] 
privsep: Ensure BPF listener pid is logged in debug

This mirrors the inet listener.

4 years agocontrol: log an error if we fail to remove the write callback
Roy Marples [Wed, 27 Jan 2021 13:33:52 +0000 (13:33 +0000)] 
control: log an error if we fail to remove the write callback

4 years agoWhitespace
Roy Marples [Wed, 27 Jan 2021 13:31:51 +0000 (13:31 +0000)] 
Whitespace

4 years agocontrol: unlink privileged socket when shutting down without privsep
Roy Marples [Tue, 26 Jan 2021 17:37:29 +0000 (17:37 +0000)] 
control: unlink privileged socket when shutting down without privsep

Otherwise we have a connection refused when dhcpcd starts again
as it sees the stale socket file.