[PATCHv3,4/7] criu/dump: Fix size of personality buffer

Submitted by Dmitry Safonov on April 6, 2018, 11:40 p.m.

Details

Message ID 20180406234021.15724-5-dima@arista.com
State New
Series "Large pages support for aarch64/ppc64"
Headers show

Commit Message

Dmitry Safonov April 6, 2018, 11:40 p.m.
Personality value is printed in kernel like this:
static int proc_pid_personality(/* .. */)
{
        int err = lock_trace(task);
        if (!err) {
                seq_printf(m, "%08x\n", task->personality);
                unlock_trace(task);
        }
        return err;
}

So, we don't need a whole page to read the value.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/cr-dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 094d016489ea..d16d8c8920bb 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -98,7 +98,8 @@  int __attribute__((weak)) arch_set_thread_regs(struct pstree_item *item,
 	return 0;
 }
 
-static char loc_buf[PAGE_SIZE];
+#define PERSONALITY_LENGTH	9
+static char loc_buf[PERSONALITY_LENGTH];
 
 void free_mappings(struct vm_area_list *vma_area_list)
 {