linux/net
Matthew Wilcox (Oracle) 9ddb3c14af mm: fix struct page layout on 32-bit systems
32-bit architectures which expect 8-byte alignment for 8-byte integers and
need 64-bit DMA addresses (arm, mips, ppc) had their struct page
inadvertently expanded in 2019.  When the dma_addr_t was added, it forced
the alignment of the union to 8 bytes, which inserted a 4 byte gap between
'flags' and the union.

Fix this by storing the dma_addr_t in one or two adjacent unsigned longs.
This restores the alignment to that of an unsigned long.  We always
store the low bits in the first word to prevent the PageTail bit from
being inadvertently set on a big endian platform.  If that happened,
get_user_pages_fast() racing against a page which was freed and
reallocated to the page_pool could dereference a bogus compound_head(),
which would be hard to trace back to this cause.

Link: https://lkml.kernel.org/r/20210510153211.1504886-1-willy@infradead.org
Fixes: c25fff7171 ("mm: add dma_addr_t to struct page")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Matteo Croce <mcroce@linux.microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth
bpf
bpfilter
bridge
caif
can
ceph Notable items here are a series to take advantage of David Howells' 2021-05-06 10:27:02 -07:00
core mm: fix struct page layout on 32-bit systems 2021-05-14 19:41:32 -07:00
dcb
dccp
decnet
dns_resolver
dsa
ethernet
ethtool ethtool: fix missing NLM_F_MULTI flag when dumping 2021-05-05 12:41:10 -07:00
hsr
ieee802154
ife
ipv4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2021-05-07 16:10:12 -07:00
ipv6
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211
mac802154
mpls
mptcp mptcp: fix splat when closing unaccepted socket 2021-05-07 15:53:40 -07:00
ncsi
netfilter netfilter: nftables: avoid potential overflows on 32bit arches 2021-05-07 10:01:39 +02:00
netlabel
netlink
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched
sctp
smc smc: disallow TCP_ULP in smc_setsockopt() 2021-05-05 12:52:45 -07:00
strparser
sunrpc NFS client updates for Linux 5.13 2021-05-07 11:23:41 -07:00
switchdev
tipc
tls
unix
vmw_vsock
wireless
x25
xdp
xfrm
compat.c
devres.c
Kconfig
Makefile
socket.c
sysctl_net.c