Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with 5.6 #1614

Closed
wants to merge 1 commit into from
Closed

Fix compatibility with 5.6 #1614

wants to merge 1 commit into from

Conversation

Mic92
Copy link
Contributor

@Mic92 Mic92 commented Apr 7, 2020

Have not tested yet with older kernel.

@@ -2694,9 +2694,9 @@ static int timespec_parse(struct event_filler_arguments *args, unsigned long val
{
uint64_t longtime;
char *targetbuf = args->str_storage;
struct timespec *tts = (struct timespec *)targetbuf;
struct old_timespec32 *tts = (struct old_timespec32 *)targetbuf;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about his one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be timespec64 but only on 64-bit. On 32-bit this is timespec32.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is __kernel_timespec the right choice here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case sysdig needs to use: get_timespec64()

Copy link
Contributor

@hhoffstaette hhoffstaette Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read the docs (ioctl.rst, "Timestamps") and get_timespec64()/__kernel_timespec seem like the right way.

Copy link
Contributor

@fntlnz fntlnz Apr 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timespec sounds like __kernel_old_timespec to me.

sysdig-CLA-1.0-signed-off-by: Jörg Thalheim <[email protected]>
@hhoffstaette
Copy link
Contributor

hhoffstaette commented Apr 7, 2020

Please see #1609 for a complete and unintrusive fix that is backwards-compatible. If you can help test these changes with older kernels and other distributions it would help greatly.
Superseded by a completely different version that should (hopefully) still be backwards-comptible. ;)

@Maryse47
Copy link

Maryse47 commented Apr 7, 2020

@hhoffstaette your fix doesn't work for me while this one does.

@hhoffstaette
Copy link
Contributor

@hhoffstaette your fix doesn't work for me while this one does.

Yes, that was due to CONFIG_COMPAT and is now fixed.

@Mic92
Copy link
Contributor Author

Mic92 commented Apr 8, 2020

@hhoffstaette Your patch does not looks correct. See: hhoffstaette@55a8525#r38363243

Copy link
Contributor

@fntlnz fntlnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Mic92
Thanks for this PR, I appreciate a lot your efforts here in trying to putting this together.

Thanks a lot to @hhoffstaette too.

I did some testing myself and added a few comments. I'll do more testing on my end come back to this to review again later once you are at a later stage.

Just a side thinking: The more I look at this PR the more I think we should just drop the old functions for newer kernels even if they have the kernel_old counterpart.

@@ -1345,7 +1345,7 @@ static int parse_sockopt(struct event_filler_arguments *args, int level, int opt
union {
uint32_t val32;
uint64_t val64;
struct timeval tv;
struct __kernel_old_timeval tv;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't test yet with old kernels but here it's likely that we need to keep timeval for those kernels that do not define __kernel_old_timeval

@@ -2694,9 +2694,9 @@ static int timespec_parse(struct event_filler_arguments *args, unsigned long val
{
uint64_t longtime;
char *targetbuf = args->str_storage;
struct timespec *tts = (struct timespec *)targetbuf;
struct old_timespec32 *tts = (struct old_timespec32 *)targetbuf;
Copy link
Contributor

@fntlnz fntlnz Apr 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timespec sounds like __kernel_old_timespec to me.

@fntlnz
Copy link
Contributor

fntlnz commented Apr 17, 2020

This PR will likely need to touch /driver/bpf/fillers.h too.

@Maryse47
Copy link

@Mic92 this was fixed by #1621 you can close this one.

@Mic92 Mic92 closed this May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants