From: Peter Hurley <peter@hurleysoftware.com>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
markus@trippelsdorf.de, linux-kernel@vger.kernel.org
Subject: Re: WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0()
Date: Fri, 01 Mar 2013 16:54:20 -0500 [thread overview]
Message-ID: <1362174860.3221.2.camel@thor.lan> (raw)
In-Reply-To: <20130301213511.GF2481@mtj.dyndns.org>
On Fri, 2013-03-01 at 13:35 -0800, Tejun Heo wrote:
> Hello, Andrew.
>
> On Fri, Mar 01, 2013 at 01:31:59PM -0800, Andrew Morton wrote:
> > okluar passed a negative `wd' into inotify_rm_watch()?
> >
> > I wonder why it did that. I doubt if inotify_add_watch() ever returns
> > negative descriptors, in which case I expect that okular's call to
> > inotify_add_watch() returned -1 and an errno and okular forgot to check
> > it, and later passed that -1 back into inotify_rm_watch().
> >
> > Anyway, I guess we need to make inotify_add_watch() refuse to return
> > negative descriptors (presumably this is already the case due to idr
> > internals) and make inotify_rm_watch() trap negative values of `wd' up
> > front.
> >
> > I wonder how many other such gremlins the IDR checking has added.
>
> The WARN_ON() is just for cases where someone might be doing something
> crazy with the previous behavior of ignoring high bit. Maybe I was
> being overly paranoid and we should just drop it from idr_find().
Can we revert the __lock_timer patch as well then?
On Mon, 2013-02-25 at 17:48 -0800, Tejun Heo wrote:
On Mon, Feb 25, 2013 at 08:46:11PM -0500, Peter Hurley wrote:
> > On Mon, 2013-02-25 at 17:40 -0800, Tejun Heo wrote:
> > > On Mon, Feb 25, 2013 at 08:37:12PM -0500, Peter Hurley wrote:
> > > > Since idr is used for syscall apis (to associate 'handles' with
> > > > internal structures), don't WARN with invalid input.
> > > >
> > > > For example, POSIX timers are identified by timer_t id. These
> > > > ids are idr values. If userspace passes a representable timer_t id
> > > > value (eg, id < 0) but which was not previous allocated (since the
> > > > current idr api does not return negative idr values), then the
> > > > syscall properly returns an error; a WARN is unnecessary and
> > > > undesirable.
> > >
> > > WARN_ON() on negative was intentional. Because the previous
> > > implmentation silently dropped the msb, we at least wanna know who has
> > > been passing in negative indices. Patch for the lock_timer is already
> > > in -mm.
> >
> > Thanks. Can you share the patch title? It's not in next-20130225.
>
> It's this one.
>
> http://thread.gmane.org/gmane.linux.kernel/1444883/focus=1445094
>
next prev parent reply other threads:[~2013-03-01 21:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 9:08 WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0() markus
2013-03-01 21:31 ` Andrew Morton
2013-03-01 21:35 ` Tejun Heo
2013-03-01 21:45 ` [PATCH] idr: remove WARN_ON_ONCE() on negative IDs Tejun Heo
2013-03-01 21:54 ` Peter Hurley [this message]
2013-03-01 21:56 ` WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0() Tejun Heo
2013-03-01 22:10 ` Peter Hurley
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=1362174860.3221.2.camel@thor.lan \
--to=peter@hurleysoftware.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus@trippelsdorf.de \
--cc=tj@kernel.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.