]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agogive polite message about socket closing
Alan T. DeKok [Fri, 7 Apr 2023 13:50:01 +0000 (09:50 -0400)] 
give polite message about socket closing

2 years agofix ASAN issues. Fixes #4968
Alan T. DeKok [Fri, 7 Apr 2023 12:11:18 +0000 (08:11 -0400)] 
fix ASAN issues.  Fixes #4968

2 years agoci: Add ASAN/LSAN options (#4969)
Jorge Pereira [Fri, 7 Apr 2023 12:06:36 +0000 (09:06 -0300)] 
ci: Add ASAN/LSAN options (#4969)

2 years agorevert to using sock->mutex again
Alan T. DeKok [Fri, 7 Apr 2023 02:11:17 +0000 (22:11 -0400)] 
revert to using sock->mutex again

2 years agoit helps to initialize mutexes.
Alan T. DeKok [Fri, 7 Apr 2023 02:09:41 +0000 (22:09 -0400)] 
it helps to initialize mutexes.

2 years agomore mutex locks around common data
Alan T. DeKok [Fri, 7 Apr 2023 01:46:14 +0000 (21:46 -0400)] 
more mutex locks around common data

2 years agoblock.sh: Add cleanup statement to avoid exit and let the server blocked (#4967)
Jorge Pereira [Thu, 6 Apr 2023 19:51:39 +0000 (16:51 -0300)] 
block.sh: Add cleanup statement to avoid exit and let the server blocked (#4967)

2 years agonote recent changes
Alan T. DeKok [Thu, 6 Apr 2023 19:48:24 +0000 (15:48 -0400)] 
note recent changes

2 years agoScript to randomly block connections
Alan T. DeKok [Thu, 6 Apr 2023 19:31:35 +0000 (15:31 -0400)] 
Script to randomly block connections

2 years agouse a global mutex for TLS, not a per-socket mutex.
Alan T. DeKok [Thu, 6 Apr 2023 19:24:20 +0000 (15:24 -0400)] 
use a global mutex for TLS, not a per-socket mutex.

Apparently accessing the SSL_SESSION also requires mutex-protected
access to the underlying SSL_CTX.  So we set a global mutex, which
will slow things down a bit in the contended case.  But it won't
cause blocking issues which stops the server entirely.

2 years agoAdd assert to catch invalid mutex (#4960)
Jorge Pereira [Thu, 6 Apr 2023 19:00:04 +0000 (16:00 -0300)] 
Add assert to catch invalid mutex (#4960)

2 years agoneed this, too
Alan T. DeKok [Thu, 6 Apr 2023 18:55:16 +0000 (14:55 -0400)] 
need this, too

2 years agoadd accounting, and do minor cleanups
Alan T. DeKok [Thu, 6 Apr 2023 17:03:36 +0000 (13:03 -0400)] 
add accounting, and do minor cleanups

2 years agoallow FR_LIBRARY_PATH to pass through, if it's already set
Alan T. DeKok [Thu, 6 Apr 2023 17:00:07 +0000 (13:00 -0400)] 
allow FR_LIBRARY_PATH to pass through, if it's already set

2 years agopass FR_LIBRARY_PATH if it's already set
Alan T. DeKok [Thu, 6 Apr 2023 16:58:45 +0000 (12:58 -0400)] 
pass FR_LIBRARY_PATH if it's already set

2 years agoclose the TLS socket on TLS errors.
Alan T. DeKok [Wed, 5 Apr 2023 20:53:35 +0000 (16:53 -0400)] 
close the TLS socket on TLS errors.

If there's a TLS connection error, then the only way to recover
is to close the socket and start over from scratch.

2 years agoconfiguration and scripts to test high load UDP -> TLS proxying
Alan T. DeKok [Wed, 5 Apr 2023 20:48:55 +0000 (16:48 -0400)] 
configuration and scripts to test high load UDP -> TLS proxying

2 years agoremove extraneous echo
Alan T. DeKok [Wed, 5 Apr 2023 19:56:09 +0000 (15:56 -0400)] 
remove extraneous echo

2 years agoWrap all uses of ssl_mutexes in the same ifdef
Nick Porter [Tue, 4 Apr 2023 15:15:16 +0000 (16:15 +0100)] 
Wrap all uses of ssl_mutexes in the same ifdef

2 years agoFix missing phtread destroy (#4957)
Jorge Pereira [Mon, 3 Apr 2023 19:05:34 +0000 (16:05 -0300)] 
Fix missing phtread destroy (#4957)

As we are calling pthread_mutex_init(), we should call
pthread_mutex_destroy() to release all initialized mutexs.

2 years agoFix typo (#4956)
Jorge Pereira [Mon, 3 Apr 2023 19:01:20 +0000 (16:01 -0300)] 
Fix typo (#4956)

2 years agotypo
Alan T. DeKok [Mon, 3 Apr 2023 16:05:16 +0000 (12:05 -0400)] 
typo

2 years agomore cleanups
Alan T. DeKok [Sat, 1 Apr 2023 14:30:14 +0000 (10:30 -0400)] 
more cleanups

2 years agojust use OpenSSL thread IDs
Alan T. DeKok [Sat, 1 Apr 2023 14:17:20 +0000 (10:17 -0400)] 
just use OpenSSL thread IDs

which uses the address of "errno".  That is thread-local on all
platforms we care about.

2 years agoFix runtime LSAN/ASAN out of bound index (#4942)
Jorge Pereira [Thu, 30 Mar 2023 14:56:24 +0000 (11:56 -0300)] 
Fix runtime LSAN/ASAN out of bound index (#4942)

Such error:

Process 369882 stopped
* thread #4, name = 'radiusd', stop reason = Out of bounds index
    frame #0: 0x00005555556e7c10 radiusd`__ubsan_on_report
radiusd`__ubsan_on_report:
->  0x5555556e7c10 <+0>: retq
    0x5555556e7c11:      nopw   %cs:(%rax,%rax)
    0x5555556e7c1b:      nopl   (%rax,%rax)
radiusd`__ubsan_get_current_report_data:
    0x5555556e7c20 <+0>: pushq  %rbx
lldb> vt
error: 'vt' is not a valid command.
lldb> bt
* thread #4, name = 'radiusd', stop reason = Out of bounds index
  * frame #0: 0x00005555556e7c10 radiusd`__ubsan_on_report
    frame #1: 0x00005555556e29c6 radiusd`__ubsan::Diag::~Diag() + 214
    frame #2: 0x00005555556e5814 radiusd`handleOutOfBoundsImpl(__ubsan::OutOfBoundsData*, unsigned long, __ubsan::ReportOptions) + 340
    frame #3: 0x00005555556e588e radiusd`__ubsan_handle_out_of_bounds_abort + 46
    frame #4: 0x00007ffff7e2fd5f libfreeradius-radius.so`fr_rand_seed(data=0x000062501c0aeae0, size=20) at radius.c:5019:45
    frame #5: 0x00007ffff7e2f865 libfreeradius-radius.so`rad_decode(packet=<unavailable>, original=<unavailable>, secret=<unavailable>) at radius.c:4551:2
    frame #6: 0x000055555571631d radiusd`client_socket_decode(listener=<unavailable>, request=<unavailable>) at listen.c:2404:9
    frame #7: 0x000055555575df97 radiusd`request_running [inlined] request_pre_handler(request=0x000062501c0aeb70, action=<unavailable>) at process.c:1379:11
    frame #8: 0x000055555575de92 radiusd`request_running(request=0x000062501c0aeb70, action=<unavailable>) at process.c:1676:8
    frame #9: 0x0000555555758f76 radiusd`request_handler_thread(arg=0x0000606000010880) at threads.c:826:3
    frame #10: 0x00007ffff7490402 libc.so.6`start_thread(arg=<unavailable>) at pthread_create.c:442:8
    frame #11: 0x00007ffff751f590 libc.so.6`__clone3 at clone3.S:81
lldb>

2 years agocall the correct API...
Alan T. DeKok [Thu, 30 Mar 2023 02:41:59 +0000 (11:41 +0900)] 
call the correct API...

2 years agotypo
Alan T. DeKok [Thu, 30 Mar 2023 02:30:43 +0000 (11:30 +0900)] 
typo

2 years agolet's remove the timer events when we free the socket, m'kay?
Alan T. DeKok [Thu, 30 Mar 2023 02:26:33 +0000 (11:26 +0900)] 
let's remove the timer events when we free the socket, m'kay?

2 years agomore checks and sanity
Alan T. DeKok [Thu, 30 Mar 2023 02:23:35 +0000 (11:23 +0900)] 
more checks and sanity

allow extended types

2 years agofix paths for v3
Alan T. DeKok [Thu, 30 Mar 2023 01:16:52 +0000 (10:16 +0900)] 
fix paths for v3

2 years agocopy from v4
Alan T. DeKok [Thu, 30 Mar 2023 01:05:27 +0000 (10:05 +0900)] 
copy from v4

2 years agofix CI
Alan T. DeKok [Wed, 29 Mar 2023 11:55:20 +0000 (20:55 +0900)] 
fix CI

2 years agotry to shut up clang scan
Alan T. DeKok [Wed, 29 Mar 2023 11:31:02 +0000 (20:31 +0900)] 
try to shut up clang scan

which assumes (a) this->type == DETAIL, followed by assuming that
(b) this->type != DETAIL

So it's not tracking things correctly as the listener isn't being
changed during all that.

2 years agohopefully one last fix
Alan T. DeKok [Wed, 29 Mar 2023 08:54:14 +0000 (17:54 +0900)] 
hopefully one last fix

2 years agoonly access "sock" for socket listeners
Alan T. DeKok [Wed, 29 Mar 2023 08:25:55 +0000 (17:25 +0900)] 
only access "sock" for socket listeners

2 years agomove "dead" to public value
Alan T. DeKok [Wed, 29 Mar 2023 08:06:11 +0000 (17:06 +0900)] 
move "dead" to public value

2 years agocheck EAP header byte 0, too, and add debug messages
Alan T. DeKok [Wed, 29 Mar 2023 08:05:11 +0000 (17:05 +0900)] 
check EAP header byte 0, too, and add debug messages

2 years agoadd pre_proxy method which catches invalid EAP packets.
Alan T. DeKok [Wed, 29 Mar 2023 07:53:11 +0000 (16:53 +0900)] 
add pre_proxy method which catches invalid EAP packets.

Because "._udp.local" is not a valid EAP message

2 years agoinitialize sock better, and mark sockets as dead more often
Alan T. DeKok [Wed, 29 Mar 2023 00:28:56 +0000 (09:28 +0900)] 
initialize sock better, and mark sockets as dead more often

2 years agoFix pthread.h include (#4943)
Jorge Pereira [Tue, 28 Mar 2023 17:01:34 +0000 (14:01 -0300)] 
Fix pthread.h include (#4943)

It needs to avoid:

src/lib/event.c:127:2: error: call to undeclared function 'pthread_mutex_destroy'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
CC src/lib/getaddrinfo.c
        pthread_mutex_destroy(&el->mutex);
        ^
src/lib/event.c:162:9: error: call to undeclared function 'pthread_mutex_init'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        pthread_mutex_init(&el->mutex, NULL);
        ^
src/lib/event.c:478:2: error: call to undeclared function 'pthread_mutex_lock'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        pthread_mutex_lock(&el->mutex);
        ^

2 years agoMore move @.. to ${Q}... (#4937)
Jorge Pereira [Mon, 27 Mar 2023 21:45:25 +0000 (18:45 -0300)] 
More move @.. to ${Q}... (#4937)

That way we can set Q=@ for quiet, or Q="" for verbose.

2 years agoCI: use local copies of Docker images
Matthew Newton [Thu, 23 Mar 2023 16:25:38 +0000 (16:25 +0000)] 
CI: use local copies of Docker images

2 years ago$(Q) -> ${Q}
Alan T. DeKok [Thu, 23 Mar 2023 17:23:57 +0000 (13:23 -0400)] 
$(Q) -> ${Q}

2 years agoCI: remove ubuntu 18.04
Matthew Newton [Thu, 23 Mar 2023 14:38:29 +0000 (14:38 +0000)] 
CI: remove ubuntu 18.04

2 years agoCI: remove non-Docker path
Matthew Newton [Thu, 23 Mar 2023 14:34:30 +0000 (14:34 +0000)] 
CI: remove non-Docker path

2 years agoci: Add 'sanitizer' build action
Jorge Pereira [Thu, 16 Mar 2023 19:59:08 +0000 (16:59 -0300)] 
ci: Add 'sanitizer' build action

2 years agoci: Fix missing libclang-rt-15-dev
Jorge Pereira [Wed, 15 Mar 2023 21:43:26 +0000 (18:43 -0300)] 
ci: Fix missing libclang-rt-15-dev

2 years agoci: Bump LLVM/CLANG for 15
Jorge Pereira [Wed, 15 Mar 2023 19:01:38 +0000 (16:01 -0300)] 
ci: Bump LLVM/CLANG for 15

2 years agoFix runtime LSAN/ASAN error in command.c
Jorge Pereira [Thu, 23 Mar 2023 00:10:20 +0000 (21:10 -0300)] 
Fix runtime LSAN/ASAN error in command.c

Such error:

src/main/command.c:185:12: runtime error: member access within null
pointer of type 'struct sockaddr_un'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
src/main/command.c:185:12 in

2 years agoFix conflict test radiusd instances
Jorge Pereira [Tue, 21 Mar 2023 22:05:12 +0000 (19:05 -0300)] 
Fix conflict test radiusd instances

Let's do it separately avoiding to conflict with the task 'radiusd.pid' vs
the other instance called by the same by 'tests.eap'

2 years agoevent: Fix missing phtread.h include
Jorge Pereira [Tue, 21 Mar 2023 19:13:00 +0000 (16:13 -0300)] 
event: Fix missing phtread.h include

2 years agoMove @.. to $(Q)...
Jorge Pereira [Sat, 18 Mar 2023 01:54:52 +0000 (22:54 -0300)] 
Move @.. to $(Q)...

That way we can set Q=@ for quiet, or Q="" for verbose

2 years agoCI: clearer versions
Matthew Newton [Thu, 23 Mar 2023 12:33:25 +0000 (12:33 +0000)] 
CI: clearer versions

2 years agoCI: backport self-hosted docker image updates from v4
Matthew Newton [Thu, 23 Mar 2023 12:00:49 +0000 (12:00 +0000)] 
CI: backport self-hosted docker image updates from v4

2 years agoBackport math.h from v4
Jorge Pereira [Thu, 9 Mar 2023 19:05:20 +0000 (16:05 -0300)] 
Backport math.h from v4

2 years agoFix runtime LSAN/ASAN error in src/lib/atomic_queue.c
Jorge Pereira [Thu, 9 Mar 2023 19:05:52 +0000 (16:05 -0300)] 
Fix runtime LSAN/ASAN error in src/lib/atomic_queue.c

Such error:

runtime error: member access within misaligned address 0x7f0e163fe860
for type 'fr_atomic_queue_t' (aka 'struct fr_atomic_queue_t'),
which requires 128 byte alignment 0x7f0e163fe860: note: pointer points here)

In that case, it was necessary backport talloc_aligned_array()

2 years agonote recent changes
Alan T. DeKok [Tue, 21 Mar 2023 13:47:07 +0000 (09:47 -0400)] 
note recent changes

2 years agoFix memory-leak in "radiusd -XCM" (#4933)
Jorge Pereira [Mon, 20 Mar 2023 23:33:06 +0000 (20:33 -0300)] 
Fix memory-leak in "radiusd -XCM" (#4933)

Such error:

Current state of talloced memory:
full talloc report on 'null_context' (total      0 bytes in   1 blocks)

=================================================================
==85543==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x5598fcd87f3e in malloc (/home/jpereira/Devel/FreeRADIUS/freeradius-server-v3.2.x.git-linux/build/bin/local/radiusd+0x20cf3e) (BuildId: 3bf5bfb4fd72e1e1112726414556f8a4f339789f)
    #1 0x7f1cc4453d7f in __talloc_with_prefix /build/talloc-NvEq5A/talloc-2.3.3/bin/default/../../talloc.c:783:9
    #2 0x7f1cc4455a5d in __talloc /build/talloc-NvEq5A/talloc-2.3.3/bin/default/../../talloc.c:825:9
    #3 0x7f1cc4455a5d in _talloc_named_const /build/talloc-NvEq5A/talloc-2.3.3/bin/default/../../talloc.c:982:8
    #4 0x7f1cc4455a5d in talloc_enable_null_tracking /build/talloc-NvEq5A/talloc-2.3.3/bin/default/../../talloc.c:2353:18
    #5 0x7f1cc4455a5d in talloc_enable_null_tracking /build/talloc-NvEq5A/talloc-2.3.3/bin/default/../../talloc.c:2350:15
    #6 0x5598fceb65b1 in main /home/jpereira/Devel/FreeRADIUS/freeradius-server-v3.2.x.git-linux/src/main/radiusd.c:313:3
    #7 0x7f1cc342350f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #8 0x7f1cc34235c8 in __libc_start_main csu/../csu/libc-start.c:381:3
    #9 0x5598fcd02514 in _start (/home/jpereira/Devel/FreeRADIUS/freeradius-server-v3.2.x.git-linux/build/bin/local/radiusd+0x187514) (BuildId: 3bf5bfb4fd72e1e1112726414556f8a4f339789f)

SUMMARY: AddressSanitizer: 96 byte(s) leaked in 1 allocation(s).

2 years agoremove "other" from here, too
Alan T. DeKok [Fri, 17 Mar 2023 14:06:06 +0000 (10:06 -0400)] 
remove "other" from here, too

2 years agoFix missing prototype parameter in ssl_version()
Jorge Pereira [Thu, 16 Mar 2023 16:43:34 +0000 (13:43 -0300)] 
Fix missing prototype parameter in ssl_version()

2 years agoSuppress GCC unknown pragma warnings in rlm_perl
Jorge Pereira [Thu, 16 Mar 2023 21:57:15 +0000 (18:57 -0300)] 
Suppress GCC unknown pragma warnings in rlm_perl

2 years agoci: Bump OpenSSL for 3.0.8
Jorge Pereira [Wed, 15 Mar 2023 23:48:32 +0000 (20:48 -0300)] 
ci: Bump OpenSSL for 3.0.8

2 years agodisallow CoA for fake packets. Fixes #4929
Alan T. DeKok [Fri, 17 Mar 2023 13:40:19 +0000 (09:40 -0400)] 
disallow CoA for fake packets.  Fixes #4929

The CoA handling in process.c requires that the CoA packet be
associated with a "real" request.  i.e. one that was received from
the network, and is therefore long-lived.

"fake" packets, such as ones sent to a virtual home server, or
packets used in the "inner-tunnel" virtual server can't do CoA.

This is because the fake packets are freed immediately after they
are processed, and there is no way for them to push the CoA child
into the main event loop.

2 years agojust remove the file, as it's entirely unused
Alan T. DeKok [Fri, 17 Mar 2023 13:28:58 +0000 (09:28 -0400)] 
just remove the file, as it's entirely unused

2 years agoFix runtime error in file_common()
Jorge Pereira [Tue, 14 Mar 2023 19:09:56 +0000 (16:09 -0300)] 
Fix runtime error in file_common()

Such error:

src/modules/rlm_files/rlm_files.c:431:49: runtime error: null pointer passed as argument 3, which is declared to never be null
src/freeradius-devel/radiusd.h:603:89: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/modules/rlm_files/rlm_files.c:431:49 in

2 years agoFix runtime error in cf_file_open()
Jorge Pereira [Tue, 14 Mar 2023 19:05:42 +0000 (16:05 -0300)] 
Fix runtime error in cf_file_open()

Such error:

src/main/conffile.c:333:22: runtime error: load of value 190, which is not a valid value for type 'bool'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/main/conffile.c:333:22 in

2 years agoFix runtime error: load of misaligned address in xlat_integer()
Jorge Pereira [Tue, 14 Mar 2023 18:44:21 +0000 (15:44 -0300)] 
Fix runtime error: load of misaligned address in xlat_integer()

Such error:

src/main/xlat.c:206:38: runtime error: load of misaligned address 0x00010410ba72 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
0x00010410ba72: note: pointer points here
 00 00  00 20 39 38 37 3e 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/main/xlat.c:206:38 in

2 years agoFix runtime LSAN/ASAN error in fr_in6addr_mask()
Jorge Pereira [Tue, 14 Mar 2023 18:27:21 +0000 (15:27 -0300)] 
Fix runtime LSAN/ASAN error in fr_in6addr_mask()

Such error:

src/lib/misc.c:1266:34: runtime error: load of misaligned address 0x00016f8b1d54 for type 'const uint64_t' (aka 'const unsigned long long'), which requires 8 byte alignment
0x00016f8b1d54: note: pointer points here
  e0 89 29 05 00 00 00 00  00 00 00 00 00 00 ff ff  cb 00 71 00 00 00 00 00  e0 89 29 05 01 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/lib/misc.c:1266:34 in

2 years agoFix AddressSanitizer: odr-violation in 'radiusd_version'
Jorge Pereira [Tue, 14 Mar 2023 17:51:56 +0000 (14:51 -0300)] 
Fix AddressSanitizer: odr-violation in 'radiusd_version'

That's why we are backing port the 'HIDDEN' macro.

2 years agoFix LSAN/ASAN memory-leak in lib/radius
Jorge Pereira [Tue, 14 Mar 2023 16:26:16 +0000 (13:26 -0300)] 
Fix LSAN/ASAN memory-leak in lib/radius

2 years agoFix runtime LSAN/ASAN error in src/lib/dict.c
Jorge Pereira [Wed, 8 Mar 2023 15:20:21 +0000 (12:20 -0300)] 
Fix runtime LSAN/ASAN error in src/lib/dict.c

src/lib/dict.c:1365:9: runtime error: signed integer overflow: 429496729 * 10 cannot be represented in type 'int'

2 years agoFix runtime LSAN/ASAN error in src/main/conffile.c
Jorge Pereira [Wed, 8 Mar 2023 15:17:44 +0000 (12:17 -0300)] 
Fix runtime LSAN/ASAN error in src/main/conffile.c

src/main/conffile.c:1831:49: runtime error: applying zero offset to null pointer

2 years agoradattr: Fix several memory-leaks reported by LSAN
Jorge Pereira [Tue, 14 Mar 2023 17:26:55 +0000 (14:26 -0300)] 
radattr: Fix several memory-leaks reported by LSAN

2 years agojuste use fr_hash() instead of hand-rolled hash from 2002
Alan T. DeKok [Fri, 17 Mar 2023 13:20:00 +0000 (09:20 -0400)] 
juste use fr_hash() instead of hand-rolled hash from 2002

2 years agoBackport m4/ax_cc.m4 from v4
Jorge Pereira [Wed, 8 Mar 2023 15:40:14 +0000 (12:40 -0300)] 
Backport m4/ax_cc.m4 from v4

2 years agoBackport 'DIAG_UNKNOWN_PRAGMAS' macro from v4
Jorge Pereira [Thu, 16 Mar 2023 21:56:34 +0000 (18:56 -0300)] 
Backport 'DIAG_UNKNOWN_PRAGMAS' macro from v4

2 years agoFix mismatched bound size in eapsim_checkmac()
Jorge Pereira [Wed, 15 Mar 2023 19:13:23 +0000 (16:13 -0300)] 
Fix mismatched bound size in eapsim_checkmac()

2 years agoFix memory leak in client_add()
Jorge Pereira [Thu, 16 Mar 2023 16:12:43 +0000 (13:12 -0300)] 
Fix memory leak in client_add()

Such error when we run: radiusd -CX

Configuration appears to be OK
Allocated memory at time of report:
Current state of talloced memory:
full talloc report on 'null_context' (total   1057 bytes in   4 blocks)
    autofree_context               contains      1 bytes in   2 blocks (ref 0) 0x608000000400
        bool                           contains      1 bytes in   1 blocks (ref 0) 0x60b000044a90
    RADCLIENT_LIST                 contains   1056 bytes in   1 blocks (ref 0) 0x6190000032e0

=================================================================
==43730==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1152 byte(s) in 1 object(s) allocated from:
    #0 0x5603d1a170be in malloc (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x20b0be) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #1 0x7f2c07e40c86 in _talloc_zero (/lib/x86_64-linux-gnu/libtalloc.so.2+0x6c86) (BuildId: f3c1074a602981acb4683b4df6b7733b104ba7d4)
    #2 0x5603d1a62780 in client_list_init (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x256780) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #3 0x5603d1a62a4a in client_add (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x256a4a) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #4 0x5603d1a6b713 in client_list_parse_section (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x25f713) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #5 0x5603d1ae8532 in main_config_init (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x2dc532) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #6 0x5603d1b45bc4 in main (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x339bc4) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)
    #7 0x7f2c07981082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #8 0x5603d19924fd in _start (/__w/freeradius-server/freeradius-server/build/bin/local/radiusd+0x1864fd) (BuildId: acbe3a0941626cf6f01ae6b2c12df877fb8fc009)

SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 1 allocation(s).

2 years agoFix heap-buffer-overflow in pap_auth_pbkdf2_parse()
Jorge Pereira [Tue, 14 Mar 2023 21:36:01 +0000 (18:36 -0300)] 
Fix heap-buffer-overflow in pap_auth_pbkdf2_parse()

==3061536==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6100000053f9 at pc 0x7f3eb4ff6bbe bp 0x7fff630b7770 sp 0x7fff630b7768
READ of size 1 at 0x6100000053f9 thread T0
    #0 0x7f3eb4ff6bbd in strlcpy /home/jpereira/Devel/FreeRADIUS/freeradius-server-v3.2.x.git-linux/src/lib/strlcpy.c:56:10

2 years agocoa->home_server may be NULL. Fixes #4929
Alan T. DeKok [Thu, 16 Mar 2023 17:01:56 +0000 (13:01 -0400)] 
coa->home_server may be NULL.  Fixes #4929

It's not clear _why_ home_server==NULL.  Nothing resets it.
And it should only be NULL if the CoA packet is sent through a
virtual home server

2 years agoUpdate dictionary.wifialliance (#4928)
Alan T. DeKok [Wed, 15 Mar 2023 17:52:34 +0000 (13:52 -0400)] 
Update dictionary.wifialliance (#4928)

Discovered HS20-Roaming-Consortium being mentioned here:
https://wiki.geant.org/pages/viewpage.action?pageId=133763844

2 years agoFix rlm_unbound build (#4927)
Jorge Pereira [Tue, 14 Mar 2023 21:29:14 +0000 (18:29 -0300)] 
Fix rlm_unbound build (#4927)

2 years agocall proxy_send() for sending proxied packets
Alan T. DeKok [Thu, 9 Mar 2023 20:15:48 +0000 (15:15 -0500)] 
call proxy_send() for sending proxied packets

which works for all packet types, including TLS ones.

2 years agofix use of DIAG in macro
Alan T. DeKok [Wed, 8 Mar 2023 18:29:01 +0000 (13:29 -0500)] 
fix use of DIAG in macro

2 years agomore fixes for talloc_autofree_context() deprecation
Alan T. DeKok [Wed, 8 Mar 2023 18:16:57 +0000 (13:16 -0500)] 
more fixes for talloc_autofree_context() deprecation

2 years agotalloc_autofree_context() is deprecated in newer versions of talloc
Alan T. DeKok [Wed, 8 Mar 2023 18:02:27 +0000 (13:02 -0500)] 
talloc_autofree_context() is deprecated in newer versions of talloc

2 years agonote TLS 1.2 or smaller for EAP-FAST
Alan T. DeKok [Wed, 8 Mar 2023 17:49:00 +0000 (12:49 -0500)] 
note TLS 1.2 or smaller for EAP-FAST

2 years agoWarn if libldap uses NSS. Fixes #4918
Alan T. DeKok [Wed, 8 Mar 2023 17:41:48 +0000 (12:41 -0500)] 
Warn if libldap uses NSS.  Fixes #4918

Instead of letting things break, or have random crashes, give a big
warning on startup.

2 years agoshift 32-bit words, not 8-bit words.
Alan T. DeKok [Wed, 8 Mar 2023 13:15:08 +0000 (08:15 -0500)] 
shift 32-bit words, not 8-bit words.

Manual port of cc49e17c80b6

2 years agoadd more DEBUG3
Alan T. DeKok [Thu, 2 Mar 2023 23:48:40 +0000 (18:48 -0500)] 
add more DEBUG3

2 years agoUpdate ciena dictionary
Nick Porter [Tue, 28 Feb 2023 07:52:29 +0000 (07:52 +0000)] 
Update ciena dictionary

2 years agoDocument max_retries in ChangeLog
Nick Porter [Fri, 24 Feb 2023 11:34:00 +0000 (11:34 +0000)] 
Document max_retries in ChangeLog

2 years agoDefine max_retries for pool connections (#4908)
Nick Porter [Thu, 23 Feb 2023 18:25:33 +0000 (18:25 +0000)] 
Define max_retries for pool connections (#4908)

Allows control over the number of times a connection operation can be
retried before the module call fails.

Previously this was always set to the number of connections in the pool
- so on a system with a large number of open connections, and a remote
server going slow, this would easily block threads.

2 years agoDestroy MD context, causing leaks with OpenSSL >= 3.0 (#4899)
Jorge Pereira [Mon, 20 Feb 2023 15:13:19 +0000 (12:13 -0300)] 
Destroy MD context, causing leaks with OpenSSL >= 3.0 (#4899)

* rlm_pap: Destroy MD context, causing leaks with OpenSSL >= 3.0

* rlm_ippool: Destroy MD context, causing leaks with OpenSSL >= 3.0

* radius: Destroy MD context, causing leaks with OpenSSL >= 3.0

2 years agobump TLS buffer size to 64K.
Alan T. DeKok [Thu, 16 Feb 2023 20:17:35 +0000 (15:17 -0500)] 
bump TLS buffer size to 64K.

Which should be enough for high-load connections.

And move the "used" field to the start of the record_t structure,
because most of the time we're only looking at the start of the
buffer.

2 years agoBump for 3.2.3
Matthew Newton [Thu, 16 Feb 2023 15:33:00 +0000 (15:33 +0000)] 
Bump for 3.2.3

2 years agorelease 3.2.2 release_3_2_2
Matthew Newton [Wed, 15 Feb 2023 14:11:39 +0000 (14:11 +0000)] 
release 3.2.2

2 years agoRemove broken Dockerfiles for centos8 and debian9 (#4901)
Terry Burton [Thu, 16 Feb 2023 13:39:37 +0000 (13:39 +0000)] 
Remove broken Dockerfiles for centos8 and debian9 (#4901)

These distros are no longer supported.

2 years agoEnsure service user has stable uid/gid between Docker distro versions (#4900)
Terry Burton [Thu, 16 Feb 2023 13:36:26 +0000 (13:36 +0000)] 
Ensure service user has stable uid/gid between Docker distro versions (#4900)

Changing UID between image versions is deprecated because modern container
workflows involve automated image upgrade / rollback using the same mounted-in
volume (i.e. with persistent filesystem permissions).

2 years agomd5 xlat: Destroy MD context, causing leaks with OpenSSL >= 3.0 (#4893)
Terry Burton [Wed, 15 Feb 2023 17:53:28 +0000 (17:53 +0000)] 
md5 xlat: Destroy MD context, causing leaks with OpenSSL >= 3.0 (#4893)