[Toybox] [PATCH] losetup: fix the race.

Rob Landley rob at landley.net
Fri Aug 9 04:38:38 PDT 2019


On 8/9/19 5:45 AM, Rob Landley wrote:
> So it's not /etc/passwd we're clashing on, it's two calls to /dev/loop-control
> returning the same loop device and one of them claiming it, and the other
> getting -EBUSY. And THAT means what we need to do is detect EBUSY and loop back
> around to loop-control and request another one from that, because ANYBODY on the
> system could do this, it's a shared resource with a global namespace.

Ah, hadn't made it to the end and noticed the last hunk putting a loop around
the caller. Hmmm... Not what I would have done but ok, that works.

Still need to check that the #defines are available in 14.04 when I get home though.

Rob



More information about the Toybox mailing list