From owner-svn-soc-all@FreeBSD.ORG Thu Aug 14 04:13:27 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8554853E for ; Thu, 14 Aug 2014 04:13:27 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 701DC2B1F for ; Thu, 14 Aug 2014 04:13:27 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4DRRT010631 for ; Thu, 14 Aug 2014 04:13:27 GMT (envelope-from astarasikov@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4DQeY010627 for svn-soc-all@FreeBSD.org; Thu, 14 Aug 2014 04:13:26 GMT (envelope-from astarasikov@FreeBSD.org) Date: Thu, 14 Aug 2014 04:13:26 GMT Message-Id: <201408140413.s7E4DQeY010627@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to astarasikov@FreeBSD.org using -f From: astarasikov@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272382 - soc2014/astarasikov/head/sys/dev/ofw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:13:27 -0000 Author: astarasikov Date: Thu Aug 14 04:13:25 2014 New Revision: 272382 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272382 Log: [ofw]: workaround strlcat corruption on goldfish After enabling the MMC driver, I have experienced that the argument to strlcat always pointed to invalid memory. To allow me to debug the driver, I have implemented an ugly hack Modified: soc2014/astarasikov/head/sys/dev/ofw/ofw_bus_subr.c Modified: soc2014/astarasikov/head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- soc2014/astarasikov/head/sys/dev/ofw/ofw_bus_subr.c Wed Aug 13 22:34:14 2014 (r272381) +++ soc2014/astarasikov/head/sys/dev/ofw/ofw_bus_subr.c Thu Aug 14 04:13:25 2014 (r272382) @@ -82,6 +82,7 @@ ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t child, char *buf, size_t buflen) { + printf("%s: buflen=%x\n", __func__, buflen); if (ofw_bus_get_name(child) != NULL) { strlcat(buf, "name=", buflen); @@ -90,6 +91,10 @@ if (ofw_bus_get_compat(child) != NULL) { strlcat(buf, " compat=", buflen); + if (ofw_bus_get_compat(child) < (char*)0xc0000000) { + printf("%s: bad compat ptr %p\n", __func__, ofw_bus_get_compat(child)); + return (0); + } strlcat(buf, ofw_bus_get_compat(child), buflen); } return (0);