Home | History | Annotate | Line # | Download | only in roadmaps
mess revision 1.1
      1  1.1  dholland $NetBSD: mess,v 1.1 2017/01/13 10:14:58 dholland Exp $
      2  1.1  dholland 
      3  1.1  dholland NetBSD Messes and Tentacular Horrors Roadmap
      4  1.1  dholland ============================================
      5  1.1  dholland 
      6  1.1  dholland There are a number of places in NetBSD where the code is substandard,
      7  1.1  dholland or messy, or badly structured, or just excessively complicated. These
      8  1.1  dholland are liabilities. Fixing them is a goal, not just because they
      9  1.1  dholland themselves cause problems but because every pile of glop in the system
     10  1.1  dholland functions as an implicit excuse to not clean up others.
     11  1.1  dholland 
     12  1.1  dholland There are two kinds of these messes: with some, the consequences are
     13  1.1  dholland relatively localized, and while dealing with that particular area of
     14  1.1  dholland the code may be nasty the issues are otherwise mostly not visible.
     15  1.1  dholland With others, the horror spreads and contaminates everything that comes
     16  1.1  dholland near it. The latter are particularly important to clean out.
     17  1.1  dholland 
     18  1.1  dholland The things listed here are listed here because they have been cited as
     19  1.1  dholland problems; some of these are regularly cited as problems. The goal of
     20  1.1  dholland this file is not to criticize the code or point fingers (some of these
     21  1.1  dholland messes come down to us all the way from 4.3 and are the result of
     22  1.1  dholland always patching and never fixing; but some of them have been
     23  1.1  dholland self-inflicted because they seemed like a good idea at the time, or
     24  1.1  dholland they were what we had, or whatever) but to document areas that could
     25  1.1  dholland use a good rototill or two.
     26  1.1  dholland 
     27  1.1  dholland These are listed in a perceived order of priority based on how bad the
     28  1.1  dholland mess is, how toxic it is to things around it, how much it's
     29  1.1  dholland interfering with other development, and how unreliable the affected
     30  1.1  dholland code is as a result.
     31  1.1  dholland 
     32  1.1  dholland  1. namei, ufs_lookup, vfs_rename
     33  1.1  dholland  2. buffercache
     34  1.1  dholland  3. network interfaces
     35  1.1  dholland  4. mbufs
     36  1.1  dholland  5. tty code
     37  1.1  dholland  6. nsswitch code in libc
     38  1.1  dholland  7. proplib
     39  1.1  dholland  8. kauth
     40  1.1  dholland  9. sysmon_envsys
     41  1.1  dholland  10. atf
     42  1.1  dholland  11. pam
     43  1.1  dholland 	
     44  1.1  dholland 
     45  1.1  dholland Explanations
     46  1.1  dholland ============
     47  1.1  dholland 
     48  1.1  dholland 
     49  1.1  dholland 1. namei, ufs_lookup, vfs_rename
     50  1.1  dholland 
     51  1.1  dholland namei is central to everything and it's been horrible since at least
     52  1.1  dholland 4.3 and maybe longer. A fair amount of work has been put into it, and
     53  1.1  dholland a number of the particular horrors have been eliminated, but there's
     54  1.1  dholland still quite a bit left to do.
     55  1.1  dholland 
     56  1.1  dholland The immediate next step is to introduce VOP_PARSEPATH (a new VOP call
     57  1.1  dholland to allow the two filesystems we have that consume more than one
     58  1.1  dholland directory component at a time to do so in a more tractable way) and
     59  1.1  dholland then it's time to start implementing namei_parent, a version that
     60  1.1  dholland stops at the parent with one component name left to go. This will
     61  1.1  dholland allow a much saner interface to directory ops, including rename, and
     62  1.1  dholland once those are done a lot of the complexity currently in namei and in
     63  1.1  dholland the VOP_LOOKUP interface can be removed.
     64  1.1  dholland 
     65  1.1  dholland  - dholland is working on this intermittently.
     66  1.1  dholland  - VOP_PARSEPATH is ready to commit and is expected to make 8.0.
     67  1.1  dholland    There is currently no clear timeframe for anything beyond that.
     68  1.1  dholland  - Responsible: dholland
     69  1.1  dholland 
     70  1.1  dholland 
     71  1.1  dholland 2. buffercache
     72  1.1  dholland 
     73  1.1  dholland The buffercache code is messy and full of flag words that filesystems
     74  1.1  dholland muck with freely and not necessarily with correct locking. It is
     75  1.1  dholland suspected that there is a lot of incorrect locking. Also, a lot of the
     76  1.1  dholland naming and terminology (things like BO_DELWRI) is really ancient and
     77  1.1  dholland reflects non-current assumptions about the way file system buffers
     78  1.1  dholland should work.
     79  1.1  dholland 
     80  1.1  dholland  - As of January 2017 nobody is currently working on this.
     81  1.1  dholland  - There is currently no clear timeframe or release target.
     82  1.1  dholland  - Contact dholland for further information.
     83  1.1  dholland 
     84  1.1  dholland 
     85  1.1  dholland 3. network interfaces
     86  1.1  dholland 
     87  1.1  dholland The network interface structure and its associated support code has no
     88  1.1  dholland abstraction, no encapsulation, and no safety. It badly needs
     89  1.1  dholland rationalization.
     90  1.1  dholland 
     91  1.1  dholland  - As of January 2017 nobody is currently working on this directly,
     92  1.1  dholland    though some aspects fall under the multiprocessor network stack
     93  1.1  dholland    project.
     94  1.1  dholland  - There is currently no clear timeframe or release target.
     95  1.1  dholland  - Contact rmind for further information.
     96  1.1  dholland 
     97  1.1  dholland 
     98  1.1  dholland 4. mbufs
     99  1.1  dholland 
    100  1.1  dholland The mbuf code has some concept of an interface, but lots of the code
    101  1.1  dholland manipulating mbufs doesn't use that interface, and there's still no
    102  1.1  dholland encapsulation and no safety.
    103  1.1  dholland 
    104  1.1  dholland  - As of January 2017 nobody is currently working on this directly,
    105  1.1  dholland    though some aspects fall under the multiprocessor network stack
    106  1.1  dholland    project.
    107  1.1  dholland  - There is currently no clear timeframe or release target.
    108  1.1  dholland  - Contact rmind or dholland for further information.
    109  1.1  dholland 
    110  1.1  dholland 
    111  1.1  dholland 5. tty code
    112  1.1  dholland 
    113  1.1  dholland The tty subsystem has no concept of an interface at all, and there are
    114  1.1  dholland large wodges of code cutpasted all over everywhere in gazillions of
    115  1.1  dholland tty client drivers. There's no encapsulation either and absolutely no
    116  1.1  dholland safety. Furthermore the locking model is bodgy.
    117  1.1  dholland 
    118  1.1  dholland In addition to this the division of responsibility between "tty" and
    119  1.1  dholland "serial port" is wrong. There are a number of drivers (e.g. for mice)
    120  1.1  dholland that are partially ttys because they're things that are more or less
    121  1.1  dholland serial ports, but they were never meant to be used for logins and
    122  1.1  dholland can't be. These should be disentangled from the tty layer.
    123  1.1  dholland 
    124  1.1  dholland Finally, the notion of line disciplines is a legacy mess that ought to
    125  1.1  dholland get turned into a system of device attachments - a line discipline is
    126  1.1  dholland a driver attached on top of the line, except that the concept appeared
    127  1.1  dholland long before anyone really thought up device attachments as we know
    128  1.1  dholland them now.
    129  1.1  dholland 
    130  1.1  dholland  - As of January 2017 nobody is currently working on this.
    131  1.1  dholland  - There is currently no clear timeframe or release target.
    132  1.1  dholland  - Contact dholland for further information.
    133  1.1  dholland 
    134  1.1  dholland 
    135  1.1  dholland 6. nsswitch code in libc
    136  1.1  dholland 
    137  1.1  dholland The nsswitch code in libc is not all that bad in the sense of being
    138  1.1  dholland horrible code you lose sanity points to look at, but it's structured
    139  1.1  dholland all wrong. It can't be cleaned up without doing a libc bump, which is
    140  1.1  dholland a big deal, but if we do ever manage to get that libc bump done it's
    141  1.1  dholland important that the nsswitch code get revised then.
    142  1.1  dholland 
    143  1.1  dholland  - As of January 2017 nobody is currently working on this.
    144  1.1  dholland  - There is currently no clear timeframe or release target.
    145  1.1  dholland  - Contact dholland or joerg for further information.
    146  1.1  dholland 
    147  1.1  dholland 
    148  1.1  dholland 7. proplib
    149  1.1  dholland 
    150  1.1  dholland Removal of proplib is and has been a goal of several developers for
    151  1.1  dholland some time, but there's not been any consensus on a replacement. Much
    152  1.1  dholland has been written on this elsewhere so I'm not going to repeat it all
    153  1.1  dholland here.
    154  1.1  dholland 
    155  1.1  dholland  - As of January 2017 nobody is currently working on this, but several
    156  1.1  dholland    partly-finished proplib replacement candidates exist.
    157  1.1  dholland  - There is currently no clear timeframe or release target.
    158  1.1  dholland  - Contact dholland, rmind, riastradh, or any of a number of other
    159  1.1  dholland    people for further information.
    160  1.1  dholland 
    161  1.1  dholland 
    162  1.1  dholland 8. kauth
    163  1.1  dholland 
    164  1.1  dholland kauth is far too complicated for security code and its API is full of
    165  1.1  dholland void pointers and horribly unsafe. There is no consensus on what to do
    166  1.1  dholland about it, though. Part of the problem is that kauth itself is at least
    167  1.1  dholland three different things that need to be disentangled: (a) an API for
    168  1.1  dholland random kernel code to issue security checks; (b) an implementation of
    169  1.1  dholland security check logic; and (c) an extensibility framework for that
    170  1.1  dholland security check logic.
    171  1.1  dholland 
    172  1.1  dholland  - As of January 2017 nobody is currently working on this.
    173  1.1  dholland  - There is currently no clear timeframe or release target.
    174  1.1  dholland  - Contact dholland for further information.
    175  1.1  dholland 
    176  1.1  dholland 
    177  1.1  dholland 9. sysmon_envsys
    178  1.1  dholland 
    179  1.1  dholland sysmon_envsys is also too complicated. XXX: someone fill in more here
    180  1.1  dholland please.
    181  1.1  dholland 
    182  1.1  dholland  - As of January 2017 nobody is currently working on this.
    183  1.1  dholland  - There is currently no clear timeframe or release target.
    184  1.1  dholland  - Contact: ? (XXX)
    185  1.1  dholland 
    186  1.1  dholland 
    187  1.1  dholland 10. atf
    188  1.1  dholland 
    189  1.1  dholland atf is horribly complicated and very expensive (apparently it takes
    190  1.1  dholland all day to compile just atf on an sgimips) and doesn't provide a whole
    191  1.1  dholland lot of bang for the buck. It is also frequently cited as an impediment
    192  1.1  dholland to getting new tests written and deployed. It is not at all clear what
    193  1.1  dholland to do about it.
    194  1.1  dholland 
    195  1.1  dholland  - As of January 2017 nobody is currently working on this.
    196  1.1  dholland  - There is currently no clear timeframe or release target.
    197  1.1  dholland  - Contact: ? (XXX)
    198  1.1  dholland 
    199  1.1  dholland 
    200  1.1  dholland 11. pam
    201  1.1  dholland 
    202  1.1  dholland pam, though a more or less standard API/interface, has a range of
    203  1.1  dholland problems, one being that after the manner of sysvinit it works by
    204  1.1  dholland exposing a mechanism and you configure it by mucking with the
    205  1.1  dholland mechanism until it produces the behavior you want. (Except that if you
    206  1.1  dholland muck with its mechanism, you end up locking yourself out.) In practice
    207  1.1  dholland editing pam configs seems to be limited to specialists, and that's
    208  1.1  dholland really not suitable for security software.
    209  1.1  dholland 
    210  1.1  dholland It is very unclear what to do about it though. It's a standard API and
    211  1.1  dholland there are a number of 3rd-party pam modules, some of which people need
    212  1.1  dholland to be able to use. Once upon a time there was a similar thing called
    213  1.1  dholland bsdauth, but it never really seems to have been a credible alternative.  
    214  1.1  dholland Probably the right thing to do is to completely redesign
    215  1.1  dholland how logging in works, but that's a Big Deal.
    216  1.1  dholland 
    217  1.1  dholland  - As of January 2017 nobody is currently working on this.
    218  1.1  dholland  - There is currently no clear timeframe or release target.
    219  1.1  dholland  - Contact: ? (XXX)
    220