From owner-freebsd-stable@FreeBSD.ORG Mon Sep 9 05:14:49 2013 Return-Path: Delivered-To: stable@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 ESMTP id 7D820EC1 for ; Mon, 9 Sep 2013 05:14:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D42C25A4 for ; Mon, 9 Sep 2013 05:14:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r895EicJ064659; Mon, 9 Sep 2013 08:14:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r895EicJ064659 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r895EiIO064658; Mon, 9 Sep 2013 08:14:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Sep 2013 08:14:44 +0300 From: Konstantin Belousov To: Oliver Pinter Subject: Re: 9.2-STABLE: supervisor read data, page not present Message-ID: <20130909051444.GG41229@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ie9RhXlkjyREuElA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 05:14:49 -0000 --ie9RhXlkjyREuElA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 08, 2013 at 11:40:01PM +0200, Oliver Pinter wrote: > #6 0xffffffff806a2ab3 in cpuctl_ioctl (dev=3D,=20 > cmd=3D, data=3D, flags=3D0,= =20 > td=3D) at /usr/src/sys/dev/cpuctl/cpuctl.c:478 > cpu =3D > ret =3D Do you indeed posses VIA CPU ? Was it due to some violence act ? I am not sure about the first panic, lets fix the malloc/free corruption and see. The proc_reap() issue might be a consequence of the memory corruption from the wrong free(). There is no public documentation for VIA CPUs, at least I was not able to find anything when I looked. According to the comment in the update_via(), all what is needed is that update buffer was 4-bytes aligned, which is always guaranteed by our malloc(9), at least for the allocation of size >=3D4. Try this. diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c index 4e5abb2..ca5ed56 100644 --- a/sys/dev/cpuctl/cpuctl.c +++ b/sys/dev/cpuctl/cpuctl.c @@ -408,10 +408,10 @@ fail: static int update_via(int cpu, cpuctl_update_args_t *args, struct thread *td) { - void *ptr =3D NULL; + void *ptr; uint64_t rev0, rev1, res; uint32_t tmp[4]; - int is_bound =3D 0; + int is_bound; int oldcpu; int ret; =20 @@ -427,8 +427,7 @@ update_via(int cpu, cpuctl_update_args_t *args, struct = thread *td) /* * 4 byte alignment required. */ - ptr =3D malloc(args->size + 16, M_CPUCTL, M_WAITOK); - ptr =3D (void *)(16 + ((intptr_t)ptr & ~0xf)); + ptr =3D malloc(args->size, M_CPUCTL, M_WAITOK); if (copyin(args->data, ptr, args->size) !=3D 0) { DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed", __LINE__, args->data, ptr, args->size); --ie9RhXlkjyREuElA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSLVlDAAoJEJDCuSvBvK1BvnEP/RXZlu7xSCgfnUevd5nTX+Cx 6/WB6Bj5FFLBrdU/Tr4qYRnG/XMWA591ahTJdORFxna5EYBycJQvRCGS/KeKzZ2s FtPazvniBgNWIvKQD5KzDOSHDS1+FBeh513Se29Nas+UOmERQtsGi0DdyjhEacdM AWQZz4OnghyCf8jHc8/T1ST9h2GYxF2wXhAtOeMLf5FAYqBkkHO9dTATz00FdFxS 8L5aCoib5lGLWt0dnaBgXc4uwgsHvnukO8rPX/nNltO3x4p+bZh2zek1bhcc8xih ZVDt5ZiP4ZykAPj+zMH1xuPfADY221pCm9OQEs2ZxzTipE0BW/G1Jf9d+bUG4e04 LRvHu3Htvi14Skg6CATi3+M5KVHiiqWqgdnz/Bd2AsJqZ8WI4L5EOZAOh2xnh1N8 2zwoikH0bgP+GbQyaBwpYHcBNJAzuyRpiA1RuzvRJ+6kl4r17h94+LiFpKygEOzA qeRnIvbYDpzARcSqLntYc78aIo86yYfI1NgJH0KvDKSzaLqN9CwTx0JR/I8DBCeD 0z+yZ/icr+z8Xj/Uvseh7pY/OY37KK0OcWgWlDh0uHLJBL8MnczYjppMlKjqinOT YfL1mYDpBTWpAM5l8lnPPO8nyIZIAk1APmgGuC2Oh2WNFavZ4d+6njJnPV0919vB xl3ruq860oR0qBnEzGSH =JSpx -----END PGP SIGNATURE----- --ie9RhXlkjyREuElA--