linux/drivers/nvdimm
Dan Williams 813357fead libnvdimm/security: Fix key lookup permissions
As of commit 8c0637e950 ("keys: Make the KEY_NEED_* perms an enum rather
than a mask") lookup_user_key() needs an explicit declaration of what it
wants to do with the key. Add KEY_NEED_SEARCH to fix a warning with the
below signature, and fixes the inability to retrieve a key.

    WARNING: CPU: 15 PID: 6276 at security/keys/permission.c:35 key_task_permission+0xd3/0x140
    [..]
    RIP: 0010:key_task_permission+0xd3/0x140
    [..]
    Call Trace:
     lookup_user_key+0xeb/0x6b0
     ? vsscanf+0x3df/0x840
     ? key_validate+0x50/0x50
     ? key_default_cmp+0x20/0x20
     nvdimm_get_user_key_payload.part.0+0x21/0x110 [libnvdimm]
     nvdimm_security_store+0x67d/0xb20 [libnvdimm]
     security_store+0x67/0x1a0 [libnvdimm]
     kernfs_fop_write+0xcf/0x1c0
     vfs_write+0xde/0x1d0
     ksys_write+0x68/0xe0
     do_syscall_64+0x5c/0xa0
     entry_SYSCALL_64_after_hwframe+0x49/0xb3

Fixes: 8c0637e950 ("keys: Make the KEY_NEED_* perms an enum rather than a mask")
Suggested-by: David Howells <dhowells@redhat.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/159297332630.1304143.237026690015653759.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2020-07-08 17:08:01 -07:00
..
Kconfig
Makefile
badrange.c
blk.c libnvdimm for 5.8 2020-06-13 13:04:36 -07:00
btt.c libnvdimm for 5.8 2020-06-13 13:04:36 -07:00
btt.h
btt_devs.c libnvdimm: Move attribute groups to device type 2019-11-17 09:17:38 -08:00
bus.c libnvdimm: Out of bounds read in __nd_ioctl() 2020-02-28 18:21:52 -08:00
claim.c
core.c libnvdimm for 5.5 2019-12-01 18:43:25 -08:00
dax_devs.c libnvdimm: Move attribute groups to device type 2019-11-17 09:17:38 -08:00
dimm.c libnvdimm/region: Introduce NDD_LABELING 2020-03-17 12:23:21 -07:00
dimm_devs.c libnvdimm/region: Introduce an 'align' attribute 2020-03-17 12:23:21 -07:00
e820.c libnvdimm/e820: Retrieve and populate correct 'target_node' info 2020-02-18 10:28:05 -08:00
label.c
label.h libnvdimm/label: Replace zero-length array with flexible-array member 2020-03-30 12:37:09 -07:00
namespace_devs.c libnvdimm/region: Introduce an 'align' attribute 2020-03-17 12:23:21 -07:00
nd-core.h libnvdimm for 5.5 2019-12-01 18:43:25 -08:00
nd.h nvdimm: use bio_{start,end}_io_acct 2020-05-27 05:21:23 -06:00
nd_virtio.c
of_pmem.c libnvdimm: Update persistence domain value for of_pmem and papr_scm device 2020-03-31 14:42:28 -07:00
pfn.h libnvdimm/namespace: Enforce memremap_compat_align() 2020-03-17 12:23:21 -07:00
pfn_devs.c libnvdimm/namespace: Enforce memremap_compat_align() 2020-03-17 12:23:21 -07:00
pmem.c libnvdimm for 5.8 2020-06-13 13:04:36 -07:00
pmem.h
region.c
region_devs.c nvdimm/region: always show the 'align' attribute 2020-06-17 14:08:31 -07:00
security.c libnvdimm/security: Fix key lookup permissions 2020-07-08 17:08:01 -07:00
virtio_pmem.c
virtio_pmem.h