1. 10 4月, 2018 1 次提交
    • R
      fix wrong result in casin and many related complex functions · ae2a01da
      Rich Felker 提交于
      the factor of -i noted in the comment at the top of casin.c was
      omitted from the actual code, yielding a result rotated 90 degrees and
      propagating into errors in other functions defined in terms of casin.
      
      implement multiplication by -i as a rotation of the real and imaginary
      parts of the result, rather than by actual multiplication, since the
      latter cannot be optimized without knowledge that the operand is
      finite. here, the rotation is the actual intent, anyway.
      ae2a01da
  2. 08 4月, 2018 1 次提交
    • S
      implement wcsftime padding specifier extensions · ea81529f
      Samuel Holland 提交于
      Commit 8a6bd730 added support for
      padding specifier extensions to strftime, but did not modify wcsftime.
      In the process, it added a parameter to __strftime_fmt_1 in strftime.c,
      but failed to update the prototype in wcsftime.c. This was found by
      compiling musl with LTO:
      
          src/time/wcsftime.c:7:13: warning: type of '__strftime_fmt_1' does \
              not match original declaration [-Wlto-type-mismatch]
      
      Fix the prototype of __strftime_fmt_1 in wcsftime.c, and generate the
      'pad' argument the same way as it is done in strftime.
      ea81529f
  3. 05 4月, 2018 1 次提交
    • R
      prevent bypass of guarantee that suids start with fd 0/1/2 open · 119bc55b
      Rich Felker 提交于
      it was reported by Erik Bosman that poll fails without setting revents
      when the nfds argument exceeds the current value for RLIMIT_NOFILE,
      causing the subsequent open calls to be bypassed. if the rlimit is
      either 1 or 2, this leaves fd 0 and 1 potentially closed but openable
      when the application code is reached.
      
      based on a brief reading of the poll syscall documentation and code,
      it may be possible for poll to fail under other attacker-controlled
      conditions as well. if it turns out these are reasonable conditions
      that may happen in the real world, we may have to go back and
      implement fallbacks to probe each fd individually if poll fails, but
      for now, keep things simple and treat all poll failures as fatal.
      119bc55b
  4. 03 4月, 2018 1 次提交
    • S
      fix fmaf wrong result · 282b1cd2
      Szabolcs Nagy 提交于
      if double precision r=x*y+z is not a half way case between two single
      precision floats or it is an exact result then fmaf returns (float)r.
      
      however the exactness check was wrong when |x*y| < |z| and could cause
      incorrectly rounded result in nearest rounding mode when r is a half
      way case.
      
      fmaf(-0x1.26524ep-54, -0x1.cb7868p+11, 0x1.d10f5ep-29)
      was incorrectly rounded up to 0x1.d117ap-29 instead of 0x1.d1179ep-29.
      (exact result is 0x1.d1179efffffffecp-29, r is 0x1.d1179fp-29)
      282b1cd2
  5. 29 3月, 2018 1 次提交
    • R
      fix default feature profile in tar.h · 729fef0a
      Rich Felker 提交于
      commit d93c0740 added use of feature
      test macros without including features.h, causing a definition that
      should be exposed in the default profile, TSVTX, to appear only when
      _XOPEN_SOURCE or higher is explicitly defined.
      729fef0a
  6. 25 3月, 2018 2 次提交
    • R
      adjust makefile target-specific CFLAGS rules to be more robust & complete · c7bb9c41
      Rich Felker 提交于
      previously, MEMOPS_SRCS failed to include arch-specific replacement
      files for memcpy, etc., omitting CFLAGS_MEMOPS and thereby potentially
      causing build failure if an arch provided C (rather than asm)
      replacements for these files.
      
      instead of trying to explicitly include all the files that might have
      arch replacements, which is prone to human error, extract final names
      to be used out of $(LIBC_OBJS), where the rules for arch replacements
      have already been applied. do the same for NOSSP_OBJS, using CRT_OBJS
      and LDSO_OBJS rather than repeating ourselves with $(wildcard...) and
      explicit pathnames again.
      c7bb9c41
    • R
      fix out-of-tree build of crt files with stack protector enabled · a7c53e0c
      Rich Felker 提交于
      the makefile logic for these files was wrong in the out-of-tree case,
      but it likely only affected the "all" level of stack protector.
      a7c53e0c
  7. 13 3月, 2018 1 次提交
    • R
      explicitly use signed keyword to define intNN_t and derivative types · 919ad8d5
      Rich Felker 提交于
      standing alone, both the signed and int keywords identify the same
      type, a (signed) int. however the C language has an exception where,
      when the lone keyword int is used to declare a bitfield, it's
      implementation-defined whether the bitfield is signed or unsigned. C11
      footnote 125 extends this implementation-definedness to typedefs, and
      DR#315 extends it to other integer types (for which support with
      bitfields is implementation-defined).
      
      while reasonable ABIs (all the ones we support) define bitfields as
      signed by default, GCC and compatible compilers offer an option
      -funsigned-bitfields to change the default. while any signed types
      defined without explicit use of the signed keyword are affected, the
      stdint.h types, especially intNN_t, have a natural use in bitfields.
      ensure that bitfields defined with these types always have the correct
      signedness regardless of compiler & flags used.
      
      see also GCC PR 83294.
      919ad8d5
  8. 11 3月, 2018 7 次提交
  9. 08 3月, 2018 1 次提交
  10. 26 2月, 2018 1 次提交
    • R
      add public interface headers to implementation files · 57b97b42
      Rich Felker 提交于
      general policy is that all source files defining a public API or an
      ABI mechanism referenced by a public header should include the public
      header that declares the interface, so that the compiler or analysis
      tools can check the consistency of the declarations. Alexander Monakov
      pointed out a number of violations of this principle a few years back.
      fix them now.
      57b97b42
  11. 25 2月, 2018 7 次提交
  12. 24 2月, 2018 3 次提交
  13. 23 2月, 2018 13 次提交