News for hackers. Stuff that matters.
Re:An Ancient Kernel Hole Is Not Closed by radarsat1 on Wednesday June 21, 2017 @09:53AM (#14603783)
Ok so if I have an application that makes a large stack allocation, it's safe as long as that memory is read/written at least once?
Re:An Ancient Kernel Hole Is Not Closed by lmm on Wednesday June 21, 2017 @10:03AM (#14603866)
Only if it's accessed at least once in each page (4K), AIUI.
Re:An Ancient Kernel Hole Is Not Closed by radarsat1 on Wednesday June 21, 2017 @10:19AM (#14603992)
Right. If I simply zero the memory with `memset` then I guess it should be ok.
Re:An Ancient Kernel Hole Is Not Closed by clarry on Wednesday June 21, 2017 @11:27AM (#14604604)
Unless the compiler decides that zeroing the memory doesn't do anything useful and optimizes it out.
Re:An Ancient Kernel Hole Is Not Closed by astrange on Wednesday June 21, 2017 @08:10PM (#14609134)
Initializing your stack buffer probably does count as something useful, but in case it doesn't, try memset_s(3).
Re:An Ancient Kernel Hole Is Not Closed by mnarayan01 on Wednesday June 21, 2017 @11:27AM (#14604596)
No: See http://en.cppreference.com/w/c/string/byte/memset#Notes -- if you don't read from it, the call may be optimized away.
Re:An Ancient Kernel Hole Is Not Closed by dom0 on Wednesday June 21, 2017 @03:28PM (#14607088)
Like my brethren say it's probably a good idea to use a "secure" memset that won't have an accident ^W ^W ^W be optimized out.
Re:An Ancient Kernel Hole Is Not Closed by loeg on Wednesday June 21, 2017 @11:33PM (#14609949)
Or keep >4kB objects off stack.
Re:An Ancient Kernel Hole Is Not Closed by radarsat1 on Thursday June 22, 2017 @10:29AM (#14612452)
I mean, that's probably a good practice. In my case I sort of had this idea that largish objects should be placed on the heap but I couldn't really figure out a good reason why, or what the limit should be, so I guess this vuln proposes both a reason and that the page limit is a good threshold.