Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 0/5] can: dev: fix can_restart() and replace BUG_ON() by error handling
Date: Wed, 04 Oct 2023 11:17:27 +0200	[thread overview]
Message-ID: <20231004-can-dev-fix-can-restart-v1-0-2e52899eaaf5@pengutronix.de> (raw)

There are 2 BUG_ON() in the CAN dev helpers. During the update/test of
the at91_can driver to rx-offload the one in can_restart() was
triggered, due to a race condition in can_restart() and a hardware
limitation of the at91_can IP core.

This series fixes the race condition, replaces BUG_ON() with an error
message, and does some cleanup. Finally, the BUG_ON() in
can_put_echo_skb() is also replaced with error handling.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Marc Kleine-Budde (5):
      can: dev: can_restart(): don't crash kernel if carrier is OK
      can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on()
      can: dev: can_restart(): reverse logic to remove need for goto
      can: dev: can_restart(): update debug and error messages
      can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds

 drivers/net/can/dev/dev.c | 25 ++++++++++++-------------
 drivers/net/can/dev/skb.c |  6 +++++-
 2 files changed, 17 insertions(+), 14 deletions(-)
---
base-commit: 473267a4911f2469722c74ca58087d951072f72a
change-id: 20231004-can-dev-fix-can-restart-eef8ba3e5e6e

Best regards,
-- 
Marc Kleine-Budde <mkl@pengutronix.de>



             reply	other threads:[~2023-10-04  9:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  9:17 Marc Kleine-Budde [this message]
2023-10-04  9:17 ` [PATCH 1/5] can: dev: can_restart(): don't crash kernel if carrier is OK Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 2/5] can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 3/5] can: dev: can_restart(): reverse logic to remove need for goto Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 4/5] can: dev: can_restart(): update debug and error messages Marc Kleine-Budde
2023-10-04 10:44   ` Vincent Mailhol
2023-10-04 11:33     ` Marc Kleine-Budde
2023-10-04 12:05       ` Marc Kleine-Budde
2023-10-04 13:03         ` Vincent Mailhol
2023-10-04 13:13           ` Marc Kleine-Budde
2023-10-04  9:17 ` [PATCH 5/5] can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds Marc Kleine-Budde

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=20231004-can-dev-fix-can-restart-v1-0-2e52899eaaf5@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@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 read-only IMAP folder(s) and NNTP newsgroup(s).