[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 3 Mar 2014 17:43:45 -0500
From: Tejun Heo <tj@...nel.org>
To: Richard Cochran <richardcochran@...il.com>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Eric Biederman <ebiederm@...ssion.com>
Subject: Re: Bug in fs/kernfs/dir.c comment or code?
(cc'ing Greg and Eric)
On Sun, Mar 02, 2014 at 09:16:58PM +0100, Richard Cochran wrote:
> I stumbled across this in fs/kernfs/dir.c:39.
>
> /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
> if (hash < 1)
> hash += 2;
> if (hash >= INT_MAX)
> hash = INT_MAX - 1;
>
> Shouldn't that be (hash < 2), or is 1 not reserved?
Looks like the code is wrong and the condition should be hash < 2.
Difficult to trigger but an actual bug. The fix should probably be
propagated to sysfs through -stable. Can you write up a patch?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists