net: rds: fix memory leak in rds_recvmsg
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ bdbe6fbc6a2f2ccfb384b141b257677d2a8d36fb · < 5946fbf48355f5a8caeff72580c7658da5966b86| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: rds: fix memory leak in rds_recvmsg
Syzbot reported memory leak in rds. The problem was in unputted refcount in case of error.
int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, int msg_flags) { ...
if (!rds_next_incoming(rs, &inc)) { ... }
After this "if" inc refcount incremented and
if (rds_cmsg_recv(inc, msg, rs)) { ret = -EFAULT; goto out; } ... out: return ret; }
in case of rds_cmsg_recv() fail the refcount won't be decremented. And it's easy to see from ftrace log, that rds_inc_addref() don't have rds_inc_put() pair in rds_recvmsg() after rds_cmsg_recv()
From the CVE record · Linux
The Linux kernel's RDS receive path fails to release a reference in rds_recvmsg() when rds_cmsg_recv() returns an error. A local caller triggering that error can cause a memory leak; the input does not specify authentication or user-interaction requirements.
Teams running Linux kernels with the affected RDS code should check their versions; affected versions are not specified.