uaccess: Add mechanism for key checked access to user memory
Subsystems (2)
cover uaccess: Add mechanism for key checked access to user memory
Something like this patch series is required as part of KVM supporting storage keys on s390.
See https://lore.kernel.org/kvm/[email protected]/
On s390 each physical page is associated with 4 access control bits. On access, these are compared with an access key, which is either provided by the instruction or taken from the CPU state. Based on that comparison, the access either succeeds or is prevented.
KVM on s390 needs to be able emulate this behavior, for example during instruction emulation, when it makes accesses on behalf of the guest. In order to do that, we need variants of __copy_from/to_user that pass along an access key to the architecture specific implementation of __copy_from/to_user. That is the only difference, variants do the same might_fault(), instrument_copy_to_user(), etc. calls as the normal functions do and need to be kept in sync with those.
If these __copy_from/to_user_key functions were to be maintained in architecture specific code they would be prone to going out of sync with their non key counterparts if there were code changes. So, instead, add these variants to include/linux/uaccess.h.
Considerations:
* The key argument is an unsigned long, in order to make the functions less specific to s390, which would only need an u8.
This could also be generalized further, i.e. by having the type be defined by the architecture, with the default being a struct without any members.
Also the functions could be renamed ..._opaque, ..._arg, or similar.
* Which functions do we provide _key variants for? Just defining __copy_from/to_user_key would make it rather specific to our use case.
* Should ...copy_from/to_user_key functions be callable from common code? The patch defines the functions to be functionally identical to the normal functions if the architecture does not define raw_copy_from/to_user_key, so that this would be possible, however it is not required for our use case.
For the minimal functionality we require see the diff below.
bloat-o-meter reported a .03% kernel size increase.
Comments are much appreciated.
Janis Schoetterl-Glausch (2):
uaccess: Add mechanism for key checked access to user memory s390/uaccess: Provide raw_copy_from/to_user_key
arch/s390/include/asm/uaccess.h | 22 ++++++- arch/s390/lib/uaccess.c | 48 ++++++++------ include/linux/uaccess.h | 107 ++++++++++++++++++++++++++++++++ lib/usercopy.c | 33 ++++++++++ 4 files changed, 188 insertions(+), 22 deletions(-)
include/linux/uaccess.h +28 -0
@@ -114,6 +114,20 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)return raw_copy_from_user (to, from, n); } +#ifdef raw_copy_from_user_key +static __always_inline __must_check unsigned long +__copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_from_user (to, from, n); +check_object_size (to, n, false); +return raw_copy_from_user_key (to, from, n, key); +} +#endif /* raw_copy_from_user_key */ +/** * __copy_to_user_inatomic: - Copy a block of data into user space, with less checking. * @to: Destination address, in user space.
@@ -148,6 +162,20 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)return raw_copy_to_user (to, from, n); } +#ifdef raw_copy_to_user_key +static __always_inline __must_check unsigned long +__copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_to_user (to, from, n); +check_object_size (from, n, true); +return raw_copy_to_user_key (to, from, n, key); +} +#endif /* raw_copy_to_user_key */ +#ifdef INLINE_COPY_FROM_USER static inline __must_check unsigned long _copy_from_user (void *to,const void __user *from,unsigned long n)
base-commit: 0280e3c58f92b2fe0e8fbbdf8d386449168de4a8
Signature · 1 line
2.32.0
RFC PATCH 1/2 uaccess: Add mechanism for key checked access to user memory
KVM on s390 needs a mechanism to do accesses to guest memory that honors storage key protection.
On s390 each physical page is associated with 4 access control bits. On access, these are compared with an access key, which is either provided by the instruction or taken from the CPU state. Based on that comparison, the access either succeeds or is prevented.
KVM on s390 needs to be able emulate this behavior, for example during instruction emulation, when it makes accesses on behalf of the guest. Introduce ...copy_{from,to}_user_key functions KVM can use to achieve this. These differ from their non key counterparts by having an additional key argument, and delegating to raw_copy_from/to_user_key instead of raw_copy_{from,to}_user. Otherwise they are the same. If they were to be maintained in architecture specific code they would be prone to going out of sync with their non key counterparts. To prevent this, add them to include/linux/uaccess.h.
In order to allow use of ...copy_{from,to}_user_key from common code, the key argument is ignored on architectures that do not provide raw_copy_{from,to}_user_key and the functions become functionally identical to ...copy_{from,to}_user.
--- include/linux/uaccess.h | 107 ++++++++++++++++++++++++++++++++++++++++ lib/usercopy.c | 33 +++++++++++++ 2 files changed, 140 insertions(+)
include/linux/uaccess.h +107 -0
@@ -93,6 +93,11 @@ static inline void force_uaccess_end(mm_segment_t oldfs)* Biarch ones should also provide raw_copy_in_user() - similar to the above, * but both source and destination are __user pointers (affected by set_fs() * as usual) and both source and destination can trigger faults. +* +* Architectures can also provide raw_copy_{from,to}_user_key variants that take +* an additional key argument that can be used for additional memory protection +* checks. If these variants are not provided, ...copy_{from,to}_user_key are +* identical to their non key counterparts. */ static __always_inline __must_check unsigned long
@@ -201,6 +206,108 @@ copy_to_user(void __user *to, const void *from, unsigned long n)return n; } +/* +* ...copy_{from,to}_user_key variants +* must be kept in sync with their non key counterparts. +*/ +#ifndef raw_copy_from_user_key +static __always_inline unsigned long __must_check +raw_copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +return raw_copy_from_user (to, from, n); +} +#endif +static __always_inline __must_check unsigned long +__copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_from_user (to, from, n); +check_object_size (to, n, false); +return raw_copy_from_user_key (to, from, n, key); +} + +#ifdef INLINE_COPY_FROM_USER_KEY +static inline __must_check unsigned long +_copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +unsigned long res = n; +might_fault (); +if (!should_fail_usercopy () &&likely (access_ok (from, n))) { +instrument_copy_from_user (to, from, n); + res =raw_copy_from_user_key (to, from, n, key); + } +if (unlikely (res)) +memset (to + (n - res),0 , res); +return res; +} +#else +extern __must_check unsigned long +_copy_from_user_key (void *,const void __user *,unsigned long ,unsigned long ); +#endif + +#ifndef raw_copy_to_user_key +static __always_inline unsigned long __must_check +raw_copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +return raw_copy_to_user (to, from, n); +} +#endif + +static __always_inline __must_check unsigned long +__copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_to_user (to, from, n); +check_object_size (from, n, true); +return raw_copy_to_user_key (to, from, n, key); +} + +#ifdef INLINE_COPY_TO_USER_KEY +static inline __must_check unsigned long +_copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +if (access_ok (to, n)) { +instrument_copy_to_user (to, from, n); + n =raw_copy_to_user_key (to, from, n, key); + } +return n; +} +#else +extern __must_check unsigned long +_copy_to_user_key (void __user *,const void *,unsigned long ,unsigned long ); +#endif + +static __always_inline unsigned long __must_check +copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +if (likely (check_copy_size (to, n, false))) + n =_copy_from_user (to, from, n); +return n; +} + +static __always_inline unsigned long __must_check +copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +if (likely (check_copy_size (from, n, true))) + n =_copy_to_user (to, from, n); +return n; +} +#ifndef copy_mc_to_kernel/* * Without arch opt-in this generic copy_mc_to_kernel() will not handle
lib/usercopy.c +33 -0
@@ -37,6 +37,39 @@ unsigned long _copy_to_user(void __user *to, const void *from, unsigned long n)EXPORT_SYMBOL (_copy_to_user);#endif +#ifndef INLINE_COPY_FROM_USER_KEY +unsigned long _copy_from_user_key (void *to,const void __user *from, +unsigned long n,unsigned long key) +{ +unsigned long res = n; +might_fault (); +if (!should_fail_usercopy () &&likely (access_ok (from, n))) { +instrument_copy_from_user (to, from, n); + res =raw_copy_from_user_key (to, from, n, key); + } +if (unlikely (res)) +memset (to + (n - res),0 , res); +return res; +} +EXPORT_SYMBOL (_copy_from_user_key); +#endif + +#ifndef INLINE_COPY_TO_USER_KEY +unsigned long _copy_to_user_key (void __user *to,const void *from, +unsigned long n,unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +if (likely (access_ok (to, n))) { +instrument_copy_to_user (to, from, n); + n =raw_copy_to_user_key (to, from, n, key); + } +return n; +} +EXPORT_SYMBOL (_copy_to_user_key); +#endif +/** * check_zeroed_user: check if a userspace buffer only contains zero bytes * @from: Source address, in userspace.
Signature · 1 line
2.32.0
RFC PATCH 2/2 s390/uaccess: Provide raw_copy_from/to_user_key
In reply to Janis Schoetterl-GlauschThis makes the user access functions that perform storage key checking available, so they can be used by KVM for emulation.
Since the existing uaccess implementation on s390 makes use of move instructions that support having an additional access key supplied, we can implement raw_copy_from/to_user_key by enhancing the existing implementation.
--- arch/s390/include/asm/uaccess.h | 22 +++++++++++++-- arch/s390/lib/uaccess.c | 48 +++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 22 deletions(-)
arch/s390/include/asm/uaccess.h +20 -2
@@ -33,15 +33,33 @@ static inline int __range_ok(unsigned long addr, unsigned long size)#define access_ok (addr, size) __access_ok(addr, size) +#define raw_copy_from_user_key raw_copy_from_user_keyunsigned long __must_check -raw_copy_from_user (void *to,const void __user *from,unsigned long n); +raw_copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key); +#define raw_copy_to_user_key raw_copy_to_user_keyunsigned long __must_check -raw_copy_to_user (void __user *to,const void *from,unsigned long n); +raw_copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key); + +static __always_inline unsigned long __must_check +raw_copy_from_user (void *to,const void __user *from,unsigned long n) +{ +return raw_copy_from_user_key (to, from, n,0 ); +} + +static __always_inline unsigned long __must_check +raw_copy_to_user (void __user *to,const void *from,unsigned long n) +{ +return raw_copy_to_user_key (to, from, n,0 ); +}#ifndef CONFIG_KASAN #define INLINE_COPY_FROM_USER #define INLINE_COPY_TO_USER +#define INLINE_COPY_FROM_USER_KEY +#define INLINE_COPY_TO_USER_KEY #endif int __put_user_bad (void ) __attribute__((noreturn));
arch/s390/lib/uaccess.c +28 -20
132 lines not on this page · raw message
Signature · 1 line
2.32.0
Christian Borntraeger
reviewerAm 26.01.22 um 18:33 schrieb Janis Schoetterl-Glausch:
Quoted 3 lines
Something like this patch series is required as part of KVM supporting storage keys on s390.
See https://lore.kernel.org/kvm/[email protected]/
Just to give some more context. In theory we could confine the alternative uaccess functions in s390x architecture code, after all we only have one place in KVM code where we call it. But this will be very likely result in future changes not being synced. This would very likely also continue to work but it might miss security and functionality enhancements. And I think we want our KVM uaccess to also do the kasan, error-inject and so on. After all there is a reason why all copy_*user functions were merged and now architectures only provide raw_*_user functions.
Quoted 99 lines
On s390 each physical page is associated with 4 access control bits. On access, these are compared with an access key, which is either provided by the instruction or taken from the CPU state. Based on that comparison, the access either succeeds or is prevented.
KVM on s390 needs to be able emulate this behavior, for example during instruction emulation, when it makes accesses on behalf of the guest. In order to do that, we need variants of __copy_from/to_user that pass along an access key to the architecture specific implementation of __copy_from/to_user. That is the only difference, variants do the same
might_fault(),instrument_copy_to_user(), etc. calls as the normal functions do and need to be kept in sync with those.
If these __copy_from/to_user_key functions were to be maintained in architecture specific code they would be prone to going out of sync with their non key counterparts if there were code changes. So, instead, add these variants toinclude/linux/uaccess.h.Considerations:
* The key argument is an unsigned long, in order to make the functions less specific to s390, which would only need an u8.
This could also be generalized further, i.e. by having the type be defined by the architecture, with the default being a struct without any members.
Also the functions could be renamed ..._opaque, ..._arg, or similar.
* Which functions do we provide_keyvariants for? Just defining __copy_from/to_user_key would make it rather specific to our use case.
* Should ...copy_from/to_user_key functions be callable from common code? The patch defines the functions to be functionally identical to the normal functions if the architecture does not define raw_copy_from/to_user_key, so that this would be possible, however it is not required for our use case.For the minimal functionality we require see the diff below.
bloat-o-meter reported a .03% kernel size increase.
Comments are much appreciated.
Janis Schoetterl-Glausch (2):
uaccess: Add mechanism for key checked access to user memory s390/uaccess: Provide raw_copy_from/to_user_keyarch/s390/include/asm/uaccess.h | 22 ++++++- arch/s390/lib/uaccess.c | 48 ++++++++------ include/linux/uaccess.h | 107 ++++++++++++++++++++++++++++++++ lib/usercopy.c | 33 ++++++++++ 4 files changed, 188 insertions(+), 22 deletions(-)include/linux/uaccess.h +28
-0@@ -114,6 +114,20 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)return raw_copy_from_user (to, from, n); } +#ifdef raw_copy_from_user_key +static __always_inline __must_check unsigned long +__copy_from_user_key (void *to,const void __user *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_from_user (to, from, n); +check_object_size (to, n, false); +return raw_copy_from_user_key (to, from, n, key); +} +#endif /* raw_copy_from_user_key */ +/** * __copy_to_user_inatomic: - Copy a block of data into user space, with less checking. * @to: Destination address, in user space. @@ -148,6 +162,20 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)return raw_copy_to_user (to, from, n); } +#ifdef raw_copy_to_user_key +static __always_inline __must_check unsigned long +__copy_to_user_key (void __user *to,const void *from,unsigned long n, +unsigned long key) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_to_user (to, from, n); +check_object_size (from, n, true); +return raw_copy_to_user_key (to, from, n, key); +} +#endif /* raw_copy_to_user_key */ +#ifdef INLINE_COPY_FROM_USER static inline __must_check unsigned long _copy_from_user (void *to,const void __user *from,unsigned long n)base-commit:
0280e3c58f92b2fe0e8fbbdf8d386449168de4a8
Quoted 7 lines
Considerations:
* The key argument is an unsigned long, in order to make the functions less specific to s390, which would only need an u8.
This could also be generalized further, i.e. by having the type be defined by the architecture, with the default being a struct without any members.
Also the functions could be renamed ..._opaque, ..._arg, or similar.
Quoted 9 lines
* Which functions do we provide
_keyvariants for? Just defining __copy_from/to_user_key would make it rather specific to our use case.
* Should ...copy_from/to_user_key functions be callable from common code? The patch defines the functions to be functionally identical to the normal functions if the architecture does not define raw_copy_from/to_user_key, so that this would be possible, however it is not required for our use case.
After thinking about it some more, this variant seems an attractive compromise between the different dimensions.
It maximises extensibility by having the additional argument and semantic completely architecture defined.
At the same time it keeps the changes to the minimum, which reduces the maintenance cost of keeping the functions in sync.
It is also clear how other use cases can be supported, when they arise. Calling the functions from common code would be supported by defining the opaque argument as an empty struct by default, and defaulting to raw_copy_from/to_user. If other variants of copy to/from user with an additional argument are required they can be added in the same manner as is done here for __copy_from/to_user.
Quoted 2 lines
Comments are much appreciated.
Janis Schoetterl-Glausch (2):
uaccess: Add mechanism for arch specific user access with argument s390/uaccess: Provide raw_copy_from/to_user_opaque
arch/s390/include/asm/uaccess.h | 27 ++++++++++++++-- arch/s390/lib/uaccess.c | 56 ++++++++++++++++++++------------- include/linux/uaccess.h | 28 +++++++++++++++++ 3 files changed, 88 insertions(+), 23 deletions(-)
Signature · 1 line
2.32.0
RFC PATCH 1/2 uaccess: Add mechanism for arch specific user access with argument
KVM on s390 needs a mechanism to do accesses to guest memory that honor storage key protection.
On s390 each physical page is associated with 4 access control bits. On access these are compared with an access key, which is either provided by the instruction or taken from the CPU state. Based on that comparison, the access either succeeds or is prevented.
KVM on s390 needs to be able emulate this behavior, for example during instruction emulation. KVM usually accesses the guest via __copy_from/to_user, but in this case we need to also pass the access key. Introduce __copy_from/to_user_opaque functions KVM can use to achieve this by forwarding an architecture specific argument.
These functions are the same as their non _opaque counterparts, except for the additional argument and also reside in include/linux/uaccess.h so that they will not go out of sync should their counterparts change.
--- include/linux/uaccess.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
include/linux/uaccess.h +28 -0
@@ -114,6 +114,20 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)return raw_copy_from_user (to, from, n); } +#ifdef uaccess_opaque +static __always_inline __must_check unsigned long +__copy_from_user_opaque (void *to,const void __user *from,unsigned long n, +struct uaccess_opaque opaque) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_from_user (to, from, n); +check_object_size (to, n, false); +return raw_copy_from_user_opaque (to, from, n, opaque); +} +#endif /* uaccess_opaque */ +/** * __copy_to_user_inatomic: - Copy a block of data into user space, with less checking. * @to: Destination address, in user space.
@@ -148,6 +162,20 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)return raw_copy_to_user (to, from, n); } +#ifdef uaccess_opaque +static __always_inline __must_check unsigned long +__copy_to_user_opaque (void __user *to,const void *from,unsigned long n, +struct uaccess_opaque opaque) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_to_user (to, from, n); +check_object_size (from, n, true); +return raw_copy_to_user_opaque (to, from, n, opaque); +} +#endif /* uaccess_opaque */ +#ifdef INLINE_COPY_FROM_USER static inline __must_check unsigned long _copy_from_user (void *to,const void __user *from,unsigned long n)
Signature · 1 line
2.32.0
Heiko Carstens
maintainerRe: [RFC PATCH 1/2] uaccess: Add mechanism for arch specific user access with argument
Quoted 54 lines · Janis Schoetterl-Glausch
KVM on s390 needs a mechanism to do accesses to guest memory that honor storage key protection.
On s390 each physical page is associated with 4 access control bits. On access these are compared with an access key, which is either provided by the instruction or taken from the CPU state. Based on that comparison, the access either succeeds or is prevented.
KVM on s390 needs to be able emulate this behavior, for example during instruction emulation. KVM usually accesses the guest via __copy_from/to_user, but in this case we need to also pass the access key. Introduce __copy_from/to_user_opaque functions KVM can use to achieve this by forwarding an architecture specific argument.
These functions are the same as their non_opaquecounterparts, except for the additional argument and also reside ininclude/linux/uaccess.hso that they will not go out of sync should their counterparts change.Signed-off-by Janis Schoetterl-Glausch <[email protected]>--- include/linux/uaccess.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)include/linux/uaccess.h +17
-0@@ -114,6 +114,20 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)return raw_copy_from_user (to, from, n); } +#ifdef uaccess_opaque +static __always_inline __must_check unsigned long +__copy_from_user_opaque (void *to,const void __user *from,unsigned long n, +struct uaccess_opaque opaque) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_from_user (to, from, n); +check_object_size (to, n, false); +return raw_copy_from_user_opaque (to, from, n, opaque); +} +#endif /* uaccess_opaque */ +/** * __copy_to_user_inatomic: - Copy a block of data into user space, with less checking. * @to: Destination address, in user space. @@ -148,6 +162,20 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)return raw_copy_to_user (to, from, n); } +#ifdef uaccess_opaque +static __always_inline __must_check unsigned long +__copy_to_user_opaque(void __user *to, const void *from, unsigned long n,
include/linux/uaccess.h __copy_to_user(void __user *to, const void *from, unsigned long n) · line 177
Quoted 10 lines
include/linux/uaccess.h +10
-0+ struct uaccess_opaque opaque) +{ +might_fault (); +if (should_fail_usercopy ()) +return n; +instrument_copy_to_user (to, from, n); +check_object_size (from, n, true); +return raw_copy_to_user_opaque (to, from, n, opaque); +} +#endif /* uaccess_opaque */
I don't think this is acceptable for several reasons:
- we really don't want an "opaque" copy_to_user variant with completely different semantics for each architecture
- even if this would be only for s390 it is anything but obvious for the reader what the semantics of "opaque" are
- making a double underscore variant of something the regular api is really not nice
So I guess we have three options:
- add a "key" variant to common code, where the semantics are clearly that "key" is a matching access key required to access a user space page
- have this completely in s390 arch code and accept the burden (and risk) of keeping instrumentation, etc. in sync
- add some macros similar to the SYSCALL_DEFINE macros, which allow to create architecture specific copy_to/from_user variants with additional parameters.
RFC PATCH 2/2 s390/uaccess: Provide raw_copy_from/to_user_opaque
In reply to Janis Schoetterl-GlauschThis enables KVM to perform key checked guest accesses by passing the access key via the opaque argument of __copy_from/to_user_opaque. Since the existing uaccess implementation on s390 makes use of move instructions that support having an additional access key supplied, we can implement raw_copy_from/to_user_opaque by enhancing the existing implementation.
--- arch/s390/include/asm/uaccess.h | 27 ++++++++++++++-- arch/s390/lib/uaccess.c | 56 ++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 23 deletions(-)
arch/s390/include/asm/uaccess.h +25 -2
@@ -33,11 +33,34 @@ static inline int __range_ok(unsigned long addr, unsigned long size)#define access_ok (addr, size) __access_ok(addr, size) +#define uaccess_opaque uaccess_opaque +struct uaccess_opaque { +u8 key; +}; +unsigned long __must_check -raw_copy_from_user (void *to,const void __user *from,unsigned long n); +raw_copy_from_user_opaque (void *to,const void __user *from,unsigned long n, +struct uaccess_opaque opaque);unsigned long __must_check -raw_copy_to_user (void __user *to,const void *from,unsigned long n); +raw_copy_to_user_opaque (void __user *to,const void *from,unsigned long n, +struct uaccess_opaque opaque); + +static __always_inline unsigned long __must_check +raw_copy_from_user (void *to,const void __user *from,unsigned long n) +{ +struct uaccess_opaque opaque = { .key =0 }; + +return raw_copy_from_user_opaque (to, from, n, opaque); +} + +static __always_inline unsigned long __must_check +raw_copy_to_user (void __user *to,const void *from,unsigned long n) +{ +struct uaccess_opaque opaque = { .key =0 }; + +return raw_copy_to_user_opaque (to, from, n, opaque); +}#ifndef CONFIG_KASAN #define INLINE_COPY_FROM_USER
arch/s390/lib/uaccess.c +35 -21
139 lines not on this page · raw message
Signature · 1 line
2.32.0