bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix overflow in jobs


From: Chet Ramey
Subject: Re: [PATCH] Fix overflow in jobs
Date: Wed, 7 Feb 2018 15:30:14 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2/7/18 1:51 PM, Natanael Copa wrote:
> Hi,
> 
> On Fri, 8 Dec 2017 08:04:00 -0500
> Chet Ramey <chet.ramey@case.edu> wrote:
> 
>> On 12/7/17 5:36 PM, Natanael Copa wrote:
>>> This fixes an issue with bash hanging if user process rlimit is too
>>> high.  
>>
>> Thanks for the report.
>>
> 
> Unfortunately, the proposed patch does not fix the case for 32 bit
> architectures.

That's interesting. It seems to me that the kernel should reject attempts
to set the maximum number of processes larger than 2**(sizeof (pid_t)).

> 
> The bug was introduced with commit a0c0a00f[1].
> 
> I think the proper fix may be re-enable the js.c_childmax capping. What
> do you think?

That's the wrong place. If your original patch identifies the issue
correctly, we need to bound the size of bgpids.storage to something a
pid_t (aliased to ps_index_t) variable can address.

So instead of using js.c_childmax directly, we compute the maximum
table size using js.c_childmax unless it exceeds TYPE_MAXIMUM(pid_t).

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]