From patchwork Tue May 27 09:13:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: frank.blaschka@de.ibm.com X-Patchwork-Id: 352829 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BE0F6140093 for ; Tue, 27 May 2014 19:14:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752443AbaE0JON (ORCPT ); Tue, 27 May 2014 05:14:13 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:42734 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752418AbaE0JOH (ORCPT ); Tue, 27 May 2014 05:14:07 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 May 2014 10:14:04 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 May 2014 10:14:01 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5E7A4219005F; Tue, 27 May 2014 10:13:51 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4R9E1hl67043468; Tue, 27 May 2014 09:14:01 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4R9E0CE014163; Tue, 27 May 2014 03:14:00 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s4R9E0im014160; Tue, 27 May 2014 03:14:00 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 24631) id 4B75E122444C; Tue, 27 May 2014 11:14:00 +0200 (CEST) Message-Id: <20140527091400.195475068@de.ibm.com> User-Agent: quilt/0.61-1 Date: Tue, 27 May 2014 11:13:43 +0200 From: frank.blaschka@de.ibm.com To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org, Ursula Braun , Philipp Hachtmann Subject: [patch 2/4] af_iucv: correct cleanup if listen backlog is full References: <20140527091341.417448231@de.ibm.com> MIME-Version: 1.0 Content-Disposition: inline; filename=606-af-iucv-fix-cleanup.diff X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14052709-4966-0000-0000-0000002A935A Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ursula Braun In case of transport HIPER a sock struct is allocated for an incoming connect request. If the backlog queue is full this socket is not needed, but is left in the list of af_iucv sockets. Final socket release posts console message "Attempt to release alive iucv socket". This patch makes sure the new created socket is cleaned up correctly if the backlog queue is full. Signed-off-by: Ursula Braun Signed-off-by: Frank Blaschka Reported-by: Philipp Hachtmann --- net/iucv/af_iucv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 60f5c20..7a95fa4 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -1943,11 +1943,10 @@ static int afiucv_hs_callback_syn(struct sock *sk, struct sk_buff *skb) sk_acceptq_is_full(sk) || !nsk) { /* error on server socket - connection refused */ - if (nsk) - sk_free(nsk); afiucv_swap_src_dest(skb); trans_hdr->flags = AF_IUCV_FLAG_SYN | AF_IUCV_FLAG_FIN; err = dev_queue_xmit(skb); + iucv_sock_kill(nsk); bh_unlock_sock(sk); goto out; }