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/19690] New: Do not store resolver state (_res) in TCB


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

            Bug ID: 19690
           Summary: Do not store resolver state (_res) in TCB
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

struct __res_state is fairly large:

(gdb) print sizeof (struct __res_state)
$3 = 568

A copy is included in struct pthread (see nptl/descr.h):

    378   /* Resolver state.  */
    379   struct __res_state res;

Lazy allocation is somewhat difficult because allocation is not allowed to
fail.  We can avoid the allocation with some linker hacks, for binaries which
do not reference the thread-local _res structure.  I think this is a worthwhile
optimization.

nss_dns and nss_files do not actually have to use the _res structure if we
provide a better internal interface for their needs.  Almost all of the state
used by these NSS modules is global, not thread-local because it comes from
/etc/resolv.conf.

-- 
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]