All of lore.kernel.org
 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: Andrzej Hajda <andrzej.hajda@intel.com>,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Subject: Re: [PATCH v2] debugobjects: stop accessing objects after releasing spinlock
Date: Fri, 13 Oct 2023 15:15:33 +0200	[thread overview]
Message-ID: <87v8bak6iy.ffs@tglx> (raw)
In-Reply-To: <20230925131359.2948827-1-andrzej.hajda@intel.com>

On Mon, Sep 25 2023 at 15:13, Andrzej Hajda wrote:
> After spinlock release object can be modified/freed by concurrent thread.
> Using it in such case is error prone, even for printing object state.

It cannot be freed. If that happens then the calling code will have an
UAF problem on the tracked item too.

If there is a concurrent modification then again, the calling code is
lacking serialization on the tracked object.

debugobject fundamentally relies on the call site being consistent
simply because it _cannot_ invoke the fixup callbacks with the hash
bucket lock held.

What's the actualy problem you are trying to solve here. The changelog
does not explain anything except of handwaving about modified/freed.

Thanks,

        tglx

WARNING: multiple messages have this Message-ID (diff)
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: Andrzej Hajda <andrzej.hajda@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2] debugobjects: stop accessing objects after releasing spinlock
Date: Fri, 13 Oct 2023 15:15:33 +0200	[thread overview]
Message-ID: <87v8bak6iy.ffs@tglx> (raw)
In-Reply-To: <20230925131359.2948827-1-andrzej.hajda@intel.com>

On Mon, Sep 25 2023 at 15:13, Andrzej Hajda wrote:
> After spinlock release object can be modified/freed by concurrent thread.
> Using it in such case is error prone, even for printing object state.

It cannot be freed. If that happens then the calling code will have an
UAF problem on the tracked item too.

If there is a concurrent modification then again, the calling code is
lacking serialization on the tracked object.

debugobject fundamentally relies on the call site being consistent
simply because it _cannot_ invoke the fixup callbacks with the hash
bucket lock held.

What's the actualy problem you are trying to solve here. The changelog
does not explain anything except of handwaving about modified/freed.

Thanks,

        tglx

  parent reply	other threads:[~2023-10-13 13:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 13:13 [PATCH v2] debugobjects: stop accessing objects after releasing spinlock Andrzej Hajda
2023-09-25 13:13 ` [Intel-gfx] " Andrzej Hajda
2023-09-26  2:03 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for debugobjects: stop accessing objects after releasing spinlock (rev2) Patchwork
2023-09-26  2:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-26  9:50 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-10-10 12:02 ` [PATCH v2] debugobjects: stop accessing objects after releasing spinlock Andrzej Hajda
2023-10-10 12:02   ` [Intel-gfx] " Andrzej Hajda
2023-10-10 12:10   ` Andi Shyti
2023-10-10 12:10     ` [Intel-gfx] " Andi Shyti
2023-10-13 13:15 ` Thomas Gleixner [this message]
2023-10-13 13:15   ` Thomas Gleixner
2023-10-19 10:31   ` Andrzej Hajda
2023-10-23 16:11     ` Thomas Gleixner
2023-10-24 12:56 ` Thomas Gleixner
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=87v8bak6iy.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=andi.shyti@linux.intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.