tech-kern archive

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

Re: increasing sysv semaphore limits



Jörg Sonnenberger <joerg%bec.de@localhost> writes:

> On 7/16/26 12:23 AM, Jason Thorpe wrote:
>> 
>>> On Jul 15, 2026, at 2:58 PM, Mouse <mouse%rodents-montreal.org@localhost> wrote:
>>>
>>> Except doesn't that open you up to a DoS attack, running the kernel out
>>> of memory by creating a zillion semaphores?
>> I mean, it’s really the same thing as with file descriptors.
>
> Yes and no. SYSV semaphores are persistent and independent of both
> file descriptors and processes. So even killing processes is not going
> to return the memory used by them.

Sure, but if they were fully dynamic, and limit were set to say 2048
semaphors, that would likely not cause real trouble, beyond the kinds of
trouble programs can cause now.

> PS: the real question would IMO be why PG is still using SYSV
> semaphores in first place.

That is a good question.   My guess is that it's because nobody flipped
the define in the pgsql sources to use POSIX semaphores instead on
NetBSD and then tested.

Do you believe that our POSIX semaphore implementation is 100% solidly
correct?  (A genuine question - I would hope so, but I have no idea, and
I don't hear about them.)


Home | Main Index | Thread Index | Old Index