From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 13 09:50:09 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE540106566C for ; Tue, 13 Sep 2011 09:50:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CDEBA8FC0C for ; Tue, 13 Sep 2011 09:50:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8D9o9ev000568 for ; Tue, 13 Sep 2011 09:50:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8D9o9Rc000567; Tue, 13 Sep 2011 09:50:09 GMT (envelope-from gnats) Date: Tue, 13 Sep 2011 09:50:09 GMT Message-Id: <201109130950.p8D9o9Rc000567@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Andreas Longwitz Cc: Subject: Re: kern/155658: [amr] [patch] amr_ioctl(): call of malloc() causes memory corruption and panic X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andreas Longwitz List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2011 09:50:09 -0000 The following reply was made to PR kern/155658; it has been noted by GNATS. From: Andreas Longwitz To: bug-followup@freebsd.org Cc: Subject: Re: kern/155658: [amr] [patch] amr_ioctl(): call of malloc() causes memory corruption and panic Date: Tue, 13 Sep 2011 11:43:46 +0200 It is much better to modify the malloc in the patch in this way: malloc(max(au_length, MAX_AMR_IOCTL), M_AMR, M_WAITOK|M_ZERO)) Thanks to Adran Chadd for this hint. -- Dr. Andreas Longwitz Data Service GmbH Beethovenstr. 2A 23617 Stockelsdorf Amtsgericht Lübeck, HRB 318 BS Geschäftsführer: Wilfried Paepcke, Dr. Andreas Longwitz, Josef Flatau