Re: [PATCH] rfkill: Fix reading from rfkill socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2021-06-10 at 14:45 +0200, Bastien Nocera wrote:
> On Mon, 2021-05-03 at 15:12 +0200, Benjamin Berg wrote:
> > From: Benjamin Berg <bberg@xxxxxxxxxx>
> > 
> > The kernel will always send exactly one event, but the size of the
> > passed struct will depend on the length of the submitted read() and
> > the
> > kernel version. i.e. the interface can be extended and we need to
> > expect
> > for a read to be longer than expected if we ask for it.
> > 
> > Fix this by only requesting the needed length and explicitly check
> > the
> > length against the V1 version of the structure to make the code a bit
> > more future proof in case the internal copy of the struct is updated
> > to
> > contain new fields.
> 
> This fixes a bug in GNOME where to enable Bluetooth, we removed a soft
> rfkill block on the Bluetooth interface.
> 
> Without this, the bluetooth rfkill gets unblocked, but bluetoothd
> doesn't see it as unblocked so never powers it on, causing the UI to
> appear broken, as we expect Bluetooth devices to be either blocked
> through rfkill, or powered on.
> 
> The equivalent gnome-settings-daemon fix (which deals with rfkill) was
> reviewed by Hans de Goede:
> https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/234
> 
> Benjamin, it might be worth resending this with a better commit message
> explaining exactly what it fixes and referencing the gnome-bluetooth
> bug:
> https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/38

> 
It's also been pushed to Fedora rawhide and Fedora 34:
https://bodhi.fedoraproject.org/updates/FEDORA-2021-2cd83da751




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux