]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/AER: Avoid info leak in __print_tlp_header()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 26 Feb 2015 08:55:03 +0000 (09:55 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 6 Mar 2015 18:30:23 +0000 (12:30 -0600)
commitb95500d74defd9f8ac6d2c73e8b0816b07154540
tree2e6f5112ff81f65cbcae5490988ce1724ec5fe90
parente8f2c39ecb72870e9d46eb4921160a872a830ee9
PCI/AER: Avoid info leak in __print_tlp_header()

Commit bdc33d449b75 ("PCI/AER: Add a TLP header print helper") introduced
the helper function __print_tlp_header(), but contrary to the intention,
the behaviour did change: Since we're taking the address of the parameter
t, the first 4 or 8 bytes printed will be the value of the pointer t
itself, and the remaining 12 or 8 bytes will be who-knows-what (something
from the stack).

We want to show the values of the four members of the struct
aer_header_log_regs; that can be done without ugly and error-prone casts.
On little-endian this should produce the same output as originally
intended, and since no-one has complained about getting garbage output so
far, I think big-endian should be ok too.

Fixes: bdc33d449b75 ("PCI/AER: Add a TLP header print helper")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Borislav Petkov <bp@suse.de>
CC: stable@vger.kernel.org # v3.14+
drivers/pci/pcie/aer/aerdrv_errprint.c