]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: rfkill: prevent unlimited numbers of rfkill events from being created
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Apr 2026 16:57:46 +0000 (12:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2026 08:33:38 +0000 (10:33 +0200)
commitb1e0c8d3ab58a0161db487bf5fc47adfcaf5d5ca
treea2706507e0301f06c3cef22981d164ce2c7ca54d
parent750569d6987a0ff46317a4b86eb3907e296287bf
net: rfkill: prevent unlimited numbers of rfkill events from being created

[ Upstream commit ea245d78dec594372e27d8c79616baf49e98a4a1 ]

Userspace can create an unlimited number of rfkill events if the system
is so configured, while not consuming them from the rfkill file
descriptor, causing a potential out of memory situation.  Prevent this
from bounding the number of pending rfkill events at a "large" number
(i.e. 1000) to prevent abuses like this.

Cc: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026033013-disfigure-scroll-e25e@gregkh
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ replaced `scoped_guard()` with explicit `mutex_lock()`/`mutex_unlock()` calls ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rfkill/core.c