criu/include/file-ids.h
Cyrill Gorcunov 63000f5bb2 dump: Don't dump file params with on-stack values
Otherwise I see output like

 | Dumping path for 1536412160 fd via self 27 [/usr/bin/screen]

where fd is taken from stack and what is worse -- we work
with root privilegues, thus dumping _anything_ from stack
is very bad idea.

With explicitly cleared stack data and FD_DESC_INVALID the
log file will have an entry like

 | Dumping path for -3 fd via self 27 [/usr/bin/screen]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-30 12:36:17 +04:00

20 lines
465 B
C

#ifndef FILE_IDS_H__
#define FILE_IDS_H__
#include "compiler.h"
#include "types.h"
#include "rbtree.h"
#define FD_ID_INVALID (-1U)
#define FD_PID_INVALID (-2U)
#define FD_DESC_INVALID (-3U)
#define MAKE_FD_GENID(dev, ino, pos) \
(((u32)(dev) ^ (u32)(ino) ^ (u32)(pos)))
struct fdinfo_entry;
extern int fd_id_generate(pid_t pid, struct fdinfo_entry *fe);
extern u32 fd_id_generate_special(void);
extern void fd_id_show_tree(void);
#endif /* FILE_IDS_H__ */