From nobody@FreeBSD.org  Wed Aug  4 19:24:23 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 678861065677
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Aug 2010 19:24:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B8F28FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Aug 2010 19:24:23 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o74JOMN1029399
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 4 Aug 2010 19:24:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o74JOMlE029395;
	Wed, 4 Aug 2010 19:24:22 GMT
	(envelope-from nobody)
Message-Id: <201008041924.o74JOMlE029395@www.freebsd.org>
Date: Wed, 4 Aug 2010 19:24:22 GMT
From: Mikhail <hidden.node@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kdump doesn't honor several options for acl and shutdown family of syscalls
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         149295
>Category:       bin
>Synopsis:       [patch] kdump(1) doesn't honor several options for acl and shutdown family of syscalls
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    netchild
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 04 19:30:10 UTC 2010
>Closed-Date:    Wed Oct 06 12:42:32 UTC 2010
>Last-Modified:  Wed Oct  6 12:50:03 UTC 2010
>Originator:     Mikhail
>Release:        8.1
>Organization:
>Environment:
FreeBSD lenta.bac.lab 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Particularly for this one:

#define ACL_TYPE_ACCESS_OLD     0x00000000
#define ACL_TYPE_DEFAULT_OLD    0x00000001
#define ACL_TYPE_NFS4           0x00000004

and


#define SHUT_RD         0
#define SHUT_WR         1
#define SHUT_RDWR       2

>How-To-Repeat:
lenta:~> cat test.c
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/acl.h>

int
main(void)
{

        shutdown(5, SHUT_RDWR);
        acl_get_fd_np(1, ACL_TYPE_NFS4);

        return (0);
}
lenta:~> gcc test.c -o test && ktrace ./test && kdump | grep -E '(acl|shutdown)' | grep invalid
 12097 test     CALL  shutdown(0x5,<invalid=2>)
 12097 test     CALL  __acl_get_fd(0x1,<invalid=4>,0x28202000)
>Fix:
Edit /usr/src/usr.bin/kdump/mksubr and fix regexps for acl and shutdown syscalls.
Patch against HEAD attached.

Patch attached with submission follows:

--- mksubr.orig 2008-03-12 14:51:01.000000000 +0300
+++ mksubr      2010-08-04 23:06:39.000000000 +0400
@@ -322,7 +322,7 @@

 auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
 auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
-auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
+auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
 auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h"
 auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
 auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
@@ -331,7 +331,7 @@
 auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h"
 auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
 auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
-auto_switch_type "acltypename" "ACL_TYPE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/acl.h"
+auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"
 auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
 auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
 auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->netchild 
Responsible-Changed-By: netchild 
Responsible-Changed-When: Wed Oct 6 12:40:11 UTC 2010 
Responsible-Changed-Why:  
Take the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149295 
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Wed Oct 6 12:42:20 UTC 2010 
State-Changed-Why:  
Patch committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149295 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/149295: commit references a PR
Date: Wed,  6 Oct 2010 12:41:47 +0000 (UTC)

 Author: netchild
 Date: Wed Oct  6 12:41:42 2010
 New Revision: 213479
 URL: http://svn.freebsd.org/changeset/base/213479
 
 Log:
   Fix regex for some socket- and acl-related syscall values.
   
   Submitted by:	Mikhail <hidden.node@gmail.com>
   PR:		149295
   MFC-after:	2 weeks
 
 Modified:
   head/usr.bin/kdump/mksubr
 
 Modified: head/usr.bin/kdump/mksubr
 ==============================================================================
 --- head/usr.bin/kdump/mksubr	Wed Oct  6 10:00:37 2010	(r213478)
 +++ head/usr.bin/kdump/mksubr	Wed Oct  6 12:41:42 2010	(r213479)
 @@ -324,7 +324,7 @@ auto_or_type "nfssvcname" "NFSSVC_[A-Z]+
  
  auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
  auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
 -auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
 +auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
  auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h"
  auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
  auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
 @@ -333,7 +333,7 @@ auto_switch_type "kldunloadfflagsname" "
  auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h"
  auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
  auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
 -auto_switch_type "acltypename" "ACL_TYPE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/acl.h"
 +auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"
  auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
  auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
  auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
