Skip to content

raw/ping: Fix locking in /proc/net/{raw,icmp}.

Kuniyuki Iwashima netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2raw: Fix NULL deref in raw_get_next().include/net/raw.h net/ipv4/raw.c net/ipv4/raw_diag.c +1 more+29 -316 repliesApplied
2/2ping: Fix potentail NULL deref for /proc/net/icmp.net/ipv4/ping.c+4 -41 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchEric Dumazet
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 net 0/2] raw/ping: Fix locking in /proc/net/{raw,icmp}.

The first patch fixes a NULL deref for /proc/net/raw and second one fixes the same issue for ping sockets.

The first patch also converts hlist_nulls to hlist, but this is because the current code uses sk_nulls_for_each() for lockless readers, instead of sk_nulls_for_each_rcu() which adds memory barrier, but raw sockets does not use the nulls marker nor SLAB_TYPESAFE_BY_RCU in the first place.

OTOH, the ping sockets already uses sk_nulls_for_each_rcu(), and such conversion can be posted later for net-next.

Kuniyuki Iwashima (2):

  raw: Fix NULL deref in raw_get_next().
  ping: Fix potentail NULL deref for /proc/net/icmp.
 include/net/raw.h   |  4 ++--
 net/ipv4/ping.c     |  8 ++++----
 net/ipv4/raw.c      | 36 +++++++++++++++++++-----------------
 net/ipv4/raw_diag.c | 10 ++++------
 net/ipv6/raw.c      | 10 ++++------
 5 files changed, 33 insertions(+), 35 deletions(-)
Signature · 1 line
2.30.2