Skip to content
Snippets Groups Projects
  1. Jul 16, 2021
  2. Jul 06, 2021
  3. Jun 23, 2021
  4. Jun 21, 2021
  5. Jun 19, 2021
  6. Jun 14, 2021
  7. Jun 12, 2021
  8. Jun 11, 2021
  9. May 31, 2021
    • Sören Tempel's avatar
      Disable progress bar on dumb terminals by default · 429e5984
      Sören Tempel authored
      The progress bar requires the terminal emulator to support ANSI escape
      sequences. Normally, TERM is set to dumb to indicate that the terminal
      emulator doesn't support any ANSI escape sequences. Attempting to use
      ANSI escape sequences on dumb terminals will lead to weird output. In
      order to make apk work by default, even on dumb terminals, this commit
      introduces an additional check which consults $TERM and disables the
      progress bar if it is set to "dumb".
      429e5984
  10. Jun 02, 2021
  11. May 26, 2021
  12. May 19, 2021
    • Timo Teräs's avatar
      solver: don't consider requirer count for preference · 7167bc9e
      Timo Teräs authored
      The original intent was to choose packages to which there is most
      dependencies. However, since the code has evolved this is has been
      mostly obsolete. And in fact now interferes with the provides and
      provides priority mechanism. Remove this as obsolete.
      
      Fixes #10742
      7167bc9e
  13. Apr 12, 2021
    • Timo Teräs's avatar
      io_archive: add bounds limit for uname and gname tar header fields · f7143c17
      Timo Teräs authored
      
      Modify apk_resolve_[ug]id to take the user/groupname as a blob, so
      proper length checking is done and honored.
      
      ==31584== Conditional jump or move depends on uninitialised value(s)
      ==31584==    at 0x5C8CA5: strlen (strlen.c:17)
      ==31584==    by 0x432575: APK_BLOB_STR (apk_blob.h:79)
      ==31584==    by 0x4350EB: apk_resolve_uid (io.c:1112)
      ==31584==    by 0x43696C: apk_tar_parse (io_archive.c:152)
      ==31584==    by 0x4271BC: apk_pkg_read (package.c:929)
      ==31584==    by 0x402D75: add_main (app_add.c:163)
      ==31584==    by 0x40D5FF: main (apk-static.c:516)
      
      Fixes a potential crash (DoS) on a crafted TAR file. CVE-2021-30139.
      
      Reported-by: default avatarSören Tempel <soeren+git@soeren-tempel.net>
      Reviewed-by: default avatarAriadne Conill <ariadne@dereferenced.org>
      f7143c17
  14. Apr 11, 2021
    • Timo Teräs's avatar
      io: fix fd leak in error handling paths · 4bcd7921
      Timo Teräs authored
      apk_dir_foreach_file and apk_resolve_[ug]id needs to free the fd in
      case fdopen/fdopendir fails. Additionally this does not rely on fdopen
      to fail if openat() returned -1, making sure that we don't call any
      syscalls with invalid file handle.
      4bcd7921
  15. Apr 02, 2021
    • Sören Tempel's avatar
      Fix segfault in log_internal if prefix is APK_OUT_LOG_ONLY · 1b954e41
      Sören Tempel authored
      This commit fixes a regression which was introduced in changeset
      646c8344. If apk_out_fmt() is called
      while out->log is set and prefix is set to APK_OUT_LOG_ONLY, then
      apk_out_fmt() would pass this prefix to log_internal() which would, in
      turn, attempt to write it to standard out using fprintf().
      Unfortunately, doing so wont work as intended if prefix is ((char*)-1)
      (i.e. APK_OUT_LOG_ONLY) and will cause a segmentation fault instead.
      
      This commit fixes this segmentation fault by not printing the prefix in
      log_internal() if it is either NULL or APK_OUT_LOG_ONLY.
      1b954e41
  16. Mar 19, 2021
  17. Mar 16, 2021
  18. Mar 13, 2021
    • Martin Vahlensieck's avatar
      Use correct port when redirected · 8e993fe9
      Martin Vahlensieck authored and Timo Teräs's avatar Timo Teräs committed
      If server redirects from http to https, libfetch detects this, but
      wrongly uses the old url scheme to determine the port. This subsequently
      leads to the following OpenSSL error:
      
      139741541575496:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:331:
      
      Using the new scheme fixes this.  This error message comes from trying
      to connect to port 80 with TLS, it can also be observed by issuing
        $ openssl s_client -connect alpinelinux.org:80
      
      This bug was introduced in commit:
      7158474f libfetch: keep http auth only if redirect is for the same host
      8e993fe9
  19. Feb 07, 2021
  20. Feb 04, 2021
    • Timo Teräs's avatar
      db: consider control characters in filename as malicious · 1a4f2e94
      Timo Teräs authored
      
      Especially a newline can produce havoc in the database file as
      the filename is written there as-is. This hardenes the extraction
      to consider any control character as malicious. Additional
      hardening is added to database loading to better detect corrupt
      state and return proper error code about it.
      
      Reported-by: default avatarLuca Weiss <luca@z3ntu.xyz>
      1a4f2e94
    • Olliver Schinagl's avatar
      io: Handle really long lines · f6656f9d
      Olliver Schinagl authored and Timo Teräs's avatar Timo Teräs committed
      
      While commit 18b0b45b (io: Handle long lines, Thu Jan 7 17:25:23 2021
      +0100) did attempt to address this issue, the buffer really is still to
      small when dealing with big-big dependency lists.
      
      Lets make it sufficiently large for now, until the new APKINDEX format
      can support multi-line dependencies, making this not needed any more.
      
      [TT: Originally the buffer size was conservative to run on resource
      constrained embedded platforms. But since the available memory on those
      has also increased much, the adjustment to 128kB makes sense also to
      increase performance a little bit. Removing also the iolimit test.]
      
      Signed-off-by: default avatarOlliver Schinagl <oliver@schinagl.nl>
      f6656f9d
Loading