From gdb analysis, imap->tag is valid memory in frame 5, but client->imap->tag is invalid in frame 0 (<error: Cannot access memory at address 0xffffffffff0fc86d>
).
The rest of the struct appears intact, so not an issue with client->imap
in general here.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f0c7c03907d in __imap_client_send_wait_response (client=client@entry=0x7f0c34109050, fd=fd@entry=-1, ms=ms@entry=5000, echo=echo@entry=0, lineno=lineno@entry=303, cb=cb@entry=0x0,
cbdata=<optimized out>, fmt=<optimized out>) at imap_client.c:469
469 } else if (strlen_zero(client->imap->tag)) {
[Current thread is 1 (Thread 0x7f0c397fa6c0 (LWP 23479))]
(gdb)
(gdb)
(gdb) bt
#0 0x00007f0c7c03907d in __imap_client_send_wait_response
(client=client@entry=0x7f0c34109050, fd=fd@entry=-1, ms=ms@entry=5000, echo=echo@entry=0, lineno=lineno@entry=303, cb=cb@entry=0x0, cbdata=<optimized out>, fmt=<optimized out>) at imap_client.c:469
#1 0x00007f0c7c039703 in imap_client_idle_notify (client=0x7f0c34109050) at imap_client.c:303
#2 imap_client_idle_notify (client=0x7f0c34109050) at imap_client.c:250
#3 0x00007f0c7c046638 in set_maildir (imap=imap@entry=0x7f0c397f75d0, mailbox=mailbox@entry=0x7f0c397f7b4b REDACTED) at imap_server_maildir.c:202
#4 0x00007f0c7c056a1b in handle_select (imap=imap@entry=0x7f0c397f75d0, s=<optimized out>, readonly=readonly@entry=CMD_SELECT) at net_imap.c:1407
#5 0x00007f0c7c0633bd in imap_process (imap=imap@entry=0x7f0c397f75d0, s=<optimized out>, s@entry=0x7f0c397f7b40 "74") at net_imap.c:4359
#6 0x00007f0c7c0670f6 in handle_client (imap=0x7f0c397f75d0) at net_imap.c:4783
#7 imap_handler (node=node@entry=0x5555688af450, secure=<optimized out>) at net_imap.c:4816
#8 0x00007f0c7c067624 in __imap_handler (varg=varg@entry=0x5555688af450) at net_imap.c:4840
#9 0x0000555568532419 in thread_run (data=<optimized out>) at thread.c:406
#10 0x00007f0c7e687134 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#11 0x00007f0c7e7077dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
You must be
10/13/2024 12:25 PM — InterLinked
Autoresolved by code commit on GitHub:
net_imap: Prevent invalid memory accesses due to stale pointer.
https://github.com/InterLinked1/lbbs/commit/d86994c4e00a03dd22b096b7a2bab2d7346a5f33