[rds-devel] [PATCH net-next] net/rds: Whitelist rdma_cookie and rx_tstamp for usercopy

David Miller davem at davemloft.net
Fri Aug 23 14:56:09 PDT 2019


From: Dag Moxnes <dag.moxnes at oracle.com>
Date: Fri, 23 Aug 2019 16:03:18 +0200

> Add the RDMA cookie and RX timestamp to the usercopy whitelist.
> 
> After the introduction of hardened usercopy whitelisting
> (https://urldefense.proofpoint.com/v2/url?u=https-3A__lwn.net_Articles_727322_&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=B4XfHLZoQjxmOkoH011Paddn0sny__aLx9Okab1TW7U&m=SRBjFmey7KgIJ7U82bq-zBfXQDevmZP-0jU9ztvdD3I&s=jyjUUZZvMop7f9MLy_LaEoSr_2mgOrpE_gx871zkPro&e= ), a warning is displayed when the
> RDMA cookie or RX timestamp is copied to userspace:
> 
> kernel: WARNING: CPU: 3 PID: 5750 at
> mm/usercopy.c:81 usercopy_warn+0x8e/0xa6
> [...]
> kernel: Call Trace:
> kernel: __check_heap_object+0xb8/0x11b
> kernel: __check_object_size+0xe3/0x1bc
> kernel: put_cmsg+0x95/0x115
> kernel: rds_recvmsg+0x43d/0x620 [rds]
> kernel: sock_recvmsg+0x43/0x4a
> kernel: ___sys_recvmsg+0xda/0x1e6
> kernel: ? __handle_mm_fault+0xcae/0xf79
> kernel: __sys_recvmsg+0x51/0x8a
> kernel: SyS_recvmsg+0x12/0x1c
> kernel: do_syscall_64+0x79/0x1ae
> 
> When the whitelisting feature was introduced, the memory for the RDMA
> cookie and RX timestamp in RDS was not added to the whitelist, causing
> the warning above.
> 
> Signed-off-by: Dag Moxnes <dag.moxnes at oracle.com>
> Tested-by: jenny.x.xu at oracle.com

Applied, with tested-by tag fixed.

Thanks.



More information about the rds-devel mailing list