LWN: Comments on "KPortReserve and the multi-LSM problem" https://lwn.net/Articles/563178/ This is a special feed containing comments posted to the individual LWN article titled "KPortReserve and the multi-LSM problem". en-us Sat, 08 Nov 2025 10:57:05 +0000 Sat, 08 Nov 2025 10:57:05 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net KPortReserve and the multi-LSM problem https://lwn.net/Articles/564227/ https://lwn.net/Articles/564227/ mstone_ <div class="FormattedComment"> The reason for the restriction on low numbered ports doesn't have anything to do with "importance", it has to do with a simple mechanism to verify that a particular connection originated from a privileged process (assuming a trusted network). This is extremely important in, e.g., an old-school NFS environment, as the use of the privileged port is the only thing that prevents unprivileged users from making privileged connections to the NFS server. The same sort of model was used for rsh and some other protocols.<br> <p> Obviously, in the modern world you'd want to depend on some sort of strong authentication rather than origin port, especially if you're on a trusted network which mixes traditional unix systems with other systems which don't enforce privileged ports or any untrusted network. Nevertheless, as long as people use linux to interoperate with legacy environments it's useful to retain this now-obsolete functionality. It's also useful to understand this model if you run a legacy NFS environment--I've even seen some vendors who have forgotten, and shipped NFS configurations which permitted any user on an NFS client to read any file on an NFS server (scary, and exploited). And if you create any new protocol which depends on this property, you're an idiot. :)<br> </div> Wed, 21 Aug 2013 15:58:39 +0000 KPortReserve and program-name based port assignments https://lwn.net/Articles/563755/ https://lwn.net/Articles/563755/ giraffedata <p> He sure didn't make his point that making permissions based on the program is better than making them based on the uid (or anything else). <p> I should be able to run 10 web servers all running Apache, with each entitled to its own unique port. If I have to vary some attribute to give them different port permissions, I'd much rather give the processes different uids than give Apache different names. <p> I find altogether too much conflating of programs with services. <p> And I especially didn't get why being 21st century thinking makes it bad. Fri, 16 Aug 2013 22:34:57 +0000 unprivileged access to reserved network ports https://lwn.net/Articles/563752/ https://lwn.net/Articles/563752/ giraffedata <blockquote> i.e. given users can bind to low ports. Mail servers, web server, dns server, need not run as root even for an instant. Just startup and bind to their standard port. No dropping permissions, ... </blockquote> <p> I suppose it's because people think something based on a superuser process is more consistent with Unix overall, more flexible, less work, etc. I do. <p> Other operating systems were designed to have a variety of permission lists, for a variety of fixed kinds of permissions, which is what you're describing, but Unix designers thought it was superior just to have one basic permission: superuser. Coupled with the setuid flag, that meant application developers could implement an unimaginable variety of permission schemes just by writing code. <p> In retrospect, we know that that flexibility creates no end of opportunity for accidentally granting too much permission, but the engineering simplicity of it is still appealing. <p> I personally don't like having a server program drop permissions because it means I have to trust the program to drop the permissions, and have duplicate code in every server program. But I do a similar thing where a single program dedicated to binding ports binds the port, drops permissions, then execs the server program (actually, teh binder execs a program that sets permissions and that program execs the server program). <p> That port binder program could easily be setuid superuser and consult a file such as you propose, but I haven't found that maintaining such a file would be preferable to maintaining the scripts that invoke it, which contain the same information. Fri, 16 Aug 2013 22:28:10 +0000 KPortReserve and the multi-LSM problem https://lwn.net/Articles/563593/ https://lwn.net/Articles/563593/ jwarnica <div class="FormattedComment"> It isn't entirely related to this, and its not clear if this would solve my oft-pondered "WTF doesn't this exist"?<br> <p> &lt;=1024 is reserved, based on historical reasons, for root-executed processes. Allegedly, this is because important things run &lt;=1024 and non-important things don't, and this hysterical, er, historical, conclusion fails to pass any sniff test of sanity. There are lots of hosts out their with out any meaningful concept of users; with more granularity in their admin/not distinctions than unix; or less (including Linux appliances that run everything as root)<br> <p> So taking some widely used apps, with their own user id's, why _isn't_ there a file thus:<br> <p> /etc/portsec<br> 25:smtp<br> 53:named<br> 80:wwwrun<br> 631:cups<br> <p> i.e. given users can bind to low ports. Mail servers, web server, dns server, need not run as root even for an instant. Just startup and bind to their standard port. No dropping permissions, no master socket listener waiting to pass things off to a low privilege thread. Just run as whoever and bind to what you are allowed to (at least for &lt;=1024).<br> <p> </div> Thu, 15 Aug 2013 22:25:49 +0000