tempesta-tech / tempesta

All-in-one solution for high performance web content delivery and advanced protection against DDoS and web attacks
https://tempesta-tech.com/
GNU General Public License v2.0
614 stars 103 forks source link

Make socket callbacks `sk_fill_write_queue` and `sk_write_xmit` reentable or close connection in case of -ENOMEM #2154

Open EvgeniiMekhanik opened 2 months ago

EvgeniiMekhanik commented 2 months ago

There are a lot of bugs which can occur if we catch -ENOMEM during sk_fill_write_queue or sk_write_xmit execution. They occur because we don't close connection in case of -ENOMEM error in this functions but only wait until memory will be available and call this functions again. This functions are not reentable so there are a lot of bugs. For example we call skb_push in sk_write_xmit->tfw_tls_encrypt for skb again and again until bug occurs in case of -ENOMEM.

krizhanovsky commented 2 months ago

Probably is good to do with #1504

EvgeniiMekhanik commented 2 months ago

There are a lot of bugs which depends on this fix https://github.com/tempesta-tech/tempesta/issues/2042 2120,