s390/pci: query fmb length
Query the length of the fmb and abort fmb registration if the size of the associated measurement block is too small. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:

committed by
Martin Schwidefsky

parent
d03502684b
commit
0b7589ecca
@@ -180,7 +180,7 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)
|
||||
{
|
||||
struct mod_pci_args args = { 0, 0, 0, 0 };
|
||||
|
||||
if (zdev->fmb)
|
||||
if (zdev->fmb || sizeof(*zdev->fmb) < zdev->fmb_length)
|
||||
return -EINVAL;
|
||||
|
||||
zdev->fmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);
|
||||
|
Reference in New Issue
Block a user