1. 18 Jun, 2019 4 commits
    • Takashi Iwai's avatar
      firmware: Add support for loading compressed files · 82fd7a81
      Takashi Iwai authored
      This patch adds the support for loading compressed firmware files.
      The primary motivation is to reduce the storage size; e.g. currently
      the files in /lib/firmware on my machine counts up to 419MB, while
      they can be reduced to 130MB by file compression.
      
      The patch introduces a new kconfig option CONFIG_FW_LOADER_COMPRESS.
      Even with this option set, the firmware loader still tries to load the
      original firmware file as-is at first, but then falls back to the file
      with ".xz" extension when it's not found, and the decompressed file
      content is returned to the caller of request_firmware().  So, no
      change is needed for the rest.
      
      Currently only XZ format is supported.  A caveat is that the kernel XZ
      helper code supports only CRC32 (or none) integrity check type, so
      you'll have to compress the files via xz -C crc32 option.
      
      Since we can't determine the expanded size immediately from an XZ
      file, the patch re-uses the paged buffer that was used for the
      user-mode fallback; it puts the decompressed content page, which are
      vmapped at the end.  The paged buffer code is conditionally built with
      a new Kconfig that is selected automatically.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      82fd7a81
    • Takashi Iwai's avatar
      firmware: Factor out the paged buffer handling code · 5342e709
      Takashi Iwai authored
      This is merely a preparation for the upcoming compressed firmware
      support and no functional changes.  It moves the code to handle the
      paged buffer allocation and mapping out of fallback.c into the main
      code, so that they can be used commonly.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5342e709
    • Geert Uytterhoeven's avatar
      tools/firmware: Add missing newline at end of file · 3aa69801
      Geert Uytterhoeven authored
      "git diff" says:
      
          \ No newline at end of file
      
      after modifying the file.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3aa69801
    • Sven Van Asbroeck's avatar
      firmware: improve LSM/IMA security behaviour · 2472d64a
      Sven Van Asbroeck authored
      The firmware loader queries if LSM/IMA permits it to load firmware
      via the sysfs fallback. Unfortunately, the code does the opposite:
      it expressly permits sysfs fw loading if security_kernel_load_data(
      LOADING_FIRMWARE) returns -EACCES. This happens because a
      zero-on-success return value is cast to a bool that's true on success.
      
      Fix the return value handling so we get the correct behaviour.
      
      Fixes: 6e852651 ("firmware: add call to LSM hook before firmware sysfs fallback")
      Cc: Stable <stable@vger.kernel.org>
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Kees Cook <keescook@chromium.org>
      To: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSven Van Asbroeck <TheSven73@gmail.com>
      Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2472d64a
  2. 17 Jun, 2019 1 commit
  3. 15 Jun, 2019 2 commits
  4. 14 Jun, 2019 4 commits
  5. 13 Jun, 2019 4 commits
  6. 12 Jun, 2019 3 commits
  7. 10 Jun, 2019 3 commits
  8. 05 Jun, 2019 1 commit
  9. 03 Jun, 2019 18 commits