Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	netdev@vger.kernel.org, stable@vger.kernel.org,
	linux-can@vger.kernel.org, kernel@pengutronix.de,
	Sili Luo <rootlab@huawei.com>,
	davem@davemloft.net
Subject: Re: [PATCH net 1/7] can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER)
Date: Fri, 6 Oct 2023 12:33:42 +0200	[thread overview]
Message-ID: <20231006103342.GA3112038@pengutronix.de> (raw)
In-Reply-To: <20231005094421.09a6a58f@kernel.org>

Hi Jakub,

On Thu, Oct 05, 2023 at 09:44:21AM -0700, Jakub Kicinski wrote:
> On Thu,  5 Oct 2023 11:46:33 +0200 Marc Kleine-Budde wrote:
> > Lock jsk->sk to prevent UAF when setsockopt(..., SO_J1939_FILTER, ...)
> > modifies jsk->filters while receiving packets.
> 
> Doesn't it potentially introduce sleep in atomic?
> 
> j1939_sk_recv_match()
>   spin_lock_bh(&priv->j1939_socks_lock);
>   j1939_sk_recv_match_one()
>     j1939_sk_match_filter()
>       lock_sock()
>         sleep

Good point! Thank you for the review.

@Sili Luo, can you please take a look at this?

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2023-10-06 10:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05  9:46 [PATCH net 0/7] pull-request: can 2023-10-05 Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 1/7] can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER) Marc Kleine-Budde
2023-10-05 16:44   ` Jakub Kicinski
2023-10-06 10:33     ` Oleksij Rempel [this message]
2023-10-05  9:46 ` [PATCH net 2/7] can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 3/7] can: sun4i_can: Only show Kconfig if ARCH_SUNXI is set Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 4/7] can: sja1000: Always restart the Tx queue after an overrun Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 5/7] can: tcan4x5x: Fix id2_register for tcan4553 Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 6/7] arm64: dts: imx93: add the Flex-CAN stop mode by GPR Marc Kleine-Budde
2023-10-05  9:46 ` [PATCH net 7/7] can: flexcan: remove the auto stop mode for IMX93 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=20231006103342.GA3112038@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=rootlab@huawei.com \
    --cc=stable@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).