freenode / ircd-seven

freenode's IRC server daemon
Other
200 stars 48 forks source link

Possible segmentation fault during a remote MODRESTART. #21

Closed mniip closed 6 years ago

mniip commented 7 years ago

A MODRESTART reloads all modules, including m_encap.so. However if the MODRESTART command came from a server (in an ENCAP), we will have ms_encap in the call stack. Unless a lucky coincidence occurs, the modules will be loaded at different addresses, and the call stack will become corrupt, segfaulting the ircd upon return from the command handling code.

edk0 commented 7 years ago

MODUNLOADing m_encap.so will reliably crash the ircd too.

kaniini commented 7 years ago

I shot myself in the foot with a 12 gauge shotgun, can you guys fix that too?

kaniini commented 7 years ago

(In all seriousness m_encap should probably be a protected module.)