From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 18 13:50:03 2012 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 AEEA2106564A for ; Wed, 18 Jul 2012 13:50:03 +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 93ECF8FC12 for ; Wed, 18 Jul 2012 13:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6IDo3np046470 for ; Wed, 18 Jul 2012 13:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6IDo3j8046469; Wed, 18 Jul 2012 13:50:03 GMT (envelope-from gnats) Date: Wed, 18 Jul 2012 13:50:03 GMT Message-Id: <201207181350.q6IDo3j8046469@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: misc/169947: System crash via ioctl() on mdctl. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 13:50:03 -0000 The following reply was made to PR kern/169947; it has been noted by GNATS. From: Jaakko Heinonen To: Filip Palian Cc: bug-followup@FreeBSD.org Subject: Re: misc/169947: System crash via ioctl() on mdctl. Date: Wed, 18 Jul 2012 16:33:39 +0300 On 2012-07-17, Filip Palian wrote: > User who has read permission on "/dev/mdctl" is able to crash the > system (also within the jail if only provided by devfs(.rules)) via > ioctl() handler in "/usr/src/sys/dev/md/md.c:1082". The crash occures > in function swap_release_by_cred() (swap_pager.c:285) called in > vm_object_deallocate() (md.c:1119). Some detailed information included > below. > > Patch attached with submission follows: > > #include > #include I couldn't reproduce the problem with your test program on current or stable/9: $ ./mdtest.orig say goodnight... ioctl(MDIOCATTACH) failed: Invalid argument no +r no fun I tried to modify the test program with following changes but still no success. %%% --- mdtest.c 2012-07-18 16:13:34.000000000 +0300 +++ mdtest.c 2012-07-18 16:17:05.000000000 +0300 @@ -21,7 +21,8 @@ s.md_version = MDIOVERSION; // s.md_type = MD_SWAP; s.md_type = MD_PRELOAD; - s.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + s.md_base = -1; + s.md_options = MD_AUTOUNIT; // typedef long long = int64 = off_t //s.md_mediasize = 4096*1000000000000000000000000000000000000000000000000000; %%% $ ./mdtest say goodnight... no +r no fun A new md device is successfully created. Are you sure that you attached the correct test program and you didn't have local patches applied to your kernel? -- Jaakko