linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Duggan <aduggan@synaptics.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Federico Cerutti <federico@ceres-c.it>,
	Christopher Heiny <Cheiny@synaptics.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH] HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device
Date: Fri, 15 Nov 2019 18:18:05 +0000	[thread overview]
Message-ID: <6931c116-78fb-9ad9-aab1-f15799118c82@synaptics.com> (raw)
In-Reply-To: <nycvar.YFH.7.76.1911151626120.1799@cbobk.fhfr.pm>

Hi Jiri,

On 11/15/19 7:26 AM, Jiri Kosina wrote:
> On Wed, 23 Oct 2019, Andrew Duggan wrote:
>
>> In the event that the RMI device is unreachable, the calls to
>> rmi_set_mode() or rmi_set_page() will fail before registering the RMI
>> transport device. When the device is removed, rmi_remove() will call
>> rmi_unregister_transport_device() which will attempt to access the
>> rmi_dev pointer which was not set. This patch adds a check of the
>> RMI_STARTED bit before calling rmi_unregister_transport_device().
>> The RMI_STARTED bit is only set after rmi_register_transport_device()
>> completes successfully. A subsequent patch in the RMI core will add
>> checks to validate the pointers before accessing them.
> Andrew,
>
> my mailbox doesn't seem to have that 'subsequent patch' ... was it ever
> sent and I missed it? If so, could you please resend it?

The subsequent patch which I was referring to is:

https://lore.kernel.org/linux-input/20191023012344.20998-2-aduggan@synaptics.com/

Since this second patch was for the input subsystem I decided to just 
make them separate patches instead of creating a series. However, based 
on Dmitry's feedback it was determined that the second patch wasn't a 
good idea and it won't be applied. This first patch is enough to fix the 
issue by preventing the call to rmi_unregister_transport_device() if the 
subsequent call to register failed. The only change I would make to this 
patch would be to remove the last sentence of the comment. If you choose 
to apply that patch then would this be a change you would make? Or would 
you prefer I submit a v2 with this update?

Thanks,

Andrew


> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>

  reply	other threads:[~2019-11-15 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  1:24 [PATCH] HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device Andrew Duggan
2019-10-23  1:24 ` [PATCH] Input: synaptics-rmi4 - validate that the rmi_dev pointer is set before dereferencing it Andrew Duggan
2019-10-29  4:19   ` Dmitry Torokhov
2019-10-29 18:40     ` Andrew Duggan
2019-11-15 15:26 ` [PATCH] HID: rmi: Check that the RMI_STARTED bit is set before unregistering the RMI transport device Jiri Kosina
2019-11-15 18:18   ` Andrew Duggan [this message]
2019-11-18  9:24     ` Jiri Kosina

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=6931c116-78fb-9ad9-aab1-f15799118c82@synaptics.com \
    --to=aduggan@synaptics.com \
    --cc=Cheiny@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=federico@ceres-c.it \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).