All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [RFC][PATCH] Allow for deregistering current mode user space address
Date: Fri, 05 Mar 2010 13:02:27 +0100	[thread overview]
Message-ID: <4B90F2D3.8020508@domain.hid> (raw)
In-Reply-To: <4B90ED0A.40101@domain.hid>

Jan Kiszka wrote:
> This adds __xn_sys_drop_u_mode, a syscall to deregister the u_mode user
> space address passed on shadow creation for the current thread. We need
> this in order to safely shut down a thread that wants to release its
> u_mode memory (either malloc'ed or TLS-allocated). So far, the kernel
> might have touched this memory even after the release which caused
> subtle corruptions.
> 
> After we released u_mode, we can no longer make reliable decisions based
> on it. For the fast mutex use case, we then assume the worst case, ie.
> we enforce syscall-based acquisitions unconditionally. For the
> assert_nrt case, we simply acquire the required information via
> __xn_sys_current_info.

As usual, you are firing patches too fast:
- you are lacking the exit syscall trap.
- the patch is not correct and will cause kernel-space addresses to be
passed to put_user, which probably yields bugs when the kernel is
compiled with proper debug flags;
- I do not see the point where the new syscall is called with __thread,
but I am not sure it is missing, and if it is missing, you will get the
rightfull warning when hitting the exit syscall.
- the user-space users of the function to get current_mode are still
cluttered with special cases to handle the invalid state. And
illustrating nicely the deficiency of this approach, you have forgot one
user.

I am not going to make my version before tomorrow, so you have plenty of
time to send me an at least correct version which would take into
account all of our discussions.

Please also consider that your "patch machinegun" way of working is not
really sane. When there are so many often untested patches to review
coming from you, we sometime let some errors slip through. And from a
user point of view, seeing so many buggy patches refused is not really
reassuring.

-- 
					    Gilles.


  reply	other threads:[~2010-03-05 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 11:37 [Xenomai-core] [RFC][PATCH] Allow for deregistering current mode user space address Jan Kiszka
2010-03-05 12:02 ` Gilles Chanteperdrix [this message]
2010-03-05 15:53   ` [Xenomai-core] [RFC][PATCH v2] " Jan Kiszka
2010-03-05 16:30     ` Gilles Chanteperdrix
2010-03-05 17:16       ` Jan Kiszka
2010-03-05 17:36         ` Gilles Chanteperdrix
2010-03-06  9:39           ` Jan Kiszka
2010-03-06 12:07             ` Gilles Chanteperdrix
2010-03-08 16:06               ` Gilles Chanteperdrix

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=4B90F2D3.8020508@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.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 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.