From: Johannes Berg <johannes@sipsolutions.net>
To: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>,
Hans de Goede <hdegoede@redhat.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: "rfkill: add a reason to the HW rfkill state" breaks userspace
Date: Wed, 14 Apr 2021 09:07:48 +0200 [thread overview]
Message-ID: <2db76f5161be090f9fec2bc4fcb8973533e32564.camel@sipsolutions.net> (raw)
In-Reply-To: <SA0PR11MB4752FEE472EC18B6A4F376FAF24E9@SA0PR11MB4752.namprd11.prod.outlook.com> (sfid-20210414_071301_651335_B1FA5905)
On Wed, 2021-04-14 at 05:12 +0000, Grumbach, Emmanuel wrote:
> >
> > Hi,
> >
> > I've been debugging a userspace rfkill issue today which boils down
> > to the
> > "rfkill: add a reason to the HW rfkill state" patch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i
> > d=14486c82612a177cb910980c70ba900827ca0894
> > breaking userspace.
>
> This has been rolled back by:
> https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git/commit/?id=71826654ce40112f0651b6f4e94c422354f4adb6
> Other userspace broke (systemd) so Johannes rolled this back by
> default.
> Userspace that is interested in the new byte will read 9 bytes.
Which, unfortunately, doesn't address *this* particular case, because it
uses gio and that will fill the buffer with arbitrary size?
When you (Hans) say you saw in strace a read of size 8, did you mean the
size passed to it, or the return size? I guess it must be the return
size, and the size passed to it was way larger.
The commit Emmanuel linked to fixes cases such as systemd that were just
completely garbage (reading with one size, and then checking they got
another), but it wouldn't fix this case.
Unfortunately, as you also said, it does seem a bit late now - it's been
released in various kernels since 5.10, and while the default rollback
will improve the situation somewhat, read(..., size>8) will still return
9 bytes rather than 8 as it used to. Switching that *also* back *should*
be safe, but who knows what other bugs were introduced in the meantime?
I certainly don't really have a major objection to rolling that also
back, but would it really help that much at this point? I guess it could
be going into 5.10/5.11 stable kernels though.
johannes
next prev parent reply other threads:[~2021-04-14 7:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 20:31 "rfkill: add a reason to the HW rfkill state" breaks userspace Hans de Goede
2021-04-14 5:12 ` Grumbach, Emmanuel
2021-04-14 7:07 ` Johannes Berg [this message]
2021-04-14 8:17 ` Hans de Goede
2021-04-14 9:47 ` Johannes Berg
2021-04-14 10:22 ` Hans de Goede
2021-04-14 9:52 ` Benjamin Berg
2021-04-14 10:29 ` Hans de Goede
2021-04-14 10:46 ` Benjamin Berg
2021-04-14 11:17 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2db76f5161be090f9fec2bc4fcb8973533e32564.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=emmanuel.grumbach@intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox