mei: limit number of bytes in mei header.
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 11 Feb 2020 16:05:22 +0000 (18:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 22:03:19 +0000 (14:03 -0800)
commit3aef021b2df7d8440225a53460c0d34b140297d5
treecef331537a1db05d2ba8f39ac50db76efe06c26e
parent6736041f9606f195339cacb4bcce232f1a2a1ed3
mei: limit number of bytes in mei header.

The MEI message header provides only 9 bits for storing
the message size, limiting to 511.
In theory the host buffer (hbuf) can contain up to 1020 bytes
(limited by byte =  255 * 4)
With the current hardware and hbuf size 512, this is not a real issue,
but as hardening approach we enforce the limit.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20200211160522.7562-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c
drivers/misc/mei/hw.h