]> git.proxmox.com Git - mirror_edk2.git/commit
CryptoPkg/Crt: satisfy "inet_pton.c" dependencies (CVE-2019-14553)
authorLaszlo Ersek <lersek@redhat.com>
Thu, 24 Oct 2019 15:03:57 +0000 (17:03 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Sat, 2 Nov 2019 11:07:52 +0000 (12:07 +0100)
commit2ac41c12c0d4b3d3ee8f905ab80da019e784de00
treea56cb8b22a2d3913d22b5e0bddf33a613ba5052b
parenteb520d94dba7369d1886cd5522d5a2c36fb02209
CryptoPkg/Crt: satisfy "inet_pton.c" dependencies (CVE-2019-14553)

In a later patch in this series, we're going to resurrect "inet_pton.c"
(originally from the StdLib package). That source file has a number of
standard C and BSD socket dependencies. Provide those dependencies here:

- The header files below will simply #include <CrtLibSupport.h>:

  - arpa/inet.h
  - arpa/nameser.h
  - netinet/in.h
  - sys/param.h
  - sys/socket.h

- EAFNOSUPPORT comes from "StdLib/Include/errno.h", at commit
  e2d3a25f1a31; which is the commit immediately preceding the removal of
  StdLib from edk2 (964f432b9b0a).

  Note that the other error macro, which we alread #define, namely EINVAL,
  has a value (22) that also matches "StdLib/Include/errno.h".

- The AF_INET and AF_INET6 address family macros come from
  "StdLib/Include/sys/socket.h".

- The NS_INT16SZ, NS_INADDRSZ and NS_IN6ADDRSZ macros come from
  "StdLib/Include/arpa/nameser.h".

- The "u_int" and "u_char" types come from "StdLib/Include/sys/types.h".

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Sivaraman Nainar <sivaramann@amiindia.co.in>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=960
CVE: CVE-2019-14553
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
CryptoPkg/Library/Include/CrtLibSupport.h
CryptoPkg/Library/Include/arpa/inet.h [new file with mode: 0644]
CryptoPkg/Library/Include/arpa/nameser.h [new file with mode: 0644]
CryptoPkg/Library/Include/netinet/in.h [new file with mode: 0644]
CryptoPkg/Library/Include/sys/param.h [new file with mode: 0644]
CryptoPkg/Library/Include/sys/socket.h [new file with mode: 0644]