mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
hsr: annotate data-race around hsr->sequence_nr
hsr->sequence_nr is incremented from the transmit paths under hsr->seqnr_lock, but hsr_fill_info() reads it without holding this lock. Use WRITE_ONCE() in the two writers, so that a matching READ_ONCE() can be used in hsr_fill_info(). Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260916132822.1791040-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
4090fcee93
commit
41c57cf050
|
|
@ -333,7 +333,7 @@ static void send_hsr_supervision_frame(struct hsr_port *port,
|
|||
hsr->sup_sequence_nr++;
|
||||
} else {
|
||||
hsr_stag->sequence_nr = htons(hsr->sequence_nr);
|
||||
hsr->sequence_nr++;
|
||||
WRITE_ONCE(hsr->sequence_nr, hsr->sequence_nr + 1);
|
||||
}
|
||||
|
||||
hsr_stag->tlv.HSR_TLV_type = type;
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ static void handle_std_frame(struct sk_buff *skb,
|
|||
/* Sequence nr for the master/interlink node */
|
||||
lockdep_assert_held(&hsr->seqnr_lock);
|
||||
frame->sequence_nr = hsr->sequence_nr;
|
||||
hsr->sequence_nr++;
|
||||
WRITE_ONCE(hsr->sequence_nr, hsr->sequence_nr + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user