~ubuntu-branches/ubuntu/trusty/eglibc/trusty-security

« back to all changes in this revision

Viewing changes to catgets/tst-catgets.c

  • Committer: Package Import Robot
  • Author(s): Steve Beattie
  • Date: 2016-04-08 23:26:02 UTC
  • Revision ID: package-import@ubuntu.com-20160408232602-694337pzn1m5xgc3
Tags: 2.19-0ubuntu6.8
* SECURITY UPDATE: buffer overflow in gethostbyname_r and related
  functions
  - debian/patches/any/CVE-2015-1781.diff: take alignment padding
    into account when computing if buffer is too small.
  - CVE-2015-1781
* SECURITY UPDATE: glibc Name Service Switch (NSS) denial of sevice
  - debian/patches/any/CVE-2014-8121-1.diff: do not close NSS files
    database during iteration.
  - debian/patches/any/CVE-2014-8121-2.diff: Separate internal state
    between getXXent and getXXbyYY NSS calls.
  - CVE-2014-8121
* SECURITY UPDATE: glibc unbounded stack usage in NaN strtod
  conversion
  - debian/patches/any/CVE-2014-9761-1.diff: Refactor strtod parsing
    of NaN payloads.
  - debian/patches/any/CVE-2014-9761-1.diff:  Fix nan functions
    handling of payload strings
  - CVE-2014-9761
* SECURITY UPDATE: NSS files long line buffer overflow
  - debian/patches/any/CVE-2015-5277.diff: Don't ignore too long
    lines in nss_files
  - CVE-2015-5277
* SECURITY UPDATE: out of range data to strftime() causes segfault
  (denial of service)
  - debian/patches/any/CVE-2015-8776.diff: add range checks to
    strftime() processing
  - CVE-2015-8776
* SECURITY UPDATE: glibc honors LD_POINTER_GUARD env for setuid
  AT_SECURE programs (e.g. setuid), allowing disabling of pointer
  mangling
  - debian/patches/any/CVE-2015-8777.diff: Always enable pointer
    guard
  - CVE-2015-8777
* SECURITY UPDATE: integer overflow in hcreate and hcreate_r
  - debian/patches/any/CVE-2015-8778.diff: check for large inputs
  - CVE-2015-8778
* SECURITY UPDATE: unbounded stack allocation in catopen()
  - debian/patches/any/CVE-2015-8779.diff: stop using unbounded
    alloca()
  - CVE-2015-8779
* SECURITY UPDATE: Stack overflow in _nss_dns_getnetbyname_r
  - debian/patches/any/CVE-2016-3075.diff: do not make unneeded
    memory copy on the stack.
  - CVE-2016-3075
* SECURITY UPDATE: pt_chown privilege escalation
  - debian/patches/any/CVE-2016-2856.diff: grantpt: trust the kernel
    about pty group and permission mode
  - debian/sysdeps/linux.mk: don't build pt_chown
  - debian/rules.d/debhelper.mk: only install pt_chown when built.
  - CVE-2016-2856, CVE-2013-2207
* debian/debhelper.in/libc.postinst: add reboot notifications for
  security updates (LP: #1546457)
* debian/patches/ubuntu/submitted-no-stack-backtrace.diff: update
  patch to eliminate compiler warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <assert.h>
1
2
#include <mcheck.h>
2
3
#include <nl_types.h>
3
4
#include <stdio.h>
 
5
#include <stdlib.h>
4
6
#include <string.h>
 
7
#include <sys/resource.h>
5
8
 
6
9
 
7
10
static const char *msgs[] =
12
15
};
13
16
#define nmsgs (sizeof (msgs) / sizeof (msgs[0]))
14
17
 
 
18
 
 
19
/* Test for unbounded alloca.  */
 
20
static int
 
21
do_bz17905 (void)
 
22
{
 
23
  char *buf;
 
24
  struct rlimit rl;
 
25
  nl_catd result;
 
26
 
 
27
  const int sz = 1024 * 1024;
 
28
 
 
29
  getrlimit (RLIMIT_STACK, &rl);
 
30
  rl.rlim_cur = sz;
 
31
  setrlimit (RLIMIT_STACK, &rl);
 
32
 
 
33
  buf = malloc (sz + 1); 
 
34
  memset (buf, 'A', sz);
 
35
  buf[sz] = '\0';
 
36
  setenv ("NLSPATH", buf, 1);
 
37
 
 
38
  result = catopen (buf, NL_CAT_LOCALE);
 
39
  assert (result == (nl_catd) -1);
 
40
 
 
41
  free (buf);
 
42
  return 0;
 
43
}
 
44
 
15
45
#define ROUNDS 5
16
46
 
17
47
int
62
92
        }
63
93
    }
64
94
 
 
95
  result += do_bz17905 ();
65
96
  return result;
66
97
}