Thread (5 messages) flat view 5 messages, 4 authors, 2017-03-10

Re: [PATCH v2] selinux: check for address length in selinux_socket_bind()

From: Paul Moore <paul@paul-moore.com>
Date: 2017-03-10 12:02:59
Also in: lkml, selinux

On Thu, Mar 9, 2017 at 2:12 AM, David Miller [off-list ref] wrote:
From: Alexander Potapenko <glider@google.com>
Date: Mon,  6 Mar 2017 19:46:14 +0100
quoted
KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of
uninitialized memory in selinux_socket_bind():
 ...
quoted
(the line numbers are relative to 4.8-rc6, but the bug persists upstream)

, when I run the following program as root:
 ...
quoted
(for different values of |size| other error reports are printed).

This happens because bind() unconditionally copies |size| bytes of
|addr| to the kernel, leaving the rest uninitialized. Then
security_socket_bind() reads the IP address bytes, including the
uninitialized ones, to determine the port, or e.g. pass them further to
sel_netnode_find(), which uses them to calculate a hash.

Signed-off-by: Alexander Potapenko <glider@google.com>
Are the SELINUX folks going to pick this up or should I?
Yes, it's on my list of things to merge, I was just a bit distracted
this week with yet another audit problem.  I'm going to start making
my way through the patch backlog today.

-- 
paul moore
www.paul-moore.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help