On Thu, Jul 25, 2013 at 4:08 AM, Ilya Enkovich <enkovich....@gmail.com> wrote: > 2013/7/25 Ian Lance Taylor <i...@google.com>: >> On Wed, Jul 24, 2013 at 4:36 PM, Roland McGrath <rol...@hack.frob.com> wrote: >>> >>> Will an MPX-using binary require an MPX-supporting dynamic linker to run >>> correctly? >>> >>> * An old dynamic linker won't clobber %bndN directly, so that's not a >>> problem. >> >> These are my answers and likely incorrect. > > Hi, > > I want add some comments to your answers. > >> >> It will clobber the registers indirectly, though, as soon as it >> executes a branching instruction. The effect will be that calls from >> bnd-checked code to bnd-checked code through the dynamic linker will >> not succeed. > > I would not say that call will fail. Some bound info will just be > lost. MPX binaries should still work correctly with old dynamic > linker. The problem here is that when you decrease level of MPX > support (use legacy dynamic linker, and legacy libraries) you decrease > a quality of bound violation detection. BTW if new PLT section is used > then table fixup after the first call will lead to correct bounds > transfer in subsequent calls.
To make it clear, the sequence is MPX code -> PLT -> ld.so -> PLT -> MPX library If ld.so doesn't preserve bound registers, bound registers will be cleared, which means the lower bound is 0 and upper bound is -1 (MAX), when MPX library is reached. The MPX library will work correctly, but without MPX protections on pointers passed in registers. -- H.J.