NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50511 (npf fails to load tree file above certain size)



The following reply was made to PR kern/50511; it has been noted by GNATS.

From: Christopher Fuhrman <cfuhrman%pobox.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50511 (npf fails to load tree file above certain size)
Date: Wed, 17 Aug 2016 14:05:09 -0700

 Unfortunately, the table I'm trying to load includes bitmasks which only
 work with tree-type tables per npf.conf(5).
 
 --
 Christopher M. Fuhrman
 cfuhrman%pobox.com@localhost
 
 On Wed, Aug 17, 2016, at 01:05 AM, Geoff Wing wrote:
 > The following reply was made to PR kern/50511; it has been noted by
 > GNATS.
 > 
 > From: Geoff Wing <gcw%pobox.com@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc: 
 > Subject: Re: kern/50511 (npf fails to load tree file above certain size)
 > Date: Wed, 17 Aug 2016 18:04:11 +1000
 > 
 >  This is hitting an arbitrary limit in proplib (65536 byte limit on an
 >  ioctl) in _prop_object_copyin()
 >  
 >  from common/lib/libprop/prop_kern.c:
 >  	/* Arbitrary limit ioctl input to 64KB */
 >  	unsigned int prop_object_copyin_limit = 65536;
 >  
 >  On my amd64 system each table line is taking around 121 bytes.  Tables
 >  with, say, 4400 lines want over 1/2 MB.
 >  
 >  Patch below shows the total size it tries to copy.
 >  
 >  Index: common/lib/libprop/prop_kern.c
 >  ===================================================================
 >  RCS file: /cvsroot/src/common/lib/libprop/prop_kern.c,v
 >  retrieving revision 1.19
 >  diff -u -r1.19 prop_kern.c
 >  --- common/lib/libprop/prop_kern.c      11 May 2015 16:48:34 -0000     
 >  1.19
 >  +++ common/lib/libprop/prop_kern.c      17 Aug 2016 07:55:06 -0000
 >  @@ -407,8 +407,10 @@
 >   	char *buf;
 >   	int error;
 >   
 >  -       if (pref->pref_len >= prop_object_copyin_limit)
 >  +       if (pref->pref_len >= prop_object_copyin_limit) {
 >  +               printf("_prop_object_copyin: requested object size (%u)
 >  above limit\n", (unsigned int) pref->pref_len);
 >   		return EINVAL;
 >  +       }
 >   
 >   	/*
 >   	 * Allocate an extra byte so we can guarantee NUL-termination.
 >  
 



Home | Main Index | Thread Index | Old Index