From patchwork Sat Jul 26 16:21:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 4627461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3CCBBC0338 for ; Sat, 26 Jul 2014 16:26:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FD212017D for ; Sat, 26 Jul 2014 16:26:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D02420179 for ; Sat, 26 Jul 2014 16:26:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XB4lh-0005Ck-7s; Sat, 26 Jul 2014 16:24:21 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XB4ld-00054X-SR for linux-arm-kernel@lists.infradead.org; Sat, 26 Jul 2014 16:24:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=380o/dFaDumIgacTDNMQRbycnYp6N4MHDSUZkM/3tDQ=; b=K/qMsgdhe8Xo0lyde5ZUS2r34Skxt4887bmpDcVRP4GdC/z+J0yP9lzl0vwYXbcSxLfHTsS5PmZVanPG/H9563KO3s+lOlF6ZOEogQabeJn7smLM39sAqXeEUgMcTHA+z8borwFv9Yq/hPgMYirLIchjADWt8Ca6Qx6b7p8nbz4=; Received: from n2100.arm.linux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:58379) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1XB4jB-0008Rz-5w; Sat, 26 Jul 2014 17:21:45 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1XB4j9-00034M-WA; Sat, 26 Jul 2014 17:21:44 +0100 Date: Sat, 26 Jul 2014 17:21:43 +0100 From: Russell King - ARM Linux To: Christoph Hellwig , trond.myklebust@primarydata.com Subject: [BUG] nfs3_list_one_acl oops Message-ID: <20140726162143.GB20396@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140726_092418_252956_033625E5 X-CRM114-Status: GOOD ( 19.00 ) X-Spam-Score: -0.1 (/) Cc: stable@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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 Today, I got a nice oops while trying to update my initramfs: Alignment trap: not handling instruction e1901f9f at [] Unhandled fault: alignment exception (0x001) at 0xffffffa1 Internal error: : 1 [#1] SMP ARM Modules linked in: bnep rfcomm bluetooth nfsd exportfs hid_cypress brcmfmac brcmutil snd_soc_fsl_spdif imx_pcm_dma imx2_wdt imx_thermal imx_sdma snd_soc_imx_spdif CPU: 2 PID: 1704 Comm: cp Not tainted 3.16.0-rc6+ #1281 task: e9be5580 ti: e3ce6000 task.ti: e3ce6000 PC is at nfs3_list_one_acl+0x38/0xa0 LR is at get_acl+0x4c/0x60 pc : [] lr : [] psr: a00d0013 sp : e3ce7f08 ip : e3ce7ee8 fp : e3ce7f2c r10: 00000000 r9 : e3ce6000 r8 : 00000000 r7 : 00000000 r6 : c06d728c r5 : 00000000 r4 : e3ce7f3c r3 : 00000000 r2 : e3ce7ea4 r1 : 00003fe7 r0 : ffffffa1 Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c5387d Table: 33dec04a DAC: 00000015 Process cp (pid: 1704, stack limit = 0xe3ce6248) Stack: (0xe3ce7f08 to 0xe3ce8000) 7f00: 00000000 e3ce7f3c 00000000 e9ff3858 00000000 00000000 7f20: e3ce7f5c e3ce7f30 c020c0f8 c020b8c4 00000000 e3ce7f3c 00000000 00000000 7f40: 00000000 c020c0b4 00000000 e8c05198 e3ce7f84 e3ce7f60 c011a0d0 c020c0c0 7f60: e3d04600 e3d04600 00000000 00000000 c000ec04 00000000 e3ce7fa4 e3ce7f88 7f80: c011aed8 c011a07c 00008000 be9995a8 b6f756db 000000ea 00000000 e3ce7fa8 7fa0: c000ea80 c011aeb0 00008000 be9995a8 00000003 00000000 00000000 00022150 7fc0: 00008000 be9995a8 b6f756db 000000ea be9994d8 b6f10d99 00000003 be9995a8 7fe0: be9993a0 be999390 b6f105db b6ea8ca0 800d0010 00000003 6f74616c 69662d72 Backtrace: [] (nfs3_list_one_acl) from [] (nfs3_listxattr+0x44/0x80) [] (nfs3_listxattr) from [] (listxattr+0x60/0x11c) [] (listxattr) from [] (SyS_flistxattr+0x34/0x58) [] (SyS_flistxattr) from [] (ret_fast_syscall+0x0/0x30) Code: 0a000016 f57ff05b f590f000 e1901f9f (e2411001) ---[ end trace 05ecbdab16531f0b ]--- The problem is that get_acl() does *not* return NULL on error, it returns an error code. Hence this: + acl = get_acl(inode, type); + if (!acl) + return 0; introduced by 74adf83f5d77 ("nfs: only show Posix ACLs in listxattr if actually present") ends up breaking when get_acl() fails (as is the case if NFS is used against a server with ACL support disabled.) The original commit was marked for stable, which means that this brokenness is going to spread to all stable kernels. Fixes: 74adf83f5d77 ("nfs: only show Posix ACLs in listxattr if actually present") Signed-off-by: Russell King Cc: Cc: Trond Myklebust --- I've included in the Cc list so they can hold off spreading the broken patch further into stable trees until this issue is resolved. fs/nfs/nfs3acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 8f854dde4150..ada8c66aa9e5 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c @@ -256,7 +256,7 @@ nfs3_list_one_acl(struct inode *inode, int type, const char *name, void *data, char *p = data + *result; acl = get_acl(inode, type); - if (!acl) + if (IS_ERR(acl)) return 0; posix_acl_release(acl);