sophos / talpa

Talpa Kernel file access interception modules
GNU General Public License v2.0
17 stars 11 forks source link

Linux 5.2 support #17

Closed cosmincrihan closed 4 years ago

cosmincrihan commented 5 years ago

The talpa kernel module does not compile on Linux 5.2.11.

  CC [M]  /mnt/date/PROGRAME/Sophos_AV9/talpa/src/components/core/intercept_filters_impl/fsobj_excl/filesystem_exclusion_processor.o
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/ifaces/common/list.h:22,
                 from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/components/core/intercept_filters_impl/fsobj_excl/filesystem_exclusion_processor.h:25,
                 from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/components/core/intercept_filters_impl/fsobj_excl/filesystem_exclusion_processor.c:26:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/components/core/intercept_filters_impl/fsobj_excl/filesystem_exclusion_processor.c: In function ‘deleteFilesystemExclusionProcessor’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/ifaces/platform/list.h:148:37: error: implicit declaration of function ‘synchronize_sched’; did you mean ‘synchronize_srcu’? [-Werror=implicit-function-declaration]
 #define talpa_rcu_synchronize       synchronize_sched
                                     ^~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/components/core/intercept_filters_impl/fsobj_excl/filesystem_exclusion_processor.c:169:5: note: in expansion of macro ‘talpa_rcu_synchronize’
     talpa_rcu_synchronize();
     ^~~~~~~~~~~~~~~~~~~~~

I managed to bypass this error by replacing synchronize_sched with synchronize_rcu in talpa/src/ifaces/platform/list.h, on line 148. But now, there are more errors:

  CC [M]  /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.o
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_open’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:227:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG3(name, ...) SYSCALL_ORIGx(3, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:237:1: note: in expansion of macro ‘SYSCALL_ORIG3’
 SYSCALL_ORIG3(open, const char __user *, filename, int, flags, int, mode);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_close’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_uselib’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_mount’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:229:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG5(name, ...) SYSCALL_ORIGx(5, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:240:1: note: in expansion of macro ‘SYSCALL_ORIG5’
 SYSCALL_ORIG5(mount, char __user *, dev_name, char __user *, dir_name, char __user *, type, unsigned long, flags, void __user *, data);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_umount’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_umount2’:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:194:9: error: too many arguments to function ‘syscall_set_arguments’
         syscall_set_arguments(current, &regs, 0, x, args);\
         ^~~~~~~~~~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:226:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG2(name, ...) SYSCALL_ORIGx(2, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:244:1: note: in expansion of macro ‘SYSCALL_ORIG2’
 SYSCALL_ORIG2(umount2, char __user *, name, int, flags);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:136:20: note: declared here
 static inline void syscall_set_arguments(struct task_struct *task,
                    ^~~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:279: /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.o] Error 1

Any plans on patching the module to work on the newest kernel?

cosmincrihan commented 5 years ago

Solved it. According to https://lkml.org/lkml/2019/4/5/409, the start and end indexes from the syscall_set_arguments function have been removed in the latest versions of the kernel.

That being said, I removed the 0 and x arguments in talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c, on line 194. It compiled, but with some warnings about some variables being uninitialized:

  CC [M]  /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.o
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_mount’:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:229:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG5(name, ...) SYSCALL_ORIGx(5, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:240:1: note: in expansion of macro ‘SYSCALL_ORIG5’
 SYSCALL_ORIG5(mount, char __user *, dev_name, char __user *, dir_name, char __user *, type, unsigned long, flags, void __user *, data);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_close’:
./arch/x86/include/asm/syscall.h:143:12: warning: ‘*((void *)&args+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->cx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+8)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:144:12: warning: ‘*((void *)&args+16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->dx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+16)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:145:12: warning: ‘*((void *)&args+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->si = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+24)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:146:12: warning: ‘*((void *)&args+32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->di = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+32)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:238:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(close, unsigned int, fd);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_umount’:
./arch/x86/include/asm/syscall.h:143:12: warning: ‘*((void *)&args+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->cx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+8)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:144:12: warning: ‘*((void *)&args+16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->dx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+16)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:145:12: warning: ‘*((void *)&args+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->si = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+24)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:146:12: warning: ‘*((void *)&args+32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->di = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+32)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:242:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(umount, char __user *, name);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_uselib’:
./arch/x86/include/asm/syscall.h:143:12: warning: ‘*((void *)&args+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->cx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+8)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:144:12: warning: ‘*((void *)&args+16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->dx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+16)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:145:12: warning: ‘*((void *)&args+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->si = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+24)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:146:12: warning: ‘*((void *)&args+32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->di = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+32)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:225:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG1(name, ...) SYSCALL_ORIGx(1, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:239:1: note: in expansion of macro ‘SYSCALL_ORIG1’
 SYSCALL_ORIG1(uselib, const char __user *, library);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_umount2’:
./arch/x86/include/asm/syscall.h:144:12: warning: ‘*((void *)&args+16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->dx = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+16)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:226:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG2(name, ...) SYSCALL_ORIGx(2, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:244:1: note: in expansion of macro ‘SYSCALL_ORIG2’
 SYSCALL_ORIG2(umount2, char __user *, name, int, flags);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:145:12: warning: ‘*((void *)&args+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->si = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+24)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:226:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG2(name, ...) SYSCALL_ORIGx(2, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:244:1: note: in expansion of macro ‘SYSCALL_ORIG2’
 SYSCALL_ORIG2(umount2, char __user *, name, int, flags);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:146:12: warning: ‘*((void *)&args+32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->di = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+32)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:226:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG2(name, ...) SYSCALL_ORIGx(2, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:244:1: note: in expansion of macro ‘SYSCALL_ORIG2’
 SYSCALL_ORIG2(umount2, char __user *, name, int, flags);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:226:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG2(name, ...) SYSCALL_ORIGx(2, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:244:1: note: in expansion of macro ‘SYSCALL_ORIG2’
 SYSCALL_ORIG2(umount2, char __user *, name, int, flags);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c: In function ‘__origl_open’:
./arch/x86/include/asm/syscall.h:145:12: warning: ‘*((void *)&args+24)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->si = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+24)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:227:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG3(name, ...) SYSCALL_ORIGx(3, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:237:1: note: in expansion of macro ‘SYSCALL_ORIG3’
 SYSCALL_ORIG3(open, const char __user *, filename, int, flags, int, mode);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:146:12: warning: ‘*((void *)&args+32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->di = *args++;
   ~~~~~~~~~^~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+32)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:227:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG3(name, ...) SYSCALL_ORIGx(3, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:237:1: note: in expansion of macro ‘SYSCALL_ORIG3’
 SYSCALL_ORIG3(open, const char __user *, filename, int, flags, int, mode);
 ^~~~~~~~~~~~~
In file included from /mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:45:
./arch/x86/include/asm/syscall.h:147:12: warning: ‘*((void *)&args+40)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   regs->bp = *args;
   ~~~~~~~~~^~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:193:23: note: ‘*((void *)&args+40)’ was declared here
         unsigned long args[] = { __MAP(x, __SC_ARGS, __VA_ARGS__) };\
                       ^~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:227:34: note: in expansion of macro ‘SYSCALL_ORIGx’
 #define SYSCALL_ORIG3(name, ...) SYSCALL_ORIGx(3, name, __VA_ARGS__)
                                  ^~~~~~~~~~~~~
/mnt/date/PROGRAME/Sophos_AV9/talpa/src/platforms/linux/talpa_syscallhook/talpa_syscallhook.c:237:1: note: in expansion of macro ‘SYSCALL_ORIG3’
 SYSCALL_ORIG3(open, const char __user *, filename, int, flags, int, mode);
 ^~~~~~~~~~~~~
Pastim commented 5 years ago

It's not compiling on linux 5.3 (as in ubuntu 19.10) either.

cosmincrihan commented 5 years ago

@Pastim try the patch I attached. It already contains the changes I mention above, packed in. Copy the archive into /opt/sophos-av/talpa/override/ and then run: sudo /opt/sophos-av/engine/talpa_select select

talpa-srcpack.tar.gz

Pastim commented 5 years ago

Hi,

Thanks. I would try this, but I don't know you. Installing a whole security program from an unknown source somehow seems unwise.

Now I'm sure you are just being really helpful, but I can't quite bring myself to install it as is.

I will therefore try to patch it myself as you instructed. I'm no software expert, but I'll see how it goes.

Pastim commented 5 years ago

I did the last patch (line 194), but all I get when compiling is as below.

........ config.status: creating makefile config.status: creating clients/Makefile config.status: creating tests/Makefile config.status: creating tests/modules/makefile config.status: creating tests/benchmark/Makefile config.status: creating config.h config.status: executing depfiles commands

Building... Traceback (most recent call last): File "talpa_select.py", line 2216, in _action File "talpa_select.py", line 845, in select File "talpa_select.py", line 1736, in select File "talpa_select.py", line 1820, in build File "talpa_select.py", line 1973, in __try_build SelectException: exc-build-failed

Pastim commented 5 years ago

Is there any other log I can look at to see why 'exc-build-failed'?

Pastim commented 5 years ago

OK - I have been a bit dim. Sorry. I was looking for build logs in the wrong place. Now I found the last one, and lo and behold it reports the error from the first post made by cosmincrihan . For reasons that escape me I thought I only had to apply the 2nd of the changes.

I have now made sure both patches are in place, and I'm not doing an autodeploy each day so I don't have to replace the source pack each day.

It now compiles OK (loads of warnings as posted above) and runs.

Apologies to cosmincrihan for my misunderstandings. No doubt if I'd taken the source pack it would have worked. I'm probably being a bit too cautious these days - been bitten a few times.

paperclip commented 4 years ago

We have released updates to Talpa (both master and perforce branches) that should allow Talpa to compile on kernel 5.2. Also fixes various initialised memory issues.

Pastim commented 4 years ago

Thanks. That works on 5.3.0 as well.