Skip to content

(Was: Fix a race in pid generation that causes pids to be reused immediately.)

Oleg Nesterov lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1pids: alloc_pidmap: remove the unnecessary boundary checkskernel/pid.c+7 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] (Was: Fix a race in pid generation that causes pids to be reused immediately.)
Quoted 3 lines · Salman

A program that repeatedly forks and waits is susceptible to having the same pid repeated,

I agree this patch should fix this.

But the kernel still can use the same pid twice in a row, I am wondering if there a simple solution to prevent this. Probably not, and this case is unlikely.

While we are here, and given that many reviewers recently inspected alloc_pidmap(), probably someone can explain the mysterious checks in do/while loop ?

See the patch I am going to send, it is on top on Salman's fix but doesn't really depend on it.

Oleg.