mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Evgeny Novikov <novikov@ispras.ru>, Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: hwmon: (sis5595) potential null pointer dereference in probe
Date: Tue, 4 Aug 2020 07:33:15 -0700	[thread overview]
Message-ID: <23dceaac-526d-4ee3-40de-cf354b0aeabd@roeck-us.net> (raw)
In-Reply-To: <856951596540762@mail.yandex.ru>

On 8/4/20 4:50 AM, Evgeny Novikov wrote:
> sis5595_pci_probe() registers platform driver callbacks and just then
> initializes global pointer variable s_bridge. sis5595_probe() may
> dereference it before this happens that can result in null pointer
> dereference.
> 
sis5595_probe() is only called after the device is registered,
which happens in sis5595_device_add() after s_bridge is set. This is
a southbridge, so there won't be any hot insertion/removal events.

> We can not swap registration of platform driver callbacks with
> initialization of s_bridge since sm_sis5595_exit() assumes the
> current order. Perhaps it has sense to implement a pci_driver.remove
> callback that will take care about deregistration of platform driver
> callbacks.
>

Agreed regarding the remove function. However, given the age of the chip,
I'd rather remove the driver than spending time on cleanup efforts.
This looks like a perfect candidate for depreciation.

Guenter

  reply	other threads:[~2020-08-04 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 11:50 Evgeny Novikov
2020-08-04 14:33 ` Guenter Roeck [this message]
2020-08-04 14:48   ` Evgeny Novikov

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=23dceaac-526d-4ee3-40de-cf354b0aeabd@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=novikov@ispras.ru \
    /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

all inboxes | Powered by JetHome®