]> git.baikalelectronics.ru Git - kernel.git/commit
efi-pstore: Fix an overflow on 32-bit builds
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>
Mon, 9 Jun 2014 14:50:40 +0000 (16:50 +0200)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 27 Jun 2014 06:30:32 +0000 (07:30 +0100)
commit56d064fcf3bff9eea6ecc93d96f7f3eb6b32c211
treeee0a091dc73f4a49daa988de831efa15f52a9d2f
parent2067db3f2fc9a8c744d06a1eee14e708e7060da0
efi-pstore: Fix an overflow on 32-bit builds

In generic_id the long int timestamp is multiplied by 100000 and needs
an explicit cast to u64.

Without that the id in the resulting pstore filename is wrong and
userspace may have problems parsing it, but more importantly files in
pstore can never be deleted and may fill the EFI flash (brick device?).
This happens because when generic pstore code wants to delete a file,
it passes the id to the EFI backend which reinterpretes it and a wrong
variable name is attempted to be deleted.  There's no error message but
after remounting pstore, deleted files would reappear.

Signed-off-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efi/efi-pstore.c