This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/19074] New: Data race in _res_hconf_reorder_addrs


https://sourceware.org/bugzilla/show_bug.cgi?id=19074

            Bug ID: 19074
           Summary: Data race in _res_hconf_reorder_addrs
           Product: glibc
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: fweimer at redhat dot com
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

_res_hconf_reorder_addrs contains an instance of the incorrect double-checked
locking idiom:

  /* Number of interfaces.  */
  static int num_ifs = -1;
  /* We need to protect the dynamic buffer handling.  */
  __libc_lock_define_initialized (static, lock);
â
  if (num_ifs <= 0)
    {
â
      /* Get lock.  */
      __libc_lock_lock (lock);

      /* Recheck, somebody else might have done the work by now.  */
      if (num_ifs <= 0)
â
          num_ifs = new_num_ifs;
        }

      __libc_lock_unlock (lock);

num_ifs needs to be accessed with acquire loads and a release store.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]