From: Viacheslav Dubeyko <slava@dubeyko.com>
To: Sergei Antonov <saproj@gmail.com>
Cc: Thomas Hebb <tommyhebb@gmail.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
Hin-Tak Leung <htl10@users.sourceforge.net>,
Anton Altaparmakov <anton@tuxera.com>,
Fabian Frederick <fabf@skynet.be>,
Christian Kujau <lists@nerdbynature.de>
Subject: Re: [PATCH] hfsplus: add missing osx prefix to FinderInfo attribute check
Date: Thu, 02 Apr 2015 18:33:51 -0700 [thread overview]
Message-ID: <1428024831.2973.4.camel@slavad-ubuntu-14.04> (raw)
In-Reply-To: <CABikg9z4F6R1Sse4+Qc3_4Vpj2ghr52A7mXtJrKxcbxiOcYg3A@mail.gmail.com>
On Fri, 2015-04-03 at 01:41 +0200, Sergei Antonov wrote:
> Your patch does fix a bug (reproduced through
> listxattr/getxattr/setxattr apis). But I'd recommend a more elegant
> code:
>
> --- a/fs/hfsplus/xattr.c
> +++ b/fs/hfsplus/xattr.c
> @@ -29,7 +29,9 @@ const struct xattr_handler *hfsplus_xattr_handlers[] = {
> static int strcmp_xattr_finder_info(const char *name)
> {
> if (name) {
> - return strncmp(name, HFSPLUS_XATTR_FINDER_INFO_NAME,
> + return strncmp(name, XATTR_MAC_OSX_PREFIX
> + HFSPLUS_XATTR_FINDER_INFO_NAME,
> + XATTR_MAC_OSX_PREFIX_LEN +
> sizeof(HFSPLUS_XATTR_FINDER_INFO_NAME));
> }
> return -1;
>
>
> If you resubmit it, make it Reviewed-by: Sergei Antonov <saproj@gmail.com>
The issue is located in hfsplus_osx_getxattr() method:
{
char *xattr_name;
int res;
if (!strcmp(name, ""))
return -EINVAL;
/*
* Don't allow retrieving properly prefixed attributes
* by prepending them with "osx."
*/
if (is_known_namespace(name))
return -EOPNOTSUPP;
xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE *
HFSPLUS_ATTR_MAX_STRLEN
+ XATTR_MAC_OSX_PREFIX_LEN + 1, GFP_KERNEL);
if (!xattr_name)
return -ENOMEM;
************************************************************
strcpy(xattr_name, XATTR_MAC_OSX_PREFIX);
strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name);
*************************************************************
This part adds "osx." prefix second time. So, it needs to fix the issue
here.
Thanks,
Vyacheslav Dubeyko.
prev parent reply other threads:[~2015-04-03 1:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 3:41 [PATCH] hfsplus: add missing osx prefix to FinderInfo attribute check Thomas Hebb
2015-04-01 16:38 ` Viacheslav Dubeyko
2015-04-02 23:57 ` Thomas Hebb
2015-04-03 0:28 ` Viacheslav Dubeyko
2015-04-02 23:41 ` Sergei Antonov
2015-04-03 1:33 ` Viacheslav Dubeyko [this message]
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=1428024831.2973.4.camel@slavad-ubuntu-14.04 \
--to=slava@dubeyko.com \
--cc=akpm@linux-foundation.org \
--cc=anton@tuxera.com \
--cc=fabf@skynet.be \
--cc=htl10@users.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lists@nerdbynature.de \
--cc=saproj@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tommyhebb@gmail.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;
as well as URLs for NNTP newsgroup(s).