Skip to contentSkip to conversation

keyctl_capabilities and buflen

DISCUSSION Ben Boeckel 2 participants 5 messages Jun 5, 2019 – Jun 19, 2019 Keys/keyrings

lore
Share & tools
lore
#0 lore raw

Hi,

I'm looking at the implementation of keyctl_capabilities in the next branch and it's not clear if buflen is the size of the memory pointed to by buffer in array size or in byte size by its documentation. It seems to be the size in bytes by the code (the &3) could probably warrant a comment to make it clearer that it is related to sizeof(unsigned int) here). This seems very odd to me, or is it just a common kernel pattern I haven't seen before?

Thanks,

--Ben

#1 lore raw
Quoted 7 lines · Ben Boeckel

I'm looking at the implementation of keyctl_capabilities in the next branch and it's not clear if buflen is the size of the memory pointed to by buffer in array size or in byte size by its documentation. It seems to be the size in bytes by the code (the &3) could probably warrant a comment to make it clearer that it is related to sizeof(unsigned int) here). This seems very odd to me, or is it just a common kernel pattern I haven't seen before?

I see that this is now unsigned char* instead of unsigned int on next now and in the kernel by the newest patch submission.

Thanks,

--Ben

maintainer
#2 lore raw
In reply to Ben Boeckel
Quoted 2 lines · Ben Boeckel

I see that this is now unsigned char* instead of unsigned int on next now and in the kernel by the newest patch submission.

If you're okay with the patch, could you reply to it with a Reviewed-by?

Thanks,
David

#3 lore raw
In reply to Ben Boeckel
Quoted 1 line · David Howells

If you're okay with the patch, could you reply to it with a Reviewed-by?

I'm not confident enough in the kernel side to give such a tag, sorry. I'm more interested in the libkeyutils patches which tend to just show up in the repo rather than for review on the list (where I'd happily give such tags where I can).

--Ben

maintainer
#4 lore raw
In reply to Ben Boeckel
Quoted 4 lines · Ben Boeckel

I'm not confident enough in the kernel side to give such a tag, sorry. I'm more interested in the libkeyutils patches which tend to just show up in the repo rather than for review on the list (where I'd happily give such tags where I can).

Okay, thanks.

David