Re: [RFC] User stack pointer randomisation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Franck Bui-Huu wrote:
+/*
+ * Don't forget that the stack pointer must be aligned on a 8 bytes
+ * boundary at least.
+ */
+unsigned long arch_align_stack(unsigned long sp)
+{
+	if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+		sp -= get_random_int() & ~PAGE_MASK;
+
+	return sp & ~7;
+}

For the 64-bit ABIs (N32 & N64) the stack must be 16 byte aligned.

Nigel



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux