linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-mm@kvack.org
Cc: Nirmoy Das <nirmoy.das@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2] debugobjects: stop accessing objects after releasing spinlock
Date: Mon, 23 Oct 2023 18:11:35 +0200	[thread overview]
Message-ID: <87r0llco94.ffs@tglx> (raw)
In-Reply-To: <62e16250-63f4-4fbb-b00e-db808b600664@intel.com>

On Thu, Oct 19 2023 at 12:31, Andrzej Hajda wrote:
> On 13.10.2023 15:15, Thomas Gleixner wrote:
>> It cannot be freed. If that happens then the calling code will have an
>> UAF problem on the tracked item too.
>
> Yes, and I have assumed that debugobjects are created also for detecting 
> UAFs.

Kinda.

> They should be able to handle/detect 'issues due to incorrectly 
> serialized concurrent accesses' scenarios as well, at least some of 
> them. And even if it cannot recover it should at least provide reliable 
> reporting.

Fair enough.

> Now we can have scenario:
> 1. Thread tries to deactivate destroyed object, debugobjects detects it, 
> spin lock is released, thread is preempted.
> 2. Other thread frees debugobject, then allocates new one on the same 
> memory location, ie 'obj' variable from 1st thread point to it - it is 
> possible because there is no locking.
> 3. Then preemption occurs, and 1st thread reports error for wrong object.
>
> This seems the most drastic for me, but also with lowest chances to 
> happen due to delayed freeing, but there are also other more probable 
> scenarios when we print the same object but in state different from the 
> one when debugobject detected issue, due to modification by concurrent 
> thread.

Now I understand what you mean. This information should be in the
changelog, no?

Let me stare at the patch once more.


  reply	other threads:[~2023-10-23 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 13:13 Andrzej Hajda
2023-10-10 12:02 ` Andrzej Hajda
2023-10-10 12:10   ` Andi Shyti
2023-10-13 13:15 ` Thomas Gleixner
2023-10-19 10:31   ` [Intel-gfx] " Andrzej Hajda
2023-10-23 16:11     ` Thomas Gleixner [this message]
2023-10-24 12:56 ` Thomas Gleixner

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=87r0llco94.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=andrzej.hajda@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nirmoy.das@intel.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