Linux CAN drivers development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ziyang Xuan <william.xuanziyang@huawei.com>
Cc: socketcan@hartkopp.net, mkl@pengutronix.de, davem@davemloft.net,
	stable@vger.kernel.org, netdev@vger.kernel.org,
	linux-can@vger.kernel.org
Subject: Re: [PATCH 4.14] can: bcm: fix UAF of bcm op
Date: Sat, 22 Jan 2022 11:30:47 +0100	[thread overview]
Message-ID: <Yevc134xM9BDEyNd@kroah.com> (raw)
In-Reply-To: <20220122102506.2898032-1-william.xuanziyang@huawei.com>

On Sat, Jan 22, 2022 at 06:25:06PM +0800, Ziyang Xuan wrote:
> Stopping tasklet and hrtimer rely on the active state of tasklet and
> hrtimer sequentially in bcm_remove_op(), the op object will be freed
> if they are all unactive. Assume the hrtimer timeout is short, the
> hrtimer cb has been excuted after tasklet conditional judgment which
> must be false after last round tasklet_kill() and before condition
> hrtimer_active(), it is false when execute to hrtimer_active(). Bug
> is triggerd, because the stopping action is end and the op object
> will be freed, but the tasklet is scheduled. The resources of the op
> object will occur UAF bug.
> 
> Move hrtimer_cancel() behind tasklet_kill() and switch 'while () {...}'
> to 'do {...} while ()' to fix the op UAF problem.
> 
> Fixes: a06393ed0316 ("can: bcm: fix hrtimer/tasklet termination in bcm op removal")
> Reported-by: syzbot+5ca851459ed04c778d1d@syzkaller.appspotmail.com
> Cc: stable@vger.kernel.org
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> ---
>  net/can/bcm.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

What is the git commit id of this change in Linus's tree?

thanks,

greg k-h

  reply	other threads:[~2022-01-22 10:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22 10:25 [PATCH 4.14] can: bcm: fix UAF of bcm op Ziyang Xuan
2022-01-22 10:30 ` Greg KH [this message]
2022-01-23 14:10   ` Oliver Hartkopp
2022-01-27 14:49     ` Greg KH

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=Yevc134xM9BDEyNd@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=stable@vger.kernel.org \
    --cc=william.xuanziyang@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