Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2013 07:58:37 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256833 - head/lib/libc/iconv
Message-ID:  <201310210758.r9L7wboY024105@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Oct 21 07:58:37 2013
New Revision: 256833
URL: http://svnweb.freebsd.org/changeset/base/256833

Log:
  Drop cm_lock before calling mapper_close, which in turn could call
  _citrus_mapper_close again and result in a deadlock otherwise.
  
  This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file).
  
  PR:		bin/182994
  Submitted by:	Fabian Keil <fk fabiankeil de>
  MFC after:	3 days

Modified:
  head/lib/libc/iconv/citrus_mapper.c

Modified: head/lib/libc/iconv/citrus_mapper.c
==============================================================================
--- head/lib/libc/iconv/citrus_mapper.c	Mon Oct 21 07:49:36 2013	(r256832)
+++ head/lib/libc/iconv/citrus_mapper.c	Mon Oct 21 07:58:37 2013	(r256833)
@@ -381,7 +381,9 @@ _citrus_mapper_close(struct _citrus_mapp
 			_CITRUS_HASH_REMOVE(cm, cm_entry);
 			free(cm->cm_key);
 		}
+		UNLOCK(&cm_lock);
 		mapper_close(cm);
+		return;
 quit:
 		UNLOCK(&cm_lock);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310210758.r9L7wboY024105>