]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rfkill: make new event layout opt-in
authorJohannes Berg <johannes.berg@intel.com>
Wed, 16 Mar 2022 20:27:51 +0000 (21:27 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:56:44 +0000 (11:56 +0200)
commitac64634a166a658b21428d1d0be0b454b6b0a0c1
tree7ace1cb60a875ccc6e0f5609e1003202c7a53f13
parentedd9d44c1fc995be23c3c1c2de3e6cd04b35e7ab
rfkill: make new event layout opt-in

BugLink: https://bugs.launchpad.net/bugs/1969110
commit 54f586a9153201c6cff55e1f561990c78bd99aa7 upstream.

Again new complaints surfaced that we had broken the ABI here,
although previously all the userspace tools had agreed that it
was their mistake and fixed it. Yet now there are cases (e.g.
RHEL) that want to run old userspace with newer kernels, and
thus are broken.

Since this is a bit of a whack-a-mole thing, change the whole
extensibility scheme of rfkill to no longer just rely on the
message lengths, but instead require userspace to opt in via a
new ioctl to a given maximum event size that it is willing to
understand.

By default, set that to RFKILL_EVENT_SIZE_V1 (8), so that the
behaviour for userspace not calling the ioctl will look as if
it's just running on an older kernel.

Fixes: 14486c82612a ("rfkill: add a reason to the HW rfkill state")
Cc: stable@vger.kernel.org # 5.11+
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220316212749.16491491b270.Ifcb1950998330a596f29a2a162e00b7546a1d6d0@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit cdcaec46a6b22a7c2a44366115d424b38a5cee55)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
include/uapi/linux/rfkill.h
net/rfkill/core.c