lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #49863] Data race in netconn_gethostbyname()


From: Thomas Mueller
Subject: [lwip-devel] [bug #49863] Data race in netconn_gethostbyname()
Date: Fri, 16 Dec 2016 13:35:05 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:50.0) Gecko/20100101 Firefox/50.0

URL:
  <http://savannah.nongnu.org/bugs/?49863>

                 Summary: Data race in netconn_gethostbyname()
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: tmu
            Submitted on: Fri 16 Dec 2016 01:35:03 PM GMT
                Category: DNS
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.0.0

    _______________________________________________________

Details:

Function netconn_gethostbyname() uses tcpip_callback() to
execute lwip_netconn_do_gethostbyname() in the context
of tcpip_thread. In configurations with LWIP_MPU_COMPATIBLE=0
netconn_gethostbyname() passes the address of local variable
'err' in the argument to function lwip_netconn_do_gethostbyname()
Variable 'err' is also used to store the return value of tcpip_callback().

Depending on scheduling policies and priorities, the function
to be executed by the tcpip_thread may have completed before
function tcpip_callback() returns and storing the return value
of tcpip_callback() in 'err' will overwrite the value returned
by lwip_netconn_do_gethostbyname().

Using a separate local variable to store the return value of
tcpip_callback() resolves the issue.








    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?49863>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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