[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240409225209.58102-4-kuniyu@amazon.com>
Date: Tue, 9 Apr 2024 15:52:09 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>
CC: Rao shoaib <rao.shoaib@...cle.com>, Kuniyuki Iwashima <kuniyu@...zon.com>,
Kuniyuki Iwashima <kuni1840@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH v1 net 3/3] af_unix: Prepare MSG_OOB deprecation.
Commit 314001f0bf92 ("af_unix: Add OOB support") introduced MSG_OOB
support for AF_UNIX, and it's about 3 years ago. Since then, MSG_OOB
is the playground for syzbot.
MSG_OOB support is guarded with CONFIG_AF_UNIX_OOB, but it's enabled
by default and cannot be disabled without editing .config manually
because of the lack of prompt.
We recently found 3 wrong behaviours with basic functionality that
no one have noticed for 3 years, so it seems there is no real user
and even the author is not using OOB feature. [0]
This is a good opportunity to drop MSG_OOB support.
Let's switch the default config to n and add warning so that someone
using MSG_OOB in a real workload can notice it before MSG_OOB support
is removed completely.
Link: https://lore.kernel.org/netdev/472044aa-4427-40f0-9b9a-bce75d5c8aac@oracle.com/ [0]
Fixes: 314001f0bf92 ("af_unix: Add OOB support")
Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
---
Added Fixes tag so that it can be backported to corresponding stable
kernels.
---
net/unix/Kconfig | 4 ++--
net/unix/af_unix.c | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/unix/Kconfig b/net/unix/Kconfig
index 8b5d04210d7c..9d9270fdc1fe 100644
--- a/net/unix/Kconfig
+++ b/net/unix/Kconfig
@@ -17,9 +17,9 @@ config UNIX
Say Y unless you know what you are doing.
config AF_UNIX_OOB
- bool
+ bool "Unix MSG_OOB support"
depends on UNIX
- default y
+ default n
config UNIX_DIAG
tristate "UNIX: socket monitoring interface"
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 9a6ad5974dff..fecca27aa77f 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2253,6 +2253,8 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
err = -EOPNOTSUPP;
if (msg->msg_flags & MSG_OOB) {
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
+ pr_warn_once("MSG_OOB support will be removed in 2025.\n");
+
if (len)
len--;
else
--
2.30.2
Powered by blists - more mailing lists