Thread (6 messages) 6 messages, 2 authors, 2025-08-21
STALE324d

[PATCH v1 net 0/3] net: rose: introduce refcount_t for reference counting of rose_neigh

From: Takamitsu Iwai <hidden>
Date: 2025-08-20 17:48:53
Also in: linux-hams

The current implementation of rose_neigh uses 'use' and 'count' field of
type unsigned short as a reference count. This approach lacks atomicity,
leading to potential race conditions. As a result, syzbot has reported
slab-use-after-free errors due to unintended removals.

This series introduces refcount_t for reference counting to ensure
atomicity and prevent race conditions. The patches are structured as
follows:

1. Refactor rose_remove_neigh() to separate removal and freeing operations
2. Convert 'use' field to refcount_t for appropriate reference counting
3. Include references from rose_node to 'use' field

These changes should resolve the reported slab-use-after-free issues and
improve the overall stability of the ROSE network layer.

Takamitsu Iwai (3):
  net: rose: split remove and free operations in rose_remove_neigh()
  net: rose: convert 'use' field to refcount_t
  net: rose: include node references in rose_neigh refcount

 include/net/rose.h    | 18 +++++++++++++-
 net/rose/af_rose.c    | 10 ++++----
 net/rose/rose_in.c    | 12 +++++-----
 net/rose/rose_route.c | 55 ++++++++++++++++++++++++++-----------------
 net/rose/rose_timer.c |  2 +-
 5 files changed, 61 insertions(+), 36 deletions(-)

-- 
2.39.5 (Apple Git-154)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help