linux-5.15: mmbi: validate buffer offsets

Validate host read-only (hrop) and host read-write (hrwp) pointer
offsets against circular buffer boundaries (b2h_cb_size and
h2b_cb_size) in npcm-espi-mmbi to prevent stack buffer overflow
and out-of-bounds writes from untrusted host inputs.

Tested:
Built obmc-phosphor-image, signed, flashed, rebooted on a real machine from DevRez.

Google-Bug-Id: 540017042
Change-Id: Id079d2eb64ebde58267ccf090d91d91970846df7
Signed-off-by: Joseph CT Chan <josephctchan@google.com>
1 file changed