]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoadd stub function radiusv11
Alan T. DeKok [Wed, 12 Apr 2023 14:40:32 +0000 (10:40 -0400)] 
add stub function

2 years agolast bit of magic to make it work
Alan T. DeKok [Wed, 12 Apr 2023 14:05:44 +0000 (10:05 -0400)] 
last bit of magic to make it work

the client calls SSL_get0_alpn_selected()

2 years agono need for these debug messages
Alan T. DeKok [Tue, 11 Apr 2023 23:56:07 +0000 (19:56 -0400)] 
no need for these debug messages

2 years agodon't set default value for radiusv11
Alan T. DeKok [Tue, 11 Apr 2023 23:55:22 +0000 (19:55 -0400)] 
don't set default value for radiusv11

so that it isn't printed out when it's not used

2 years agouse SSL_select_next_proto()
Alan T. DeKok [Tue, 11 Apr 2023 23:36:55 +0000 (19:36 -0400)] 
use SSL_select_next_proto()

2 years agomove init client ALPN to home server
Alan T. DeKok [Tue, 11 Apr 2023 18:24:12 +0000 (14:24 -0400)] 
move init client ALPN to home server

so that we don't have potential threading issues with SSL_CTX

2 years agouse RDEBUG
Alan T. DeKok [Tue, 11 Apr 2023 17:37:37 +0000 (13:37 -0400)] 
use RDEBUG

2 years agonotes and todo for SSL_CTX_set_next_proto_select_cb()
Alan T. DeKok [Tue, 11 Apr 2023 16:54:27 +0000 (12:54 -0400)] 
notes and todo for SSL_CTX_set_next_proto_select_cb()

due to missing SSL_set_next_proto_select_cb()

2 years agoError out on ALPN negotiation failures with home server.
Alan T. DeKok [Tue, 11 Apr 2023 16:53:35 +0000 (12:53 -0400)] 
Error out on ALPN negotiation failures with home server.

We have 'radiusv11 = require', but the home server did not send
ALPN, so we close the connection.

2 years agoonly set RADIUSv11 if TLS is being used
Alan T. DeKok [Tue, 11 Apr 2023 16:05:28 +0000 (12:05 -0400)] 
only set RADIUSv11 if TLS is being used

2 years agomore cleanups and rearrangements
Alan T. DeKok [Tue, 11 Apr 2023 15:19:24 +0000 (11:19 -0400)] 
more cleanups and rearrangements

it still doesn't work, as the server doesn't send any ALPN
protocols.

2 years agorearrange negotiation of radiusv11 so that it works
Alan T. DeKok [Tue, 11 Apr 2023 13:49:09 +0000 (09:49 -0400)] 
rearrange negotiation of radiusv11 so that it works

2 years agomove radiusv11 configuration to CONF_PARSER stuff
Alan T. DeKok [Tue, 11 Apr 2023 13:48:48 +0000 (09:48 -0400)] 
move radiusv11 configuration to CONF_PARSER stuff

2 years agoadd radiusv11 configuration to TLS tests
Alan T. DeKok [Tue, 11 Apr 2023 13:47:44 +0000 (09:47 -0400)] 
add radiusv11 configuration to TLS tests

2 years agodocument radiusv11 configuration
Alan T. DeKok [Tue, 11 Apr 2023 12:50:55 +0000 (08:50 -0400)] 
document radiusv11 configuration

2 years agofirst pass at getting ALPN negotiation working
Alan T. DeKok [Tue, 11 Apr 2023 12:46:11 +0000 (08:46 -0400)] 
first pass at getting ALPN negotiation working

2 years agocopy radiusv11 flags to running listener
Alan T. DeKok [Mon, 10 Apr 2023 14:57:08 +0000 (10:57 -0400)] 
copy radiusv11 flags to running listener

2 years agoparse "radiusv11 = ..." for listeners, clients, and home servers
Alan T. DeKok [Mon, 10 Apr 2023 13:25:06 +0000 (09:25 -0400)] 
parse "radiusv11 = ..." for listeners, clients, and home servers

2 years agoenforce per-packet RADIUSv11 flag.
Alan T. DeKok [Sun, 9 Apr 2023 16:46:41 +0000 (12:46 -0400)] 
enforce per-packet RADIUSv11 flag.

2 years agoset up for RADIUSv11
Alan T. DeKok [Sun, 9 Apr 2023 16:45:33 +0000 (12:45 -0400)] 
set up for RADIUSv11

2 years agorearrange so we wake up
Alan T. DeKok [Sun, 9 Apr 2023 16:02:32 +0000 (12:02 -0400)] 
rearrange so we wake up

2 years agoadd "want_read" and "want_write" callbacks.
Alan T. DeKok [Sun, 9 Apr 2023 15:22:40 +0000 (11:22 -0400)] 
add "want_read" and "want_write" callbacks.

2 years agonote recent changes
Alan T. DeKok [Fri, 7 Apr 2023 13:58:10 +0000 (09:58 -0400)] 
note recent changes

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()