lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #58817] SNTP - MEMP_SYS_TIMEOUT memory pool exhaustion


From: yuanjianmin
Subject: [lwip-devel] [bug #58817] SNTP - MEMP_SYS_TIMEOUT memory pool exhaustion when receive KOD packet
Date: Thu, 20 May 2021 06:02:19 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0

Follow-up Comment #1, bug #58817 (project lwip):


[comment #0 original submission:]
> There appears to be an issue when receiving SNTP Kiss Of Death packets.
After receiving several KOD packets, I started to see 'sys_timeout: timeout !=
NULL, pool MEMP_SYS_TIMEOUT is empty' assertions displayed. 
> 
> Looking at SNTP.C, around line 536, we have two sys_untimeout functions
calls to cancel active timeouts when receiving a good packet. However, there
isn't a corresponding sys_untimeout(sntp_request) just before the
sntp_try_next_server call around line 553 when receiving a KOD packet. Since
the timeout isn't cancelled, this appears to reduce the memory pool which
eventually results in the assertion displayed above. Changing the code to :
> 
>     if (sntp_opmode == SNTP_OPMODE_POLL) {
>       /* Kiss-of-death packet. Use another server or increase UPDATE_DELAY.
*/
>       sys_untimeout(sntp_request, NULL);
> 
>       sntp_try_next_server(NULL);
>     }
> 
> appears to solve the problem.
> 

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?58817>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]