From: Al Viro <viro@ZenIV.linux.org.uk>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Subject: Re: Regression introduced by bfcfaa77bdf0f775263e906015982a608df01c76 (vfs: use 'unsigned long' accesses for dcache name comparison and hashing)
Date: Thu, 22 Mar 2012 20:09:19 +0000 [thread overview]
Message-ID: <20120322200918.GZ6589@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20120322183845.GA17264@phenom.dumpdata.com>
On Thu, Mar 22, 2012 at 02:38:46PM -0400, Konrad Rzeszutek Wilk wrote:
> while v3.3 with your patch:
>
>
> 8:01:09 # 10 :/proc/xen/
> > ls -al
> ls: cannot access xsd_port: No such file or directory
> total 0
> drwxr-xr-x 2 root root 0 Mar 22 17:57 .
> dr-xr-xr-x 126 root root 0 Mar 22 17:57 ..
> -r--r--r-- 1 root root 0 Mar 22 17:57 capabilities
> -rw------- 1 root root 0 Mar 22 17:57 privcmd
> -rw------- 1 root root 0 Mar 22 17:57 xenbus
> -rw------- 1 root root 0 Mar 22 17:57 xsd_kva
> -????????? ? ? ? ? ? xsd_port
>
>
> Looking at the code that sets up 'xsd_port' it looks pretty innocent
> and similar to other drivers (ibmasm for example).
Interesting... that's exactly 8 characters. Oh, I see - hash_name() gets
an extra multiplication by 9 in this case. Look: full_name_hash() will
handle the first word, decrement len by 8, set hash to <first word> and
bugger off on !len. hash_name(), OTOH, will go through the loops once,
with hash and a both 0. hash stays 0, a becomes <first word>. No NUL or
/ in it, so in we go again; hash becomes a * 9, i.e. <first word> * 9.
a becomes the second word, with mask != 0. And we are out of the loop,
and proceed to add nothing to hash (the name is over at that point). As
the result, we get hash mismatch for names that are 8 bytes long or
multiple thereof.
next prev parent reply other threads:[~2012-03-22 20:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 18:38 Regression introduced by bfcfaa77bdf0f775263e906015982a608df01c76 (vfs: use 'unsigned long' accesses for dcache name comparison and hashing) Konrad Rzeszutek Wilk
2012-03-22 19:33 ` Eric Paris
2012-03-22 20:03 ` Eric Paris
2012-03-22 20:10 ` Al Viro
2012-03-22 20:09 ` Al Viro [this message]
2012-03-22 20:24 ` Al Viro
2012-03-22 20:36 ` Al Viro
2012-03-22 20:42 ` Linus Torvalds
2012-03-22 21:41 ` Konrad Rzeszutek Wilk
2012-03-22 21:54 ` Linus Torvalds
2012-03-22 21:59 ` Al Viro
2012-03-22 20:38 ` Linus Torvalds
2012-03-22 20:44 ` Al Viro
2012-03-22 20:52 ` Linus Torvalds
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=20120322200918.GZ6589@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=xen-devel@lists.xensource.com \
/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