Skip to content

Commit daefdbb

Browse files
committed
Merge tag 'nf-24-12-25' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following batch contains one Netfilter fix for net: 1) Fix unaligned atomic read on struct nft_set_ext in nft_set_hash backend that causes an alignment failure splat on aarch64. This is related to a recent fix and it has been reported via the regressions mailing list. * tag 'nf-24-12-25' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_set_hash: unaligned atomic read on struct nft_set_ext ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 1fa9d91 + 542ed81 commit daefdbb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/net/netfilter/nf_tables.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,15 +733,18 @@ struct nft_set_ext_tmpl {
733733
/**
734734
* struct nft_set_ext - set extensions
735735
*
736-
* @genmask: generation mask
736+
* @genmask: generation mask, but also flags (see NFT_SET_ELEM_DEAD_BIT)
737737
* @offset: offsets of individual extension types
738738
* @data: beginning of extension data
739+
*
740+
* This structure must be aligned to word size, otherwise atomic bitops
741+
* on genmask field can cause alignment failure on some archs.
739742
*/
740743
struct nft_set_ext {
741744
u8 genmask;
742745
u8 offset[NFT_SET_EXT_NUM];
743746
char data[];
744-
};
747+
} __aligned(BITS_PER_LONG / 8);
745748

746749
static inline void nft_set_ext_prepare(struct nft_set_ext_tmpl *tmpl)
747750
{

0 commit comments

Comments
 (0)