public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: linux-xtensa@linux-xtensa.org
Cc: Chris Zankel <chris@zankel.net>,
	linux-kernel@vger.kernel.org,
	Yang Yingliang <yangyingliang@huawei.com>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH 0/3] xtensa: iss/network initialization error path fixes
Date: Thu,  7 Jul 2022 01:07:58 -0700	[thread overview]
Message-ID: <20220707080801.3496148-1-jcmvbkbc@gmail.com> (raw)

Hello,

this series cleans up xtensa ISS network driver and fixes memory leaks
in initialization error paths.
The series was prompted by the patch [1] from Yang Yingliang, but that
patch alone has issues:
- a newly created net_device was added to a list of devices and not
  removed from it in case of error leading to UAF. The way the device
  list was used in the driver doesn't make much sense, so patch 1
  removes it altogether.
- a call to platform_device_unregister would complain that iss-netdev
  does not have a release() function and must be fixed. Patch 2 adds the
  release function for the iss-netdev platform device.
- a proper release() function for the platform device must free the
  net_device object, so the error path that calls
  platform_device_unregister must not call free_netdev afterwards to
  avoid double free. I've modified the patch 3 so that it does that and
  updated the description.

[1] https://lore.kernel.org/lkml/20220707023229.2580893-1-yangyingliang@huawei.com/

Max Filippov (2):
  xtensa: iss/network: drop 'devices' list
  xtensa: iss/network: provide release() callback

Yang Yingliang (1):
  xtensa: iss: fix handling error cases in iss_net_configure()

 arch/xtensa/platforms/iss/network.c | 63 +++++++++++++----------------
 1 file changed, 28 insertions(+), 35 deletions(-)

-- 
2.30.2


             reply	other threads:[~2022-07-07  8:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  8:07 Max Filippov [this message]
2022-07-07  8:07 ` [PATCH 1/3] xtensa: iss/network: drop 'devices' list Max Filippov
2022-07-07  8:08 ` [PATCH 2/3] xtensa: iss/network: provide release() callback Max Filippov
2022-07-07  8:08 ` [PATCH v3 3/3] xtensa: iss: fix handling error cases in iss_net_configure() Max Filippov

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=20220707080801.3496148-1-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=chris@zankel.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=yangyingliang@huawei.com \
    /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