Skip to contentSkip to conversation

Fix oops at rpcb_getport_async in sunrpc

PATCH In review HIRANO Takahito 2 participants 2 messages May 2, 2008 – May 3, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix oops at rpcb_getport_async in sunrpc

The rpcb_getport_async in the sunrpc module copies larger memory area than the allocated. Because of this problem, NFS users might encounter oops.

This problem only exists in 2.6.24.y.
It is fixed in 2.6.25 by the commit 86d61d8638ddf9cdf87df26c7fa69b2804425fbe.

Regards,

HIRANO Takahito

Cc: [email protected],
[email protected]

---
 net/sunrpc/rpcb_clnt.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/sunrpc/rpcb_clnt.c +2 -4
index a05493a..4d939a6 100644
@@ -113,7 +113,7 @@ struct rpcbind_args {
 	u32			r_prot;
 	unsigned short		r_port;
 	char *			r_netid;
-	char			r_addr[RPCB_MAXADDRLEN];
+	const char *		r_addr;
 	char *			r_owner;
 };
 
@@ -390,9 +390,7 @@ void rpcb_getport_async(struct rpc_task *task)
 	map->r_port = 0;
 	map->r_xprt = xprt_get(xprt);
 	map->r_netid = rpc_peeraddr2str(clnt, RPC_DISPLAY_NETID);
-	memcpy(map->r_addr,
-	       rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR),
-	       sizeof(map->r_addr));
+	map->r_addr = rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR);
 	map->r_owner = RPCB_OWNER_STRING;	/* ignored for GETADDR */
 
 	child = rpc_run_task(rpcb_clnt, RPC_TASK_ASYNC, &rpcb_getport_ops, map);

A message that is not in the archive (sent off-list or not yet received): 8408c1a50805021307x2f1843ffrfb53efbbfaf8aaba-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#2 lore raw
Quoted 5 lines · HIRANO Takahito

The rpcb_getport_async in the sunrpc module copies larger memory area than the allocated. Because of this problem, NFS users might encounter oops.

This problem only exists in 2.6.24.y.
It is fixed in 2.6.25 by the commit 86d61d8638ddf9cdf87df26c7fa69b2804425fbe.

The 2.6.24.y kernel tree is pretty much "closed" now, we don't want to do any more releases of it, so I'm not going to add this to any queue, sorry.

thanks,

greg k-h