This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: FW: [PATCH V5 1/2] Initialize bnd register before performing inferior calls.



Walfred Tedeschi <walfred.tedeschi@intel.com> writes:

BND registers should be initialized before performing an inferior call
to avoid undesired bound violations.

What are the undesired bound violations?  Do have an example?

Resetting BND registers in the inferior call isn't right to me, the BND setting isn't in effect in the inferior call. If the function can trigger bound violations, it is expected that it still can trigger violations in the inferior call.

--
yao (éå)

Yao,

Thanks a lot for your quick review! :)

That is true, but not unattended. In case BND registers are not set to init state the current context value will be used for the inferior call.
Causing with a higher chance a BND violation.

The question is was that intended by the user? Likely not.

Also it will invalidate the inferior call usage. The inferior call will finish before returning the result back to the user.

In any case the user can still set the values and examine a bound violation and the its causes by setting the BND registers by stopping at the prologue of the function being called.

Have i answered your question?

Best regards,
-Fred

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]