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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:12:02 +0000 (20:12 -0700)
commit6d646b4de65b8eccad37b20be955c547fa66806c
treea3bfa5ffd258b2dd45c960a3a65dcac4a2e40ef2
parentbf695f730888a9f2f325245f730e6df508b112f9
efi-pstore: Fix an overflow on 32-bit builds

commit 783ee43118dc773bc8b0342c5b230e017d5a04d0 upstream.

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>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/efi-pstore.c