keyctl.h: update pointer types
PATCH 4/5 keyctl.h: update pointer types
These should be const since the kernel should not touch them. In addition otherinfo is defined to be opaque, so make it a void *.
--- include/uapi/linux/keyctl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/keyctl.h +2 -2
@@ -76,8 +76,8 @@ struct keyctl_dh_params { };struct keyctl_kdf_params { -char __user *hashname; -char __user *otherinfo; +const char __user *hashname; +const void __user *otherinfo;__u32 otherinfolen;__u32 __spare[8 ]; };
Signature · 1 line
2.17.1
David Howells
maintainerQuoted 2 lines · Ben Boeckel
These should be
constsince the kernel should not touch them. In additionotherinfois defined to be opaque, so make it avoid *.
You're changing the UAPI - and this no longer matches what's in keyutils.h in userspace.
The UAPI change might potentially cause userspace to fail to compile if someone was assigning the char * pointer from the struct to another char * pointer.
Unless there's an actual bug to fix (see the 'private' problem), I would strongly recommend living with this.
David
Quoted 6 lines · David Howells
Quoted 2 lines · Ben Boeckel
These should be
constsince the kernel should not touch them. In additionotherinfois defined to be opaque, so make it avoid *.You're changing the UAPI - and this no longer matches what's in
keyutils.hin userspace.
Please see patch #5/7 of the keyutils patches on this thread for that change.
Quoted 3 lines
The UAPI change might potentially cause userspace to fail to compile if someone was assigning the char * pointer from the struct to another char * pointer.
Is this in a released kernel? Isn't the KDF code being added in another pull request of yours[1]?
--Ben