From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jan 28 11:30:13 2012 Return-Path: Delivered-To: freebsd-ports-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 0F0E11065672 for ; Sat, 28 Jan 2012 11:30:13 +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 DE2E18FC14 for ; Sat, 28 Jan 2012 11:30:12 +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 q0SBUCAc081846 for ; Sat, 28 Jan 2012 11:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0SBUCYE081843; Sat, 28 Jan 2012 11:30:12 GMT (envelope-from gnats) Resent-Date: Sat, 28 Jan 2012 11:30:12 GMT Resent-Message-Id: <201201281130.q0SBUCYE081843@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346A5106566B for ; Sat, 28 Jan 2012 11:23:38 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1848C8FC08 for ; Sat, 28 Jan 2012 11:23:38 +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 q0SBNbwa081475 for ; Sat, 28 Jan 2012 11:23:37 GMT (envelope-from crees@freefall.freebsd.org) Received: (from crees@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0SBNb69081474; Sat, 28 Jan 2012 11:23:37 GMT (envelope-from crees) Message-Id: <201201281123.q0SBNb69081474@freefall.freebsd.org> Date: Sat, 28 Jan 2012 11:23:37 GMT From: Chris Rees To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/164567: [PATCH] Fix port: audio/oss panics on 9+ if sound built into kernel X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Chris Rees List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 11:30:13 -0000 >Number: 164567 >Category: ports >Synopsis: [PATCH] Fix port: audio/oss panics on 9+ if sound built into kernel >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 28 11:30:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: FreeBSD 8.2-STABLE i386 >Organization: >Environment: System: FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #5 r227907: Wed Nov 23 21:55:50 UTC 2011 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386 >Description: On 9+, the kernel objects and panics if make_dev is called on a device name that already exists; coupled with the latest commits to GENERIC that makes sound compiled in by default leaves a stock system vulnerable to panics if oss is installed and started. The patch replaces the panic with a warning and aborts the load. http://lists.freebsd.org/pipermail/freebsd-multimedia/2011-December/012629.html >How-To-Repeat: >Fix: --- patch.txt begins here --- ? work Index: Makefile =================================================================== RCS file: /home/pcvs/ports/audio/oss/Makefile,v retrieving revision 1.44 diff -u -r1.44 Makefile --- Makefile 25 Aug 2011 00:35:42 -0000 1.44 +++ Makefile 28 Jan 2012 11:19:20 -0000 @@ -7,6 +7,7 @@ PORTNAME= oss DISTVERSION= 4.2-build2005 +PORTREVISION= 1 CATEGORIES= audio kld MASTER_SITES= http://www.opensound.com/developer/sources/stable/bsd/ DISTNAME= ${PORTNAME}-v${DISTVERSION}-src-bsd Index: files/patch-kernel-OS-FreeBSD-os_freebsd.c =================================================================== RCS file: /home/pcvs/ports/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.c,v retrieving revision 1.10 diff -u -r1.10 patch-kernel-OS-FreeBSD-os_freebsd.c --- files/patch-kernel-OS-FreeBSD-os_freebsd.c 21 Jun 2011 22:17:50 -0000 1.10 +++ files/patch-kernel-OS-FreeBSD-os_freebsd.c 28 Jan 2012 11:19:20 -0000 @@ -1,6 +1,12 @@ ---- kernel/OS/FreeBSD/os_freebsd.c.orig 2011-01-05 16:06:40.000000000 -0500 -+++ kernel/OS/FreeBSD/os_freebsd.c 2011-06-21 17:52:41.000000000 -0400 -@@ -315,7 +315,7 @@ oss_get_cardinfo (int cardnum, oss_card_ +$FreeBSD$ + +Second part from http://lists.freebsd.org/pipermail/freebsd-hackers/2011-December/037182.html + +Thanks to kib for the suggestions + +--- os_freebsd.c.orig 2011-12-28 16:26:09.773674859 +0000 ++++ os_freebsd.c 2012-01-28 11:17:27.011511878 +0000 +@@ -315,7 +315,7 @@ if (cards[cardnum]->name != NULL) strncpy (ci->longname, cards[cardnum]->name, 128); @@ -9,3 +15,30 @@ if (cards[cardnum]->nick != NULL) strncpy (ci->shortname, cards[cardnum]->nick, 16); +@@ -361,7 +361,7 @@ + { + struct cdev *bsd_cdev; + oss_cdev_t *cdev = NULL; +- int i, num; ++ int i, num, err; + + if (dev_class != OSS_DEV_STATUS) + if (oss_expired && instance > 0) +@@ -413,8 +413,17 @@ + + if (!(flags & CHDEV_VIRTUAL) && (name != NULL)) + { ++#if __FreeBSD_version >= 802500 ++ err = make_dev_p (MAKEDEV_CHECKNAME, &bsd_cdev, &oss_cdevsw, NULL, UID_ROOT, GID_WHEEL, 0666, name, 0); ++ if (err != 0) ++ { ++ cmn_err (CE_WARN, "Cannot allocate device node /dev/%s: %d\n", name, err); ++ return err; ++ } ++#else /* no make_dev_p */ + bsd_cdev = + make_dev (&oss_cdevsw, num, UID_ROOT, GID_WHEEL, 0666, name, 0); ++#endif + cdev->info = bsd_cdev; + } + } --- patch.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: