From patchwork Wed Apr 1 03:41:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Hebb X-Patchwork-Id: 6137321 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5AB9BF4A6 for ; Wed, 1 Apr 2015 03:42:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18A4C20265 for ; Wed, 1 Apr 2015 03:42:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 215732026C for ; Wed, 1 Apr 2015 03:42:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751644AbbDADmF (ORCPT ); Tue, 31 Mar 2015 23:42:05 -0400 Received: from mail-qg0-f43.google.com ([209.85.192.43]:33059 "EHLO mail-qg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbbDADmD (ORCPT ); Tue, 31 Mar 2015 23:42:03 -0400 Received: by qgfa8 with SMTP id a8so32910539qgf.0; Tue, 31 Mar 2015 20:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=BgVWV4LlbLz6TUCdpw7E0WhZOopdTOSvZSq0qsxTQOc=; b=EACkl+FNTgoSYPvQELmwEw6TPEXXXBXyoBndea8RBmpNFxGnupdrkhd45x5P2re0ep tWOYtgqFiKvMTFjiRTf61eymOvwlcmF/2j3yNRIFIfErRJC+GHiUeQHR7/pxTbLLcpWe KJh0ATi2ioP++hBkjrLRDMaGV/GZmpawuzBCD3nXN32zZzfo8og8TDoq8CHCZ1mOPx9X W3uyRHwU02ndnR8hTxeb5M3G1vifafLUeUNYkqWPTNICzUZWb+DtINYo1hhqpNO2tH85 dggBVR+connwJvIgiYj+xS81KeRGBUFzQWl366pM2wJhzfkukrB5FdOlb31X08YeiuCb N3iw== X-Received: by 10.55.23.195 with SMTP id 64mr84097805qkx.76.1427859723077; Tue, 31 Mar 2015 20:42:03 -0700 (PDT) Received: from [130.64.128.230] (resnet-130-64-128-230.medford.tufts.edu. [130.64.128.230]) by mx.google.com with ESMTPSA id y17sm485993qky.8.2015.03.31.20.41.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 20:42:02 -0700 (PDT) Message-ID: <551B6904.50405@gmail.com> Date: Tue, 31 Mar 2015 23:41:56 -0400 From: Thomas Hebb User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: linux-fsdevel@vger.kernel.org CC: stable@vger.kernel.org, Andrew Morton , Hin-Tak Leung , Sergei Antonov , Anton Altaparmakov , Fabian Frederick , Christian Kujau Subject: [PATCH] hfsplus: add missing osx prefix to FinderInfo attribute check Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; -- 2.3.4