From owner-svn-src-all@FreeBSD.ORG Wed Sep 26 07:09:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52668106564A; Wed, 26 Sep 2012 07:09:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D9228FC0C; Wed, 26 Sep 2012 07:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8Q79Ge2077763; Wed, 26 Sep 2012 07:09:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8Q79FUf077761; Wed, 26 Sep 2012 07:09:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209260709.q8Q79FUf077761@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 26 Sep 2012 07:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240948 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2012 07:09:16 -0000 Author: trasz Date: Wed Sep 26 07:09:15 2012 New Revision: 240948 URL: http://svn.freebsd.org/changeset/base/240948 Log: Fix panic in CTL caused by trying to free invalid pointers passed by the userland process via the IOCTL interface. Reviewed by: ken@ Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Sep 26 03:54:55 2012 (r240947) +++ head/sys/cam/ctl/ctl.c Wed Sep 26 07:09:15 2012 (r240948) @@ -2075,6 +2075,11 @@ ctl_copyin_args(int num_be_args, struct goto bailout; for (i = 0; i < num_be_args; i++) { + args[i].kname = NULL; + args[i].kvalue = NULL; + } + + for (i = 0; i < num_be_args; i++) { uint8_t *tmpptr; args[i].kname = ctl_copyin_alloc(args[i].name,