1. 21 6月, 2016 2 次提交
  2. 13 6月, 2016 3 次提交
  3. 16 5月, 2016 2 次提交
    • D
      ibft: Expose iBFT acpi header via sysfs · b3c8eb50
      David Bond 提交于
      Some ethernet adapter vendors are supplying products which support optional
      (payed license) features. On some adapters this includes a hardware iscsi
      initiator.  The same adapters in a normal (no extra licenses) mode of
      operation can be used as a software iscsi initiator.  In addition, software
      iscsi boot initiators are becoming a standard part of many vendors uefi
      implementations.  This is creating difficulties during early boot/install
      determining the proper configuration method for these adapters when they
      are used as a boot device.
      
      The attached patch creates sysfs entries to expose information from the
      acpi header of the ibft table.  This information allows for a method to
      easily determining if an ibft table was created by a ethernet card's
      firmware or the system uefi/bios.  In the case of a hardware initiator this
      information in combination with the pci vendor and device id can be used
      to ascertain any vendor specific behaviors that need to be accommodated.
      Reviewed-by: NLee Duncan <lduncan@suse.com>
      Signed-off-by: NDavid Bond <dbond@suse.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b3c8eb50
    • H
      iscsi_ibft: Add prefix-len attr and display netmask · 9a99425f
      Hannes Reinecke 提交于
      The iBFT table only specifies a prefix length, not a netmask.
      And the netmask is pretty much pointless for IPv6.
      So introduce a new attribute 'prefix-len'.
      
      Some older user-space code might rely on the netmask attribute
      being present, so we should always display it.
      
      Changes from v1:
       - Combined two patches into one
      
      Changes from v2:
       - Cleaned up/corrected wording for patch description
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NLee Duncan <lduncan@suse.com>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad@kernel.org>
      9a99425f
  4. 13 5月, 2016 1 次提交
  5. 07 5月, 2016 4 次提交
    • J
      efi: Merge boolean flag arguments · 1cfd6316
      Julia Lawall 提交于
      The parameters atomic and duplicates of efivar_init always have opposite
      values.  Drop the parameter atomic, replace the uses of !atomic with
      duplicates, and update the call sites accordingly.
      
      The code using duplicates is slightly reorganized with an 'else', to avoid
      duplicating the lock code.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jeremy Kerr <jk@ozlabs.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Saurabh Sengar <saurabh.truth@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vaishali Thakkar <vaishali.thakkar@oracle.com>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462570771-13324-5-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      1cfd6316
    • M
      efi/capsule: Move 'capsule' to the stack in efi_capsule_supported() · fb7a84ca
      Matt Fleming 提交于
      Dan Carpenter reports that passing the address of the pointer to the
      kmalloc()'d memory for 'capsule' is dangerous:
      
       "drivers/firmware/efi/capsule.c:109 efi_capsule_supported()
        warn: did you mean to pass the address of 'capsule'
      
         108
         109          status = efi.query_capsule_caps(&capsule, 1, &max_size, reset);
                                                      ^^^^^^^^
        If we modify capsule inside this function call then at the end of the
        function we aren't freeing the original pointer that we allocated."
      
      Ard Biesheuvel noted that we don't even need to call kmalloc() since the
      object we allocate isn't very big and doesn't need to persist after the
      function returns.
      
      Place 'capsule' on the stack instead.
      Suggested-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: joeyli <jlee@suse.com>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462570771-13324-4-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      fb7a84ca
    • J
      efibc: Fix excessive stack footprint warning · 2e121d71
      Jeremy Compostella 提交于
      GCC complains about a newly added file for the EFI Bootloader Control:
      
        drivers/firmware/efi/efibc.c: In function 'efibc_set_variable':
        drivers/firmware/efi/efibc.c:53:1: error: the frame size of 2272 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      The problem is the declaration of a local variable of type struct
      efivar_entry, which is by itself larger than the warning limit of 1024
      bytes.
      
      Use dynamic memory allocation instead of stack memory for the entry
      object.
      
      This patch also fixes a potential buffer overflow.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJeremy Compostella <jeremy.compostella@intel.com>
      [ Updated changelog to include GCC error ]
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462570771-13324-3-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      2e121d71
    • M
      efi/capsule: Make efi_capsule_pending() lockless · 62075e58
      Matt Fleming 提交于
      Taking a mutex in the reboot path is bogus because we cannot sleep
      with interrupts disabled, such as when rebooting due to panic(),
      
        BUG: sleeping function called from invalid context at kernel/locking/mutex.c:97
        in_atomic(): 0, irqs_disabled(): 1, pid: 7, name: rcu_sched
        Call Trace:
          dump_stack+0x63/0x89
          ___might_sleep+0xd8/0x120
          __might_sleep+0x49/0x80
          mutex_lock+0x20/0x50
          efi_capsule_pending+0x1d/0x60
          native_machine_emergency_restart+0x59/0x280
          machine_emergency_restart+0x19/0x20
          emergency_restart+0x18/0x20
          panic+0x1ba/0x217
      
      In this case all other CPUs will have been stopped by the time we
      execute the platform reboot code, so 'capsule_pending' cannot change
      under our feet. We wouldn't care even if it could since we cannot wait
      for it complete.
      
      Also, instead of relying on the external 'system_state' variable just
      use a reboot notifier, so we can set 'stop_capsules' while holding
      'capsule_mutex', thereby avoiding a race where system_state is updated
      while we're in the middle of efi_capsule_update_locked() (since CPUs
      won't have been stopped at that point).
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: joeyli <jlee@suse.com>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462570771-13324-2-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      62075e58
  6. 29 4月, 2016 1 次提交
    • A
      arm64: kaslr: increase randomization granularity · 6f26b367
      Ard Biesheuvel 提交于
      Currently, our KASLR implementation randomizes the placement of the core
      kernel at 2 MB granularity. This is based on the arm64 kernel boot
      protocol, which mandates that the kernel is loaded TEXT_OFFSET bytes above
      a 2 MB aligned base address. This requirement is a result of the fact that
      the block size used by the early mapping code may be 2 MB at the most (for
      a 4 KB granule kernel)
      
      But we can do better than that: since a KASLR kernel needs to be relocated
      in any case, we can tolerate a physical misalignment as long as the virtual
      misalignment relative to this 2 MB block size is equal in size, and code to
      deal with this is already in place.
      
      Since we align the kernel segments to 64 KB, let's randomize the physical
      offset at 64 KB granularity as well (unless CONFIG_DEBUG_ALIGN_RODATA is
      enabled). This way, the page table and TLB footprint is not affected.
      
      The higher granularity allows for 5 bits of additional entropy to be used.
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6f26b367
  7. 28 4月, 2016 24 次提交
  8. 26 4月, 2016 3 次提交