Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp58134pxj; Wed, 23 Jun 2021 15:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFFPuxTQXysTdXYZMihraXTadZ4Gfi4xwSvNGWsmeYRsdBh7+sJemJbixD5WP5M1OO3fdE X-Received: by 2002:a17:907:9ed:: with SMTP id ce13mr2166958ejc.238.1624487826966; Wed, 23 Jun 2021 15:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624487826; cv=none; d=google.com; s=arc-20160816; b=aiwZuqkOVAwjQrDRAj33lwVkHCNp0q6hgxGE9PQLqC/PYL1xpKc9z+wwMUiDJ2/T49 sGxo+7Nn0xFZsZu3b3U8PEIf5IaGDPX3xM55AdgI6Ea+plciRpBKDjUmrIoI8crMxUii +ynBJKib1tgwcRfzY13cvd7sttwZBxW8MrClsJeEQqTrktODCaPr20/Mv0AizP75jx5q wYanOv7qEdBhTWVngQKFHw6bIkiOJvfpydZe/N2qHwJ5DoaTZWZqvTtKABC7WsdIKSQF gJat7Dy7tGJt4XWqd5kaWo3xlUDEEuVNB7cZdVkG8y9cduYUHgrG0+tSKTlEBjNEDWC9 pIkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yAYl+/1usO+36xFxopY4DIvTrqgPU1U0/I4g5j0JsS4=; b=vO/Z0qdfWj8pk6uhXRdK8ngRsKhl8VEEl8gXhKZMQL7DKpoirEAZ1XDUKaXRVCWNFI kUswmkIFEnV63zAGoeDRNUBk+eDVyy26GDXKUq4N7pQSwFp/RpE917KSHoGxFyFh8P4I l1jlatLBW4EeBguPgX/9rdy0w0RT4/CGI+7Iu77o+jECzOlBv8JCJu2rjdcCEszHMKAE uQh9n2alCbLYU95rfdC/qx/pNpRW0E0mTevB5vnmfMzbVk2W2xZCIiWX2BDHLC3tmqUo UgpcOUQHdN4bxafTHdAl/Dhukyvyx5NOHHzvN5jIa8FmipAcssFq45of9B3R2IjBk08d 89fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CCqIwiMs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yc7si850078ejb.576.2021.06.23.15.36.41; Wed, 23 Jun 2021 15:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CCqIwiMs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbhFWWiD (ORCPT + 99 others); Wed, 23 Jun 2021 18:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhFWWiD (ORCPT ); Wed, 23 Jun 2021 18:38:03 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF81C061574 for ; Wed, 23 Jun 2021 15:35:45 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id bm25so9576853qkb.0 for ; Wed, 23 Jun 2021 15:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yAYl+/1usO+36xFxopY4DIvTrqgPU1U0/I4g5j0JsS4=; b=CCqIwiMsZswlTCyGNagFpf57FAvrW7Kv5j4CuxKggBXSg717sCmZ8DMThVbINzUhgh ouTSwDWUXWtaLmoAzTL8mDpLGfGXv+QAyaU6SOjhx4zzRUnNClB8tscpa/NrTd0+gebr nRvevO9bbkaa2f0vjyk6+AIv6ZJBU1ilJPo6Uc6ytUD+FlLVNBNNiEAFZJOg03R34Nzi CtR7R0kGLfRquHzwY11+MkqRYRYbOa6IVENJAlhRTTZGxEzUGO5Iz2GmSevqoJfculFi N4ACIJR6BgGystYJmOCVhmbbKrezS4EsBUFmyPk174gmadcp47083Q5mdZF7qAzjm6Kx Wq0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yAYl+/1usO+36xFxopY4DIvTrqgPU1U0/I4g5j0JsS4=; b=gVb46uk9osve1xNr49eWQnD3QcxT/Ia2uQG+v8rkuB0HeE1xSzcSmPvkqyp4YkeXIv 2GCOR8Pm1HkW7Kgx8wWXx+UEuY2PMmBfaBo1T8FvN+gWXz/YnnoeCq9O5F6iiOF7PMiV B6mdO/jfvSDj/0cmci/Byfxv0ged8e+64jUBbanRuo3JppHUdVGVJ2wgQ+ffvaYowu2L gN30JJFXTUOGL24IAiQMK4Zwudxz7h9+nYVnePmQINKu5DlluFJvqCVdIYNoAL2Jusvy 1D2tS6tKBmnyEI8ghVRCmxWebngKFk7CG82oNuKBto3CNDfTmdCkJ1KryLAz6xYIdHDp 7KJg== X-Gm-Message-State: AOAM530uoP00L/FGPTMJ2mqSXzCfg6xoKGPRdB2GaU+P/JhoqCC2+HyT W6evXmx/c4UjqXk6rUxcJdle9IU+wS7hKBObzrk= X-Received: by 2002:a25:acdf:: with SMTP id x31mr539339ybd.222.1624487744301; Wed, 23 Jun 2021 15:35:44 -0700 (PDT) MIME-Version: 1.0 References: <20210503131210.90066-1-benjamin@sipsolutions.net> In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 23 Jun 2021 15:35:33 -0700 Message-ID: Subject: Re: [PATCH] rfkill: Fix reading from rfkill socket To: Bastien Nocera Cc: Benjamin Berg , "linux-bluetooth@vger.kernel.org" , Benjamin Berg Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Thu, Jun 10, 2021 at 5:53 AM Bastien Nocera wrote: > > 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 > > > > > > 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 I missed this one for some reason, it has been applied now. -- Luiz Augusto von Dentz