]> git.ipfire.org Git - thirdparty/qemu.git/commit
Avoid unaligned fetch in ladr_match()
authorNick Briggs <nicholas.h.briggs@gmail.com>
Thu, 1 Feb 2024 18:11:17 +0000 (10:11 -0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 13 Mar 2024 20:09:00 +0000 (23:09 +0300)
commitedb47553b06db9cfe7501bcdcb28e6235ff71b20
treee816e25b2eef430c9ab8df50d51a6efc701021c8
parentdf052d6c1c13247de89b14d7e5193966afbd414e
Avoid unaligned fetch in ladr_match()

There is no guarantee that the PCNetState is allocated such that
csr[8] is allocated on an 8-byte boundary.  Since not all hosts are
capable of unaligned fetches the 16-bit elements need to be fetched
individually to avoid a potential fault.  Closes issue #2143

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2143
Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 6a5287ce80470bb8df95901d73ee779a64e70c3a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/pcnet.c