1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00
Commit Graph

10570 Commits

Author SHA1 Message Date
Bram Matthys 9289ef7c83 Mention JSON-RPC there as well
[skip ci]
2026-03-04 09:18:20 +01:00
Bram Matthys fc82176cd0 Update README with Mastodon and tell at least something about supported systems.
Mention tested systems as well (which is narrower than supported systems).
And merge documentation and support, since users will usually be after both.
2026-03-04 09:15:36 +01:00
Bram Matthys 7a46caa1da tls-tests: pin to a specific testssl.sh commit hash. 2026-03-03 17:08:35 +01:00
Bram Matthys de2d72b592 Update Build CI. Tightening it down and fail-fast to false. 2026-03-03 07:16:44 +01:00
Bram Matthys 648a10494f Add -DTESTSUITE and use it from extras/build-tests/nix/build.
In particular, this disables default +F for #__SYNC__ channels.
The test suite has a "+F off" but when on 3 servers, each 75
clones are connecting, the MODE is too late and the join limit
is already reached sometimes. Causing tests to fail.
2026-02-28 15:26:57 +01:00
Bram Matthys 426289e377 Drop really verbose logging from build tests as it makes things too slow 2026-02-28 12:18:11 +01:00
Bram Matthys b06a3a34d0 Update extras/build-tests/nix/run-tests.bbwrapper to fix FreeBSD issue. 2026-02-28 12:04:34 +01:00
Bram Matthys 55fda3456d Update TLS tests with pqc_arm.txt (on rpi 5, slightly differs from pqc.txt)
OpenSSL prefering X25519 vs secp521r1 for ECDH and vice versa,
still looks fine.
2026-02-28 10:47:38 +01:00
Bram Matthys cd317e678c Update release notes on latest two changes.
[skip ci]
2026-02-25 15:21:57 +01:00
Bram Matthys 70d6cb2589 If no 3rd party modules are installed, then skip the module upgrade step.
This means we don't do an HTTPS call at build time when unnecessary.
2026-02-25 15:04:49 +01:00
Bram Matthys 17037b0694 Fix build failing if DNS is not working. Building UnrealIRCd should never fail
because it has no internet access, like when fetching the repository
(modules.list file) of 3rd party modules.

Previously I had..
url_start_async(request);
synchronous_http_request_in_progress = 1;
.. which worked fine for the "cannot connect case", like port blocked
or timeout connecting. But if DNS fails then the step of setting
synchronous_http_request_in_progress = -1 (so failed) already happens
during the url_start_async(request); call, and then the line after it
sets 'synchronous_http_request_in_progress = 1;' so we miss that it
failed and wait in the I/O loop forever.
Simply swapping the two lines of code fixes this.

The other change is that when running the ModuleManager in "make" we should
ignore the exit code. I probably broke that while refactoring and adding
non-zero exit codes in de modulemanager past few months for this release.
2026-02-25 14:58:11 +01:00
Bram Matthys bd1ccde9c3 ** UnrealIRCd 6.2.3-rc2 ** 2026-02-25 08:28:20 +01:00
Bram Matthys 2f839c85f7 Reorder some release notes items 2026-02-23 10:54:12 +01:00
Bram Matthys 93c26c2d42 Update release notes. 2026-02-23 10:04:08 +01:00
Bram Matthys 3a96bdf6ec Add set::allow-setident (default: 'no'), set::allow-setname ('yes')
Two new settings that control the use of `SETIDENT` and `SETNAME`:
* [set::allow-setident](https://www.unrealircd.org/docs/Set_block#set::allow-setident)
  now defaults to 'no'. Previously all users were allowed to change their
  ident (taking into account
  [set::allow-userhost-change](https://www.unrealircd.org/docs/Set_block#set::allow-userhost-change)
  restrictions).
* [set::allow-setname])(https://www.unrealircd.org/docs/Set_block#set::allow-setname)
  has a default of 'yes' which matches older UnrealIRCd versions (no change).
  Perhaps some admins who use controlled (web)chats may want to set this
  to 'no' if users are not supposed to change their realname/gecos.
  This is probably rare, but they have the option now.
2026-02-23 08:58:39 +01:00
Bram Matthys a6cdd4b548 Use the exact same approach for argon2 as the other libs
(fixes build)
2026-02-23 08:04:31 +01:00
Bram Matthys d19919df07 Add extras/build-tests/nix/hardening-check.sh so i can use from BuildBot. 2026-02-23 07:48:47 +01:00
Bram Matthys 3e9ce77dc6 Hardening: build the last 2 remaining libs with hardening flags too
Library argon2 uses a makefile without configure, so works a bit different
And GeoIP i forgot because it was in a different autoconf file.
2026-02-23 07:17:02 +01:00
Bram Matthys 4c01372e3b Move orig_cflags="$CFLAGS" to after AC_PROG_CC_C99
As otherwise the shipped libs don't (necessarily) get -O2 -g,
which in turn means _FORTIFY_SOURCE=3 won't work.
2026-02-22 20:15:33 +01:00
Bram Matthys ae245865ea Pass hardening flags to libraries that we build/ship ourselves (if any)
Previously we didn't and that means that if any shipped lib was used,
without hardening, this would cause non-CET libraries to silently disable
CET for the entire process, and partial RELRO on the libs means the
full RELRO in UnrealIRCd is much less useful.

Actually, system libs on Debian/Ubuntu don't even have full RELRO atm,
but hey, we try to do better, also.. some other OS/distro might
have it on and who knows Debian/Ubuntu change their mind later..
2026-02-22 19:50:46 +01:00
Bram Matthys dcd8f738fe Remove -fzero-call-used-regs=used-gpr again. This is apparently not
as useful as initially thought. I thought kernel hardening checker
was in favor of it, and they were, but they dropped it in Oct 2023.

(i added it 2-3hrs ago in 0ab1221a38)
2026-02-22 19:02:31 +01:00
Bram Matthys 5cc59192bc Hardening: add -mbranch-protection=standard for arm64 that support it.
e.g. raspberry pi 5, aws ec2 graviton2 and higher, etc.

This does the same as -fcf-protection on x64 (well, those that support it).
2026-02-22 18:29:17 +01:00
Bram Matthys 4d4a43984c Hardening: add -ftrivial-auto-var-init=zero
This zeroes out variables that COULD be accessed before being set
(so to prevent access to unitialized variables). We are generally
very careful about this in our code, but in 3rd party modules this
is less the case. And still useful in case we ourselves screw up.
2026-02-22 16:38:55 +01:00
Bram Matthys 0ab1221a38 Hardening: add -fzero-call-used-regs=used-gpr
Is defense in depth to make ROP harder. In general this is reported to
have a performance impact of 2% worst-case. Linux kernel reports 1%.
Should be closer to 0% for us, or that 1% if i am wrong.
https://lwn.net/Articles/870045/ has some background on this.
2026-02-22 16:33:38 +01:00
Bram Matthys d668c4b78b Hardening: add -fstrict-flex-arrays=3
This should help gcc/clang with finding more OOB write bugs.

It does mean that 3rd party modules can no longer use the something like:
struct { char name[1]; }
and then alloc(sizeof(struct) + length of name)

instead the struct element needs to be name[];
...and they would need to alloc(sizeof(struct) + length of name + 1)

No 3rd party modules in unrealircd-contrib use this so.. hopefully fine.
2026-02-22 16:26:57 +01:00
Bram Matthys 014925496b Forgot a few more of those [1] that need to be []
(see previous commit)
2026-02-22 16:24:55 +01:00
Bram Matthys 7d45e69fd2 Use C99 flexible array members, like name[], instead of name[1]
in NameList, Tag, Watch and HistoryLogLine.
This does mean the allocation routines need a +1 everywhere, but
I think I got all of them. I also don't see them being used directly
in such a way in 3rd party modules (which is logical, as they
should use the API and not allocate such structs directly).

Also, SpamExcept has been removed as it was not used anywhere.
2026-02-22 16:11:41 +01:00
Bram Matthys fb0649f14a Use full RELRO for modules (use HARDEN_LDFLAGS in MODULEFLAGS)
Previously, due to HARDEN_LDFLAGS missing in MODULEFLAGS we were
only partial RELRO instead of full RELRO. This is a defense-in-
depth measure but is good to have and the ommission was unintended.
2026-02-22 15:37:45 +01:00
Bram Matthys 8be6337e71 Update release notes
[skip ci]
2026-02-22 13:28:56 +01:00
Bram Matthys 19d17832fe Remove set::restrict-extendedbans as it didn't work. Simply don't load
the particular extended ban module if you don't want it.

For example, if you include the default modules.default.conf and, say,
you don't want ~quiet extbans then you add this in your unrealircd.conf:

blacklist-module "extbans/quiet";
2026-02-22 13:07:57 +01:00
Bram Matthys 6933e1839b Update extban_conv_param_nuh_or_extban() to use MAXBANLEN
instead of arbitrary 256 and such. Also makes it so other people
reading this code will understand better that MAXBANLEN is the
real limit here and not 256 (which is never reached because
the cut off already happens at 200).
2026-02-22 12:42:44 +01:00
Bram Matthys d38a106879 Enforce MAXBANLEN (which is MODEBUFLEN) at some more places.
This shouldn't be needed except for some corner cases, like if some
third party module does not limit their stuff properly, in S2S
or if channeldb contains some weird long entry or something.
2026-02-22 12:38:01 +01:00
Bram Matthys ac86029a61 Make convert_regular_ban() and extban_conv_param_nuh() consistently
allow bans of NICKLEN+USERLEN+HOSTLEN+3. Previously NICKLEN was
ommitted for some reason, which also explains why this ban-
simplification-routine exists in the first place. I think we can
make it use this full n!u@h space. Especially since we already allow
this for bans like ~quiet (the full n!u@h) and other extbans can be
quite long as well, it no longer makes sense to limit it here.

Small detail: in extban_conv_param_nuh() we used +32 which i think
is from the times when we had to deal with prefixes like ~quiet,
which is no longer the case, this routine is only about the final
suffix after the last : in a ban.
2026-02-22 11:58:15 +01:00
Bram Matthys 979f44bde4 Linking: upon duplicate server we could SQUIT the wrong one.
This would cause a bit of a mess, that usually would be resolved a few
seconds later, but still a mess. I had this on irc*.unrealircd.org
myself when rerouting a server from a backup-hub to primary-hub
a few months ago.
2026-02-22 11:37:09 +01:00
Bram Matthys d79161019a Clear client->local->proto for users.
This is not an issue now in all code paths, but if someone accidentally uses
SupportXYZ() without checking IsServer() then it would be an issue.

In the past we used client->local->proto for client flags as well, but this
has been split off to client->local->caps a while ago.

I guess we should rename client->local->proto to something more server-ish
in a later major release to indicate this as well.
2026-02-22 10:37:01 +01:00
Bram Matthys 371cb487b9 Fix missing "return;" in "Bad ulines" rejection of a server. 2026-02-22 10:00:32 +01:00
Bram Matthys 43da14f7c6 Get rid of old confusing comment in src/parse.c regarding commands with 0 flags
if (cmptr->flags != 0) { /* temporary until all commands are updated */

But that is impossible, as CommandAdd()->CommandAddInternal() already has:

if (!flags)
{
        config_error("CommandAdd(): Could not add command '%s': flags are 0", cmd);

And this is the case since commit ceb04cc3eb
from July 15, 2015.
2026-02-22 08:05:18 +01:00
Bram Matthys 059abc4b56 "STATS fdtable" is mostly for debugging. Simplify read/write handler display
and callback data in non-DEBUGMODE. Also because exposing pointers like
this can defeat ASLR. These STATS are oper-only though, but hey, defense in
depth... and the pointer values don't make sense to non-devs anyway,
so why show them in the first place.
2026-02-21 19:41:56 +01:00
Bram Matthys b467e4e147 JSON-RPC: Fix missing mtag issued by in user.part
We use mtag_add_issued_by() to prepare it but then pass NULL
in do_cmd() so it was basically useless.

Also compile fix for previous (forgot to git ammend)
2026-02-21 16:22:36 +01:00
Bram Matthys ec4ccbde82 Fix memory leak on JSON-RPC log.send and fix a small auth url parse thing.
Actually that auth url method is not documented, we should probably remove it.
2026-02-21 16:18:34 +01:00
Bram Matthys b93cb14623 Fix crash due to fix from a few hours ago (5580b294f4) 2026-02-21 16:04:50 +01:00
Bram Matthys d22f65364c Make duplicate deny link::rule items an error.
(as otherwise using duplicated generates only a warning and could memleak)
2026-02-21 14:57:41 +01:00
Bram Matthys f81fd965ea Mask item or security-group: add check for duplicate rule / exclude-rule 2026-02-21 14:55:13 +01:00
Bram Matthys b55a4b84e0 Blacklist hit with a soft ban action: fix memory leak if multiple hits occur.
So, if the IP was on multiple blacklists.
2026-02-21 14:43:41 +01:00
Bram Matthys 8740774d25 Not important but.. this did not free element 255. 2026-02-21 14:01:29 +01:00
Bram Matthys f20b62ea3b Fix memory leak on blacklist hit if using soft bans 2026-02-21 13:59:10 +01:00
Bram Matthys fae9dacf5d Fix some small REHASH leaks: tld->channel, link->connect_ip,
allow->server (last one is very rare).
2026-02-21 13:56:30 +01:00
Bram Matthys 28a8bee041 Don't use 'client' in CENTRAL_BLOCKLIST_ERROR, prolly copy-paste error.
Not really important as it is not part of the normal log message (only JSON).
2026-02-21 13:49:26 +01:00
Bram Matthys f59b937f3b Fix leak if central-blocklist returns "error" JSON string (very rare) 2026-02-21 13:45:47 +01:00
Bram Matthys 5580b294f4 Fix memory leak if using spamfilter::except. 2026-02-21 13:20:17 +01:00