Skip to content

Commit a5f39c9

Browse files
committed
tetragon: Fix storing of flags and mode for path
[ upstream commit ad5c2b0 ] Currently we only store first byte of flags and mode from path retrieval, which ends up with wrong flags and permissions in all arguments that goes through path retrieval. fixing it by properly storing the value in argument byte array. Signed-off-by: Jiri Olsa <[email protected]>
1 parent 7fbb0b9 commit a5f39c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpf/process/types/basic.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ FUNC_INLINE long store_path(char *args, char *buffer, const struct path *arg,
375375
* -----------------------------------------
376376
* Next we set up the flags.
377377
*/
378-
args[size] = (u32)flags;
379-
args[size + sizeof(u32)] = (u16)i_mode;
378+
*(u32 *)&args[size] = (u32)flags;
379+
*(u16 *)&args[size + sizeof(u32)] = (u16)i_mode;
380380
size += sizeof(u32) + sizeof(u16); // for the flags + i_mode
381381

382382
return size;

0 commit comments

Comments
 (0)