Skip to contentSkip to conversation

arm64: Expose original FAR_EL1 value in sigcontext

PATCH Superseded Peter Collingbourne 6 participants 63 messages Mar 12, 2020 – Aug 18, 2020 2 messages not in the archive Page 2 of 2

Subsystems (6)
lore
Share & tools
lore
maintainer
#59 lore raw
In reply to Catalin Marinas
Quoted 22 lines · Catalin Marinas
Quoted 21 lines · Will Deacon
Quoted 19 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

Quoted 8 lines
Quoted 3 lines

Hmm, although the code looks fine, why don't we just expose the tag in the new field, rather than duplicate the address information? I'm nervous about exposing privileged registers directly to userspace.

That's for consistency with ESR_EL1 which we expose in a similar way, though with bits of it not relevant to user masked out. For FAR_EL1, all the bits are relevant, even if some of them are duplicated in the si_addr field.

It may be consistent, but I would argue that exposing ESR_EL1 was a mistake, as illustrated by cc19846079a7 ("arm64: fault: Don't leak data in ESR context for user fault on kernel VA"). We have to live with that, but we should try to do better for new fields in the sigcontext.

Quoted 6 lines
Quoted 3 lines

Also, Catalin, could you elaborate on the MTE use-case please? The architecture says that FAR_EL1[63:60] are UNKNOWN on a synchronous tag check fault, so we'd have to *avoid* exposing them in that case!

With MTE, FAR_EL1[63:60] will be cleared on sync tag check faults (not currently done as I don't have this patch in my MTE series).

Ok, but in [1] you said "I'm fine with this change for consistency and may help with the fault information printed by the kernel with khwasan or (later) MTE."

But I don't think consistency is necessarily a good thing here and I don't see how it helps with MTE if we zap the bits to 0! We'd be better off not exposing the information at all in this situation.

Will

[1] https://lore.kernel.org/r/20200325131023.GN3901@mbp

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#60 lore raw
Quoted 32 lines · Will Deacon
Quoted 22 lines · Catalin Marinas
Quoted 21 lines · Will Deacon
Quoted 19 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

Quoted 8 lines
Quoted 3 lines

Hmm, although the code looks fine, why don't we just expose the tag in the new field, rather than duplicate the address information? I'm nervous about exposing privileged registers directly to userspace.

That's for consistency with ESR_EL1 which we expose in a similar way, though with bits of it not relevant to user masked out. For FAR_EL1, all the bits are relevant, even if some of them are duplicated in the si_addr field.

Quoted 4 lines

It may be consistent, but I would argue that exposing ESR_EL1 was a mistake, as illustrated by cc19846079a7 ("arm64: fault: Don't leak data in ESR context for user fault on kernel VA"). We have to live with that, but we should try to do better for new fields in the sigcontext.

The alternative would be to only expose the tag of the faulting address if you are worried of leaking some kernel address from FAR_EL1 (and I agree, there is a risk).

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

Also, Catalin, could you elaborate on the MTE use-case please? The architecture says that FAR_EL1[63:60] are UNKNOWN on a synchronous tag check fault, so we'd have to *avoid* exposing them in that case!

With MTE, FAR_EL1[63:60] will be cleared on sync tag check faults (not currently done as I don't have this patch in my MTE series).

Quoted 7 lines

Ok, but in [1] you said "I'm fine with this change for consistency and may help with the fault information printed by the kernel with khwasan or (later) MTE."

But I don't think consistency is necessarily a good thing here and I don't see how it helps with MTE if we zap the bits to 0! We'd be better off not exposing the information at all in this situation.

The plan for MTE is to only zap bits 63:60 which are unknown on tag check fault. The actual MTE tag in 59:56 would be preserved. There is an inconsistency with the TBI feature but that only happens for tag check faults which is a new thing. The behaviour on any other fault will be consistent with the non-MTE case (page faults etc.).

Signature · 6 lines
Catalin

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#61 lore raw
In reply to Peter Collingbourne
Quoted 32 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

v2:
- revert changes to hw_breakpoint.c
- rename set_thread_esr to set_thread_far_esr

 Documentation/arm64/tagged-pointers.rst  | 17 +++++----
 arch/arm64/include/asm/exception.h       |  2 +-
 arch/arm64/include/asm/processor.h       |  2 +-
 arch/arm64/include/uapi/asm/sigcontext.h | 21 +++++++----
 arch/arm64/kernel/entry-common.c         |  2 --
 arch/arm64/kernel/signal.c               | 20 ++++++++++-
 arch/arm64/mm/fault.c                    | 45 ++++++++++++++----------
 7 files changed, 74 insertions(+), 35 deletions(-)

[...]

Quoted 36 lines
arch/arm64/include/uapi/asm/sigcontext.h +10 -1
index 8b0ebce92427..6782394633cb 100644
@@ -44,11 +44,12 @@ struct sigcontext {
  *
  *	0x210		fpsimd_context
  *	 0x10		esr_context
+ *	 0x10		far_context
  *	0x8a0		sve_context (vl <= 64) (optional)
  *	 0x20		extra_context (optional)
  *	 0x10		terminator (null _aarch64_ctx)
  *
- *	0x510		(reserved for future allocation)
+ *	0x500		(reserved for future allocation)
  *
  * New records that can exceed this space need to be opt-in for userspace, so
  * that an expanded signal frame is not generated unexpectedly.  The mechanism
@@ -94,17 +95,25 @@ struct esr_context {
 	__u64 esr;
 };
 
+/* FAR_EL1 context */
+#define FAR_MAGIC	0x46415201
+
+struct far_context {
+	struct _aarch64_ctx head;
+	__u64 far;
+};
+
 /*
  * extra_context: describes extra space in the signal frame for
  * additional structures that don't fit in sigcontext.__reserved[].
  *
  * Note:
  *

arch/arm64/include/uapi/asm/sigcontext.h struct esr_context { · line 116

Quoted 10 lines
arch/arm64/include/uapi/asm/sigcontext.h +5 -5
- * 1) fpsimd_context, esr_context and extra_context must be placed in
- * sigcontext.__reserved[] if present.  They cannot be placed in the
- * extra space.  Any other record can be placed either in the extra
- * space or in sigcontext.__reserved[], unless otherwise specified in
- * this file.
+ * 1) fpsimd_context, esr_context, far_context and extra_context must be
+ * placed in sigcontext.__reserved[] if present.  They cannot be placed
+ * in the extra space.  Any other record can be placed either in the
+ * extra space or in sigcontext.__reserved[], unless otherwise specified
+ * in this file.

This is for backwards compatibility only. We don't need this constraint for any new field, so you can probably leave the paragraph as-is.

Removing this would mean constraint would mean that userspace must be prepared to traverse extra_context when looking for far_context. But really we want modern userspace to do this anyway, since it reduces backwards compatibilty worries when adding more new records in the future.

The nasty loop in parse_user_sigframe() allows some flexibility regarding the order of records, but prior to this patch there is no record that can be actually be moved, due to other backwards compatibility constraints -- so the flexibility isn't used today. I'd like to avoid reorderability creeping in, so that we can get rid of the loop.

So, mandating that records must be in a consistent order to sigcontext.h could be helpful. inserting new records in the middle should be fine, so long as there is no shuffling.

I'm not sure this patch needs to do anything extra for that: perhaps we can leave this no-shuffling rule implicit for now (?)

People already get shouted at for needslessly noisy diffs, so there is a strong disincentive to shuffle existing headers in any case...

[...]

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#62 lore raw
Quoted 87 lines · Dave Martin
Quoted 32 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

v2:
- revert changes to hw_breakpoint.c
- rename set_thread_esr to set_thread_far_esr

 Documentation/arm64/tagged-pointers.rst  | 17 +++++----
 arch/arm64/include/asm/exception.h       |  2 +-
 arch/arm64/include/asm/processor.h       |  2 +-
 arch/arm64/include/uapi/asm/sigcontext.h | 21 +++++++----
 arch/arm64/kernel/entry-common.c         |  2 --
 arch/arm64/kernel/signal.c               | 20 ++++++++++-
 arch/arm64/mm/fault.c                    | 45 ++++++++++++++----------
 7 files changed, 74 insertions(+), 35 deletions(-)

[...]

Quoted 36 lines
arch/arm64/include/uapi/asm/sigcontext.h +10 -1
index 8b0ebce92427..6782394633cb 100644
@@ -44,11 +44,12 @@ struct sigcontext {
  *
  *   0x210           fpsimd_context
  *    0x10           esr_context
+ *    0x10           far_context
  *   0x8a0           sve_context (vl <= 64) (optional)
  *    0x20           extra_context (optional)
  *    0x10           terminator (null _aarch64_ctx)
  *
- *   0x510           (reserved for future allocation)
+ *   0x500           (reserved for future allocation)
  *
  * New records that can exceed this space need to be opt-in for userspace, so
  * that an expanded signal frame is not generated unexpectedly.  The mechanism
@@ -94,17 +95,25 @@ struct esr_context {
      __u64 esr;
 };
 
+/* FAR_EL1 context */
+#define FAR_MAGIC    0x46415201
+
+struct far_context {
+     struct _aarch64_ctx head;
+     __u64 far;
+};
+
 /*
  * extra_context: describes extra space in the signal frame for
  * additional structures that don't fit in sigcontext.__reserved[].
  *
  * Note:
  *

arch/arm64/include/uapi/asm/sigcontext.h struct esr_context { · line 116

Quoted 10 lines
arch/arm64/include/uapi/asm/sigcontext.h +5 -5
- * 1) fpsimd_context, esr_context and extra_context must be placed in
- * sigcontext.__reserved[] if present.  They cannot be placed in the
- * extra space.  Any other record can be placed either in the extra
- * space or in sigcontext.__reserved[], unless otherwise specified in
- * this file.
+ * 1) fpsimd_context, esr_context, far_context and extra_context must be
+ * placed in sigcontext.__reserved[] if present.  They cannot be placed
+ * in the extra space.  Any other record can be placed either in the
+ * extra space or in sigcontext.__reserved[], unless otherwise specified
+ * in this file.

This is for backwards compatibility only. We don't need this constraint for any new field, so you can probably leave the paragraph as-is.

Quoted 5 lines

Removing this would mean constraint would mean that userspace must be prepared to traverse extra_context when looking for far_context. But really we want modern userspace to do this anyway, since it reduces backwards compatibilty worries when adding more new records in the future.

My original reason for updating this comment was that I figured that this record was small enough that we could just always include it in __reserved.

But thinking about this a bit more, it doesn't seem that just wanting userspace to read extra_context will guarantee that it will do so. In practice, it would be easy to write userspace code that works right now but doesn't read extra_context correctly (either because extra_context wasn't considered at all, or because the code purporting to read the record from extra_context contains a latent bug because it wasn't exercised). Since we may be practically constrained from moving the record anyway, we might as well document it and allow the userspace code to be a little simpler.

I guess one alternative is that we always place this record in extra_context, which would force userspace to read it correctly. That has something of the opposite problem (userspace code could be written to only expect the record in extra_context), but at least we're less constrained there, and it's more likely that the code would be parsing __reserved correctly since it would need to do so in order to find extra_context.

Anyway, I've reverted the comment change for now in v4, but let me know what you think.

Peter

Quoted 16 lines

The nasty loop in parse_user_sigframe() allows some flexibility regarding the order of records, but prior to this patch there is no record that can be actually be moved, due to other backwards compatibility constraints -- so the flexibility isn't used today. I'd like to avoid reorderability creeping in, so that we can get rid of the loop.

So, mandating that records must be in a consistent order to sigcontext.h could be helpful. inserting new records in the middle should be fine, so long as there is no shuffling.

I'm not sure this patch needs to do anything extra for that: perhaps we can leave this no-shuffling rule implicit for now (?)

Quoted 7 lines

People already get shouted at for needslessly noisy diffs, so there is a strong disincentive to shuffle existing headers in any case...

[...]

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#63 lore raw
Quoted 116 lines · Peter Collingbourne
Quoted 87 lines · Dave Martin
Quoted 32 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

v2:
- revert changes to hw_breakpoint.c
- rename set_thread_esr to set_thread_far_esr

 Documentation/arm64/tagged-pointers.rst  | 17 +++++----
 arch/arm64/include/asm/exception.h       |  2 +-
 arch/arm64/include/asm/processor.h       |  2 +-
 arch/arm64/include/uapi/asm/sigcontext.h | 21 +++++++----
 arch/arm64/kernel/entry-common.c         |  2 --
 arch/arm64/kernel/signal.c               | 20 ++++++++++-
 arch/arm64/mm/fault.c                    | 45 ++++++++++++++----------
 7 files changed, 74 insertions(+), 35 deletions(-)

[...]

Quoted 36 lines
arch/arm64/include/uapi/asm/sigcontext.h +10 -1
index 8b0ebce92427..6782394633cb 100644
@@ -44,11 +44,12 @@ struct sigcontext {
  *
  *   0x210           fpsimd_context
  *    0x10           esr_context
+ *    0x10           far_context
  *   0x8a0           sve_context (vl <= 64) (optional)
  *    0x20           extra_context (optional)
  *    0x10           terminator (null _aarch64_ctx)
  *
- *   0x510           (reserved for future allocation)
+ *   0x500           (reserved for future allocation)
  *
  * New records that can exceed this space need to be opt-in for userspace, so
  * that an expanded signal frame is not generated unexpectedly.  The mechanism
@@ -94,17 +95,25 @@ struct esr_context {
      __u64 esr;
 };
 
+/* FAR_EL1 context */
+#define FAR_MAGIC    0x46415201
+
+struct far_context {
+     struct _aarch64_ctx head;
+     __u64 far;
+};
+
 /*
  * extra_context: describes extra space in the signal frame for
  * additional structures that don't fit in sigcontext.__reserved[].
  *
  * Note:
  *

arch/arm64/include/uapi/asm/sigcontext.h struct esr_context { · line 116

Quoted 10 lines
arch/arm64/include/uapi/asm/sigcontext.h +5 -5
- * 1) fpsimd_context, esr_context and extra_context must be placed in
- * sigcontext.__reserved[] if present.  They cannot be placed in the
- * extra space.  Any other record can be placed either in the extra
- * space or in sigcontext.__reserved[], unless otherwise specified in
- * this file.
+ * 1) fpsimd_context, esr_context, far_context and extra_context must be
+ * placed in sigcontext.__reserved[] if present.  They cannot be placed
+ * in the extra space.  Any other record can be placed either in the
+ * extra space or in sigcontext.__reserved[], unless otherwise specified
+ * in this file.

This is for backwards compatibility only. We don't need this constraint for any new field, so you can probably leave the paragraph as-is.

Quoted 5 lines

Removing this would mean constraint would mean that userspace must be prepared to traverse extra_context when looking for far_context. But really we want modern userspace to do this anyway, since it reduces backwards compatibilty worries when adding more new records in the future.

My original reason for updating this comment was that I figured that this record was small enough that we could just always include it in __reserved.

But thinking about this a bit more, it doesn't seem that just wanting userspace to read extra_context will guarantee that it will do so. In practice, it would be easy to write userspace code that works right now but doesn't read extra_context correctly (either because extra_context wasn't considered at all, or because the code purporting to read the record from extra_context contains a latent bug because it wasn't exercised). Since we may be practically constrained from moving the record anyway, we might as well document it and allow the userspace code to be a little simpler.

I guess one alternative is that we always place this record in extra_context, which would force userspace to read it correctly. That has something of the opposite problem (userspace code could be written to only expect the record in extra_context), but at least we're less constrained there, and it's more likely that the code would be parsing __reserved correctly since it would need to do so in order to find extra_context.

Quoted 2 lines

Anyway, I've reverted the comment change for now in v4, but let me know what you think.

Apologies for the delay in responding -- I think it does make sense to reserve space in __reserved[] for the new record, the the location you suggested for it is sensible.

__reserved[] is a scarce resource, and should only be burned on "small" records, but far_context is small.

here's another reason too, which is that we don't want to needlessly block new software from using this field without allocating larger stacks -- not least because they just won't, and the problem won't bite them until much later.

Hope that helps clarify things.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#64 lore raw
Quoted 129 lines · Dave Martin
Quoted 116 lines · Peter Collingbourne
Quoted 87 lines · Dave Martin
Quoted 32 lines · Peter Collingbourne

The kernel currently clears the tag bits (i.e. bits 56-63) in the fault address exposed via siginfo.si_addr and sigcontext.fault_address. However, the tag bits may be needed by tools in order to accurately diagnose memory errors, such as HWASan [1] or future tools based on the Memory Tagging Extension (MTE).

We should not stop clearing these bits in the existing fault address fields, because there may be existing userspace applications that are expecting the tag bits to be cleared. Instead, create a far_context in sigcontext (similar to the existing esr_context), and store the original value of FAR_EL1 (including the tag bits) there.

[1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html

---
v3:
- add documentation to tagged-pointers.rst
- update comments in sigcontext.h

v2:
- revert changes to hw_breakpoint.c
- rename set_thread_esr to set_thread_far_esr

 Documentation/arm64/tagged-pointers.rst  | 17 +++++----
 arch/arm64/include/asm/exception.h       |  2 +-
 arch/arm64/include/asm/processor.h       |  2 +-
 arch/arm64/include/uapi/asm/sigcontext.h | 21 +++++++----
 arch/arm64/kernel/entry-common.c         |  2 --
 arch/arm64/kernel/signal.c               | 20 ++++++++++-
 arch/arm64/mm/fault.c                    | 45 ++++++++++++++----------
 7 files changed, 74 insertions(+), 35 deletions(-)

[...]

Quoted 36 lines
arch/arm64/include/uapi/asm/sigcontext.h +10 -1
index 8b0ebce92427..6782394633cb 100644
@@ -44,11 +44,12 @@ struct sigcontext {
  *
  *   0x210           fpsimd_context
  *    0x10           esr_context
+ *    0x10           far_context
  *   0x8a0           sve_context (vl <= 64) (optional)
  *    0x20           extra_context (optional)
  *    0x10           terminator (null _aarch64_ctx)
  *
- *   0x510           (reserved for future allocation)
+ *   0x500           (reserved for future allocation)
  *
  * New records that can exceed this space need to be opt-in for userspace, so
  * that an expanded signal frame is not generated unexpectedly.  The mechanism
@@ -94,17 +95,25 @@ struct esr_context {
      __u64 esr;
 };
 
+/* FAR_EL1 context */
+#define FAR_MAGIC    0x46415201
+
+struct far_context {
+     struct _aarch64_ctx head;
+     __u64 far;
+};
+
 /*
  * extra_context: describes extra space in the signal frame for
  * additional structures that don't fit in sigcontext.__reserved[].
  *
  * Note:
  *

arch/arm64/include/uapi/asm/sigcontext.h struct esr_context { · line 116

Quoted 10 lines
arch/arm64/include/uapi/asm/sigcontext.h +5 -5
- * 1) fpsimd_context, esr_context and extra_context must be placed in
- * sigcontext.__reserved[] if present.  They cannot be placed in the
- * extra space.  Any other record can be placed either in the extra
- * space or in sigcontext.__reserved[], unless otherwise specified in
- * this file.
+ * 1) fpsimd_context, esr_context, far_context and extra_context must be
+ * placed in sigcontext.__reserved[] if present.  They cannot be placed
+ * in the extra space.  Any other record can be placed either in the
+ * extra space or in sigcontext.__reserved[], unless otherwise specified
+ * in this file.

This is for backwards compatibility only. We don't need this constraint for any new field, so you can probably leave the paragraph as-is.

Quoted 5 lines

Removing this would mean constraint would mean that userspace must be prepared to traverse extra_context when looking for far_context. But really we want modern userspace to do this anyway, since it reduces backwards compatibilty worries when adding more new records in the future.

My original reason for updating this comment was that I figured that this record was small enough that we could just always include it in __reserved.

But thinking about this a bit more, it doesn't seem that just wanting userspace to read extra_context will guarantee that it will do so. In practice, it would be easy to write userspace code that works right now but doesn't read extra_context correctly (either because extra_context wasn't considered at all, or because the code purporting to read the record from extra_context contains a latent bug because it wasn't exercised). Since we may be practically constrained from moving the record anyway, we might as well document it and allow the userspace code to be a little simpler.

I guess one alternative is that we always place this record in extra_context, which would force userspace to read it correctly. That has something of the opposite problem (userspace code could be written to only expect the record in extra_context), but at least we're less constrained there, and it's more likely that the code would be parsing __reserved correctly since it would need to do so in order to find extra_context.

Quoted 2 lines

Anyway, I've reverted the comment change for now in v4, but let me know what you think.

Apologies for the delay in responding -- I think it does make sense to reserve space in __reserved[] for the new record, the the location you suggested for it is sensible.

__reserved[] is a scarce resource, and should only be burned on "small" records, but far_context is small.

Quoted 7 lines

here's another reason too, which is that we don't want to needlessly block new software from using this field without allocating larger stacks -- not least because they just won't, and the problem won't bite them until much later.

Hope that helps clarify things.

Thanks, that makes sense. I will send a v6 with the comment brought back.

Peter

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel