diff options
author | Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 2018-07-04 23:27:02 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-26 08:33:52 +0200 |
commit | 5fcb40fd186b30b72de7bf42d84e44b62aa1b4f8 (patch) | |
tree | 106be0c3d055fa141c00cc26b193f7f72dd92b87 /fs/btrfs/dev-replace.c | |
parent | 5a16326173c935c28e20ede6fdfb6b0668d1c8bd (diff) |
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
[ Upstream commit 74e96bf44f430cf7a01de19ba6cf49b361cdfd6e ]
The global mce data buffer that used to copy rtas error log is of 2048
(RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read
extended_log_length from rtas error log header, then use max of
extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied.
Ideally the platform (phyp) will never send extended error log with
size > 2048. But if that happens, then we have a risk of buffer overrun
and corruption. Fix this by using min_t instead.
Fixes: d368514c3097 ("powerpc: Fix corruption when grabbing FWNMI data")
Reported-by: Michal Suchanek <msuchanek@suse.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions