cxl/mbox: Use type __u32 for mailbox payload sizes
authorAlison Schofield <alison.schofield@intel.com>
Thu, 14 Apr 2022 05:12:46 +0000 (22:12 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 22 Apr 2022 23:12:04 +0000 (16:12 -0700)
commit26f89535a5bb17915a2e1062c3999a2ee797c7b0
treec33eacd1c947648c140937688fd2c396d231ea96
parent9ea4dcf49878bb9546b8fa9319dcbdc9b7ee20f8
cxl/mbox: Use type __u32 for mailbox payload sizes

Payload sizes for mailbox commands are expected to be positive values
coming from userspace. The documentation correctly describes these as
always unsigned values. The mailbox and send structures that support
the mailbox commands however, use __s32 types for the payloads.

Replace  __s32 with __u32 in the mailbox and send command structures
and update usages.

Kernel users of the interface already block all negative values and
there is no known ability for userspace to have grown a dependency on
submitting negative values to the kernel. The known user of the IOCTL,
the CXL command line interface (cxl-cli) already enforces positive
size values.

A Smatch warning of a signedness uncovered this issue.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/20220414051246.1244575-1-alison.schofield@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c
include/uapi/linux/cxl_mem.h