mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
Merge branch 'drop_monitor-take-care-of-32bit-kernels'
Eric Dumazet says: ==================== drop_monitor: take care of 32bit kernels This series fixes two drop_monitor issues on 32-bit architectures: - Patch 1 uses nla_total_size_64bit() for PC and TIMESTAMP attributes to account for alignment padding added by nla_put_u64_64bit(), avoiding potential skb_over_panic() crashes. - Patch 2 moves u64_stats updates before spin_unlock_irqrestore(), ensuring local interrupts are disabled to prevent seqcount corruption from nested interrupts in probe context. ==================== Link: https://patch.msgid.link/20260722141743.3266924-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
6a8da869fa
|
|
@ -530,10 +530,10 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,
|
|||
return;
|
||||
|
||||
unlock_free:
|
||||
spin_unlock_irqrestore(&data->drop_queue.lock, flags);
|
||||
u64_stats_update_begin(&data->stats.syncp);
|
||||
u64_stats_inc(&data->stats.dropped);
|
||||
u64_stats_update_end(&data->stats.syncp);
|
||||
spin_unlock_irqrestore(&data->drop_queue.lock, flags);
|
||||
consume_skb(nskb);
|
||||
}
|
||||
|
||||
|
|
@ -566,13 +566,13 @@ static size_t net_dm_packet_report_size(size_t payload_len)
|
|||
/* NET_DM_ATTR_ORIGIN */
|
||||
nla_total_size(sizeof(u16)) +
|
||||
/* NET_DM_ATTR_PC */
|
||||
nla_total_size(sizeof(u64)) +
|
||||
nla_total_size_64bit(sizeof(u64)) +
|
||||
/* NET_DM_ATTR_SYMBOL */
|
||||
nla_total_size(NET_DM_MAX_SYMBOL_LEN + 1) +
|
||||
/* NET_DM_ATTR_IN_PORT */
|
||||
net_dm_in_port_size() +
|
||||
/* NET_DM_ATTR_TIMESTAMP */
|
||||
nla_total_size(sizeof(u64)) +
|
||||
nla_total_size_64bit(sizeof(u64)) +
|
||||
/* NET_DM_ATTR_ORIG_LEN */
|
||||
nla_total_size(sizeof(u32)) +
|
||||
/* NET_DM_ATTR_PROTO */
|
||||
|
|
@ -766,7 +766,7 @@ net_dm_hw_packet_report_size(size_t payload_len,
|
|||
/* NET_DM_ATTR_FLOW_ACTION_COOKIE */
|
||||
net_dm_flow_action_cookie_size(hw_metadata) +
|
||||
/* NET_DM_ATTR_TIMESTAMP */
|
||||
nla_total_size(sizeof(u64)) +
|
||||
nla_total_size_64bit(sizeof(u64)) +
|
||||
/* NET_DM_ATTR_ORIG_LEN */
|
||||
nla_total_size(sizeof(u32)) +
|
||||
/* NET_DM_ATTR_PROTO */
|
||||
|
|
@ -997,10 +997,10 @@ net_dm_hw_trap_packet_probe(void *ignore, const struct devlink *devlink,
|
|||
return;
|
||||
|
||||
unlock_free:
|
||||
spin_unlock_irqrestore(&hw_data->drop_queue.lock, flags);
|
||||
u64_stats_update_begin(&hw_data->stats.syncp);
|
||||
u64_stats_inc(&hw_data->stats.dropped);
|
||||
u64_stats_update_end(&hw_data->stats.syncp);
|
||||
spin_unlock_irqrestore(&hw_data->drop_queue.lock, flags);
|
||||
net_dm_hw_metadata_free(n_hw_metadata);
|
||||
free:
|
||||
consume_skb(nskb);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user