selinux: add AF_UNSPEC and INADDR_ANY checks to selinux_socket_bind()
Alexey Kodanev authored
Commit d452930f ("selinux: Add SCTP support") breaks compatibility
with the old programs that can pass sockaddr_in structure with AF_UNSPEC
and INADDR_ANY to bind(). As a result, bind() returns EAFNOSUPPORT error.
This was found with LTP/asapi_01 test.

Similar to commit 29c486df ("net: ipv4: relax AF_INET check in
bind()"), which relaxed AF_INET check for compatibility, add AF_UNSPEC
case to AF_INET and make sure that the address is INADDR_ANY.

Fixes: d452930f

 ("selinux: Add SCTP support")
Signed-off-by: default avatarAlexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
0f8db8cc
Name Last commit Last update
Documentation selinux: Update SELinux SCTP documentation
LICENSES LICENSES: Add MPL-1.1 license
arch unify {de,}mangle_poll(), get rid of kernel-side POLL...
block vfs: do bulk POLL* -> EPOLL* replacement
certs License cleanup: add SPDX GPL-2.0 license identifier to files with no license
crypto vfs: do bulk POLL* -> EPOLL* replacement
drivers vfs: do bulk POLL* -> EPOLL* replacement
firmware kbuild: remove all dummy assignments to obj-
fs vfs: do bulk POLL* -> EPOLL* replacement
include sctp: Add LSM hooks
init membarrier: Provide core serializing command, *_SYNC_CORE
ipc vfs: do bulk POLL* -> EPOLL* replacement
kernel vfs: do bulk POLL* -> EPOLL* replacement
lib Merge tag 'kbuild-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
mm vfs: do bulk POLL* -> EPOLL* replacement
net sctp: Add LSM hooks
samples sample/bpf: fix erspan metadata
scripts Merge tag 'kbuild-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
security selinux: add AF_UNSPEC and INADDR_ANY checks to selinux_socket_bind()
sound vfs: do bulk POLL* -> EPOLL* replacement
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
usr initramfs: fix initramfs rebuilds w/ compression after disabling
virt vfs: do bulk POLL* -> EPOLL* replacement
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.