From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH V2] catch acl==NULL in __jfs_set_acl (fixed null pointer dereference) Date: Tue, 29 Apr 2014 14:26:02 -0400 Message-ID: <20140429182602.GD5929@linux.intel.com> References: <535FE897.9040607@tnt.uni-hannover.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Marco Munderloh Return-path: Received: from mga01.intel.com ([192.55.52.88]:36120 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932491AbaD2S0E (ORCPT ); Tue, 29 Apr 2014 14:26:04 -0400 Content-Disposition: inline In-Reply-To: <535FE897.9040607@tnt.uni-hannover.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Apr 29, 2014 at 07:59:51PM +0200, Marco Munderloh wrote: > changes V2: I forgot to set rc = 0, leaving it uninitialized if acl was NULL. You don't need to initialise rc here. But why not, more simply: +++ b/fs/jfs/acl.c @@ -83,6 +83,8 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int t switch (type) { case ACL_TYPE_ACCESS: ea_name = POSIX_ACL_XATTR_ACCESS; + if (!acl) + break; rc = posix_acl_equiv_mode(acl, &inode->i_mode); if (rc < 0) return rc;