NetBSD-Bugs archive

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

re: kern/50430: syscall_disestablish() can remove active syscalls

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

From: Paul Goyette <>
Subject: re: kern/50430: syscall_disestablish() can remove active syscalls
Date: Mon, 16 Nov 2015 06:39:03 +0800 (PHT)

 From: matthew green <>
 On Sun, 15 Nov 2015, Christos Zoulas wrote:
 > - when load a module that has compat syscalls, assign to it a bit.
 > - mark a flags field of all syscalls that were loaded with that module
 >  with that bit.
 > - or the lwp flags with the syscall flags on each syscall.
 > - when it is time to unload check that no lwp has that bit in the flags set.
 > - instead of keeping l_sysent, keep l_sysmodflags or something.
 Just curious about any suggestions you might have for allocating the
 flag bit to be used....
 1. Seems to me we would need to keep a 32- or 64-bit mask for each
     syscall.  When a new request to sc_establish() comes in, we could
     calculate the logical-OR of all current bits, complement the
     result, and find-least-significant-bit-set.
 2. What do we do if we run out of bits?  Perhaps not too likely,
     but we would need to handle it.  What would be an appropriate
     value for sc_establish() to return if no bit is available?
 If everyone agrees on this approach
  	* replace l_sysent with a bitmask l_sc_bitmask,
  	* add complementary sy_bitmask to struct sysent (or just a
  	  short bit_number sy_mask_bitnum) to the syscall table, and
  	* have sc_disestablish() return an error if any active lwp
  	  has _ever_ called a related syscall)
 I can get started immediately on making this happen.
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at    |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at  |

Home | Main Index | Thread Index | Old Index