From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965204AbcDLPFw (ORCPT ); Tue, 12 Apr 2016 11:05:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34666 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964944AbcDLPFu (ORCPT ); Tue, 12 Apr 2016 11:05:50 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 2/3] rxrpc: The RXRPC_ACCEPT control message should not have an address From: David Howells To: linux-afs@lists.infradead.org Cc: dhowells@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 12 Apr 2016 16:05:48 +0100 Message-ID: <20160412150548.20637.14972.stgit@warthog.procyon.org.uk> In-Reply-To: <20160412150533.20637.23952.stgit@warthog.procyon.org.uk> References: <20160412150533.20637.23952.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 12 Apr 2016 15:05:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When sendmsg() is called with the RXRPC_ACCEPT control message, sendmsg() shouldn't also be given an address in msg_name. Signed-off-by: David Howells --- net/rxrpc/ar-output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c index b87fda075b45..044de9bf34a4 100644 --- a/net/rxrpc/ar-output.c +++ b/net/rxrpc/ar-output.c @@ -199,7 +199,8 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) return ret; if (cmd == RXRPC_CMD_ACCEPT) { - if (rx->sk.sk_state != RXRPC_SERVER_LISTENING) + if (rx->sk.sk_state != RXRPC_SERVER_LISTENING || + msg->msg_name) return -EINVAL; call = rxrpc_accept_call(rx, user_call_ID); if (IS_ERR(call))