Commit 159d3bdf authored by Pavel Emelyanov's avatar Pavel Emelyanov

fdinfo: Sanitize types in fdinfo_entry

The namelen is u16, to cover the PATH_MAX u8 is not enough.
The pos is u64, since file offset is that long indeed.
The id is u32 as per previous patch.

Fix printf-s respectively.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent af57e42e
......@@ -83,8 +83,8 @@ static void show_files(int fd_files)
if (ret <= 0)
goto out;
pr_msg("type: %s flags: %4x pos: %8x "
"addr: %16lx id: %8lx",
pr_msg("type: %s flags: %4x pos: %lx "
"addr: %16lx id: %8x",
fdtype2s(e.type), e.flags, e.pos, e.addr, e.id);
if (e.len) {
......
......@@ -76,7 +76,7 @@ static int collect_fd(int pid, struct fdinfo_entry *e)
struct fdinfo_list_entry *le = &fdinfo_list[nr_fdinfo_list];
struct fdinfo_desc *desc;
pr_info("Collect fdinfo pid=%d fd=%ld id=%16lx\n",
pr_info("Collect fdinfo pid=%d fd=%ld id=%16x\n",
pid, e->addr, e->id);
nr_fdinfo_list++;
......
......@@ -46,11 +46,11 @@ enum fd_types {
struct fdinfo_entry {
u8 type;
u8 len;
u16 len;
u16 flags;
u32 pos;
u64 pos;
u64 addr;
u64 id;
u32 id;
u8 name[0];
} __packed;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment