public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	 Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	 Darren Hart <dvhart@infradead.org>,
	 Davidlohr Bueso <dave@stgolabs.net>,
	 Arnd Bergmann <arnd@arndb.de>,
	 linux-kernel@vger.kernel.org, kernel-dev@igalia.com,
	 Vinicius Peixoto <vpeixoto@lkcamp.dev>
Subject: Re: [PATCH v2 0/4] futex: Drop ROBUST_LIST_LIMIT
Date: Tue, 28 Jan 2025 21:35:26 +0100	[thread overview]
Message-ID: <874j1iismp.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <df74a144-c925-410b-804c-c223793d08cf@igalia.com> ("André Almeida"'s message of "Tue, 28 Jan 2025 11:28:10 -0300")

* André Almeida:

> Hi Florian,
>
> Em 28/01/2025 04:50, Florian Weimer escreveu:
>> * André Almeida:
>> 
>>> As requested by Peter at [1], this patchset drops the
>>> ROBUST_LIST_LIMIT. This is achieve by simply rewriting the processed
>>> list element ->next to point to the head->list address, destroying the
>>> linked list to avoid any circular list.
>> Doesn't this turn a robust mutex overwrite or a TCB overwrite into a
>> write-anything-anywhere primitive?  Furthermore, I'm not entirely sure
>> if this is entirely backwards-compatible.
>> 
>
> The robust list is meant to be a private resource, per-process, and
> this patch only rewrites it after the process exits, so I believe that
> any changes done in this memory should be safe given that the process
> will soon disappear anyway, right?

At least in the glibc implementation, we let the kernel handle robust
mutex notification on thread exit, and that's observable.

Beyond that, process-shared robust mutexes exist, too, and those updates
will be observable, too.

> Do you think you can point out a scenario that wouldn't be
> backwards-compatible? I would like to try to test it.

I think it should be okay for the glibc implementation.  The robust list
is libc-owned (at least in glibc implementation), so it should not
matter, but the are other libs out there.

>> Could you use the tortoise/hare approach instead?

> I believe that you want the approach to be "slow and steady" but I'm
> not sure what you have in mind, if you could you please elaborate :)

I meant cycle detection using Floyd's algorithm.

Thanks,
Florian


  reply	other threads:[~2025-01-28 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-27 20:26 [PATCH v2 0/4] futex: Drop ROBUST_LIST_LIMIT André Almeida
2025-01-27 20:26 ` [PATCH v2 1/4] " André Almeida
2025-01-27 20:26 ` [PATCH v2 2/4] selftests/futex: Add ASSERT_ macros André Almeida
2025-01-27 20:26 ` [PATCH v2 3/4] selftests/futex: Create test for robust list André Almeida
2025-01-27 20:26 ` [PATCH v2 4/4] selftests/futex: Create tests for long and circular robust lists André Almeida
2025-01-28  7:50 ` [PATCH v2 0/4] futex: Drop ROBUST_LIST_LIMIT Florian Weimer
2025-01-28 14:28   ` André Almeida
2025-01-28 20:35     ` Florian Weimer [this message]
2025-02-03 13:34       ` Peter Zijlstra
2025-02-03 13:29   ` Peter Zijlstra
2025-02-03 14:16     ` André Almeida

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=874j1iismp.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=andrealmeid@igalia.com \
    --cc=arnd@arndb.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vpeixoto@lkcamp.dev \
    /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