Comment 5 for bug 1348670

Revision history for this message
Sergio Gelato (sergio-gelato) wrote : Re: [Bug 1348670] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010, set_nfsv4_acl_one+0x21/0xb0 [nfsd]

* Sergio Gelato [2014-07-25 14:23:03 -0000]:
> Could this be related to the following entry in the changelog
> for 3.2.0-65.98?
>
> * NFSD: Call ->set_acl with a NULL ACL structure if no entries
> - LP: #1328154

Yes, I think that's it. That change allows posix_state_to_acl() to return
NULL in some cases, and the pre-3.14 set_nfsv4_acl() code doesn't guard
against being passed a NULL for the pacl argument. From a brief perusal
of the sources I think this affects kernels 3.13 (trusty) and older.

A quick fix might be to add
 if (!pacl)
  return vfs_setxattr(dentry, key, NULL, 0, 0);
at the beginning of set_nfsv4_acl_one(). Note I haven't tested this yet.