From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viacheslav Dubeyko Subject: Re: [PATCH] hfsplus: add missing osx prefix to FinderInfo attribute check Date: Wed, 01 Apr 2015 09:38:57 -0700 Message-ID: <1427906337.2788.2.camel@slavad-ubuntu-14.04> References: <551B6904.50405@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, stable@vger.kernel.org, Andrew Morton , Hin-Tak Leung , Sergei Antonov , Anton Altaparmakov , Fabian Frederick , Christian Kujau To: Thomas Hebb Return-path: In-Reply-To: <551B6904.50405@gmail.com> Sender: stable-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2015-03-31 at 23:41 -0400, Thomas Hebb wrote: > By the time we reach strcmp_xattr_finder_info(), hfsplus_osx_getxattr() > has already prefixed the user-provided xattr name with "osx.", so the > existing check for the special FinderInfo attribute will always fail, > and ENODATA will be returned to userspace. > > Since hfsplus_listxattr() reports the FinderInfo attribute, this > behavior causes certain userspace utilities (e.g. patch) to fail, since > the kernel lists an attribute that doesn't exist. > Could you describe in more details how do you use userspace utilities for extracting xattr? I suspect that you simply use it in incorrect way. Thanks, Vyacheslav Dubeyko. > Cc: stable@vger.kernel.org > Cc: Andrew Morton > Cc: Hin-Tak Leung > Cc: Sergei Antonov > Cc: Anton Altaparmakov > Cc: Fabian Frederick > Cc: Christian Kujau > Signed-off-by: Thomas Hebb > --- > fs/hfsplus/xattr.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c > index d98094a..da0664e 100644 > --- a/fs/hfsplus/xattr.c > +++ b/fs/hfsplus/xattr.c > @@ -28,8 +28,16 @@ const struct xattr_handler *hfsplus_xattr_handlers[] = { > static int strcmp_xattr_finder_info(const char *name) > { > + int err = 0; > + > if (name) { > - return strncmp(name, HFSPLUS_XATTR_FINDER_INFO_NAME, > + err = strncmp(name, XATTR_MAC_OSX_PREFIX, > + XATTR_MAC_OSX_PREFIX_LEN); > + if (err) > + return err; > + > + return strncmp(name + XATTR_MAC_OSX_PREFIX_LEN, > + HFSPLUS_XATTR_FINDER_INFO_NAME, > sizeof(HFSPLUS_XATTR_FINDER_INFO_NAME)); > } > return -1;