public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Solar Designer <solar@openwall.com>
To: Willy Tarreau <w@1wt.eu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] loop.c: kernel_thread() retval check
Date: Sun, 20 Aug 2006 18:32:35 +0400	[thread overview]
Message-ID: <20060820143235.GA19543@openwall.com> (raw)
In-Reply-To: <20060820072148.GB306@1wt.eu>

On Sun, Aug 20, 2006 at 09:21:48AM +0200, Willy Tarreau wrote:
> I still remembered this problem being discussed, and finally found
> the thread :
> 
>   http://lkml.org/lkml/2003/11/14/55

I was not aware that this had been discussed before.  Bernhard (in the
old LKML posting above) seems to imply that having kernel_thread()
itself not fail on ptrace would be a sufficient fix, which I don't agree
with.  There may be other reasons for kernel_thread() to fail, such as
the kernel running out of resources; with OpenVZ, kernel_thread() is not
allowed from within VEs.

> In fact, no code was proposed and 2.6 got fixed later, then stopped
> using kernel_thread() so nearly nobody might have noticed it :
> 
>   http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=3e88c17d404c5787afd5bd1763380317f5ccbf84;hp=22e6c1b39c648850438decd491f62d311800c7db

I'm afraid that this does not properly clean things up on error.  I just
had a look at linux-2.6.17.9/drivers/block/loop.c - it still uses
kernel_thread() and has the same "goto out_putf" on error return from
kernel_thread(), which appears to not clean things up.

Alexander

  reply	other threads:[~2006-08-20 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19 23:46 [PATCH] loop.c: kernel_thread() retval check Solar Designer
2006-08-20  7:21 ` Willy Tarreau
2006-08-20 14:32   ` Solar Designer [this message]
2006-08-20 18:15 ` Alan Cox
2006-08-20 22:34   ` Solar Designer
2006-08-20 23:11     ` Alan Cox
2006-08-20 22:58       ` Willy Tarreau
2006-08-21  1:59         ` Julio Auto
2006-08-21  2:32           ` Solar Designer
2006-08-21  2:47             ` Julio Auto

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=20060820143235.GA19543@openwall.com \
    --to=solar@openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /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