From patchwork Tue Apr 9 22:52:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13623290 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94B02158D99 for ; Tue, 9 Apr 2024 22:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.95.48.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703179; cv=none; b=ZBpsumlTkMaMi9jVHahT7Sun5gS23zc5p+5I4biQV6TwtPRl9P2KLGhQWsge/G37hmE/X24gRjkslvHXlRauNtGLZCZD+fyImcCcaEHyyc2W/EYn7HgVomq6Ntdp2dlIxAUYzZJTPv5DPaKmal3ONhkV+EMu+oIqKCFe6+F5qn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703179; c=relaxed/simple; bh=3DTl/U6C4+1nLY26IsYDt2KiRp/Ij0PXdwyqXSdMz7I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W8UOVj4v11GxFEDz8eNU/aOgHI0ifV2dKvcpLhGzU/BI36kuaarmRLCbiJzR/ofaPEYTbK/ZG8SYmyDwRJ7L4hb+ML2EEnUVu1kdhIfxC4ZTHDa4SSZS9ZjRkI5MpT4SgDuYNjUOHB9c3nkHpSghYZBIOGDvOuHVhz3wABBLcpY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=sd1Wmmv+; arc=none smtp.client-ip=52.95.48.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="sd1Wmmv+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1712703178; x=1744239178; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QYH7nc8crhLZJB6pl/pvZvHXOC0SPwVWlVX7SNz8QrY=; b=sd1Wmmv+aP6YnckdXWuTTU34exjHlML24z8GrWDOltj7IrpRdX3LWIAr ITi2c8bn5t8xk50vdUUPXZft+ZrH1cuyfHa2Ev/LZuszaKJZezqcj7Aoh ntNb4SaGhQljT26lf6IB9olUseyvnHF7mF2S5A957EstApsZVliXKjtUb E=; X-IronPort-AV: E=Sophos;i="6.07,190,1708387200"; d="scan'208";a="388632821" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.2]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 22:52:54 +0000 Received: from EX19MTAUWA002.ant.amazon.com [10.0.21.151:52890] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.55.49:2525] with esmtp (Farcaster) id e638c553-297a-4402-846c-00474f40cb84; Tue, 9 Apr 2024 22:52:53 +0000 (UTC) X-Farcaster-Flow-ID: e638c553-297a-4402-846c-00474f40cb84 Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 9 Apr 2024 22:52:53 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.45) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.28; Tue, 9 Apr 2024 22:52:50 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Rao shoaib , Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net 1/3] af_unix: Call manage_oob() for every skb in unix_stream_read_generic(). Date: Tue, 9 Apr 2024 15:52:07 -0700 Message-ID: <20240409225209.58102-2-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240409225209.58102-1-kuniyu@amazon.com> References: <20240409225209.58102-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D035UWB004.ant.amazon.com (10.13.138.104) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org When we call recv() for AF_UNIX socket, we first peek one skb and calls manage_oob() to check if the skb is sent with MSG_OOB. However, when we fetch the next (and the following) skb, manage_oob() is not called now, leading a wrong behaviour. Let's say a socket send()s "hello" with MSG_OOB and the peer tries to recv() 5 bytes with MSG_PEEK. Here, we should get only "hell" without 'o', but actually not: >>> from socket import * >>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM) >>> c1.send(b'hello', MSG_OOB) 5 >>> c2.recv(5, MSG_PEEK) b'hello' The first skb fills 4 bytes, and the next skb is peeked but not properly checked by manage_oob(). Let's move up the again label to call manage_oob() for evry skb. With this patch: >>> from socket import * >>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM) >>> c1.send(b'hello', MSG_OOB) 5 >>> c2.recv(5, MSG_PEEK) b'hell' Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Kuniyuki Iwashima --- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index d032eb5fa6df..f297320438bf 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2741,6 +2741,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state, last = skb = skb_peek(&sk->sk_receive_queue); last_len = last ? last->len : 0; +again: #if IS_ENABLED(CONFIG_AF_UNIX_OOB) if (skb) { skb = manage_oob(skb, sk, flags, copied); @@ -2752,7 +2753,6 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state, } } #endif -again: if (skb == NULL) { if (copied >= target) goto unlock; From patchwork Tue Apr 9 22:52:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13623291 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0659158D8F for ; Tue, 9 Apr 2024 22:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.95.48.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703202; cv=none; b=ZN0EuiyqdOVr/QOYgNzW6cP8pPGe6KpKmJHit21PJxtNEQLv2VGjqh0fF48JtIsXwPTg02NDOegybhWIc5EsM+eIPlWYifauz0g5g3pEj+BxRWNglOtELz9f4zX6Om35fAscWckGDj7QHEcondZO2wx46TlTJrSy+1sAY5htmyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703202; c=relaxed/simple; bh=/mFzy0/wXcNdV8jrPyJzMG4utX210cUFx+M2IVusYww=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=seEKh3GQWWXBlYcF7XdDUcjImCQHYx9HWARQFB9clkJkdh+10PswFPnZSelfEW7z8d3XFvWmB5DH2FQZ31Qid5Il/TNmW/RhNTG410Go7xOO0E+xSkPSUIudMrxIAqwHf+2fvO/itmRhZ0Qscoov3LLREMlLF+2G3SRsF5A0rQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=TdJHTEAY; arc=none smtp.client-ip=52.95.48.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="TdJHTEAY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1712703201; x=1744239201; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PVdZPzfe9EF/CBelLXYDz0AmXvtZb+wa+Sc+QCYcmCs=; b=TdJHTEAY8+e7PChG73v5ls07sQ1pXec1VT2oeyIPLqPd9C6SoQYZGluk giSILAX5C+6fNfHEugiC1tXXUrS7d4t0HidyUQtVqP4WRQ1VqG+Q28W4V hpVcYSFJUaiGbMDA2DxyCgpRHtrrvGsEGM4Nh8Xqr3bOQQ8FgTL2hUrys 0=; X-IronPort-AV: E=Sophos;i="6.07,190,1708387200"; d="scan'208";a="388632866" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.2]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 22:53:20 +0000 Received: from EX19MTAUWA001.ant.amazon.com [10.0.38.20:29104] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.12.255:2525] with esmtp (Farcaster) id 37762a40-b759-423a-8c09-16996039ac07; Tue, 9 Apr 2024 22:53:19 +0000 (UTC) X-Farcaster-Flow-ID: 37762a40-b759-423a-8c09-16996039ac07 Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWA001.ant.amazon.com (10.250.64.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 9 Apr 2024 22:53:18 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.45) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.28; Tue, 9 Apr 2024 22:53:15 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Rao shoaib , Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net 2/3] af_unix: Don't peek OOB data without MSG_OOB. Date: Tue, 9 Apr 2024 15:52:08 -0700 Message-ID: <20240409225209.58102-3-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240409225209.58102-1-kuniyu@amazon.com> References: <20240409225209.58102-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D035UWB003.ant.amazon.com (10.13.138.85) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org Currently, we can read OOB data without MSG_OOB by using MSG_PEEK when OOB data is sitting on the front row, which is apparently wrong. >>> from socket import * >>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM) >>> c1.send(b'a', MSG_OOB) 1 >>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT) b'a' If manage_oob() is called when no data has been copied, we only check if the socket enables SO_OOBINLINE or MSG_PEEK is not used. Otherwise, the skb is returned as is. However, here we should return NULL if MSG_PEEK is set and no data has been copied. Also, in such a case, we should not jump to the redo label because we will be caught in the loop and hog the CPU until normal data comes in. Then, we need to handle skb == NULL case with the if-clause below the manage_oob() block. With this patch: >>> from socket import * >>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM) >>> c1.send(b'a', MSG_OOB) 1 >>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT) Traceback (most recent call last): File "", line 1, in BlockingIOError: [Errno 11] Resource temporarily unavailable Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Kuniyuki Iwashima --- net/unix/af_unix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index f297320438bf..9a6ad5974dff 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2663,7 +2663,9 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk, WRITE_ONCE(u->oob_skb, NULL); consume_skb(skb); } - } else if (!(flags & MSG_PEEK)) { + } else if (flags & MSG_PEEK) { + skb = NULL; + } else { skb_unlink(skb, &sk->sk_receive_queue); WRITE_ONCE(u->oob_skb, NULL); if (!WARN_ON_ONCE(skb_unref(skb))) @@ -2745,11 +2747,9 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state, #if IS_ENABLED(CONFIG_AF_UNIX_OOB) if (skb) { skb = manage_oob(skb, sk, flags, copied); - if (!skb) { + if (!skb && copied) { unix_state_unlock(sk); - if (copied) - break; - goto redo; + break; } } #endif From patchwork Tue Apr 9 22:52:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13623292 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ADA3757F6 for ; Tue, 9 Apr 2024 22:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=99.78.197.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703229; cv=none; b=epxZ24ktv0sRCsU5r5S4W2QHBdcetCeRkzBa2WiM0XyYwJ16cu5yGT47YYLoXWBTv3TTcc5teJ91luuIDty8Lwp3/X8O3Tpqx52nqZp9zttKBuj9W0flmwb/ua3qsPxPLLMkyARtwnJT9ZN02kKTBJJHwIEB37x/jYzSpNiofj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712703229; c=relaxed/simple; bh=4HmgNfMh8fuok6hn09TbuBodW1FzUfufzUZUTjC65xw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uEndCJeYgU4nF0bt77z7diC4IcHhh5U1ya+xNoOPYVfGsiJTCCvHaEUWfc769AEPalyH3bpL3TGMgSP8tYujIh5mLi/fySps/a8A8Ke/mcxRdeEow9eFSWpK9qs0zQQYdHQWLaKoreEQusK1b5HFRagdBs4fOwM3GNT5kWiooEE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=lATJ68EL; arc=none smtp.client-ip=99.78.197.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="lATJ68EL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1712703228; x=1744239228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sQeDHEHqLBFN8588bgL2rXw+BYg4fC2ZXoFvUPuAa3I=; b=lATJ68ELFR6Q4JH4MI5YZA5BRIOVLRfzMkd5r+0uBub26D8Fc+eJvt1U DlaIxMWQ8Us5aXtgGbAdNR1GT6YJlQPmCS29b7dtTeXvhAhjfvOdCbAqt CpvJp4pJUm3Dz2o1vs7dr0XfcN7j2ZjxSYCiWFnqkHLEjSaEmtOhsfuID M=; X-IronPort-AV: E=Sophos;i="6.07,190,1708387200"; d="scan'208";a="286468105" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 22:53:45 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.38.20:35717] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.12.255:2525] with esmtp (Farcaster) id 912aca76-2cda-4a36-b647-12315ee3860b; Tue, 9 Apr 2024 22:53:44 +0000 (UTC) X-Farcaster-Flow-ID: 912aca76-2cda-4a36-b647-12315ee3860b Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 9 Apr 2024 22:53:44 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.45) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 9 Apr 2024 22:53:41 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Rao shoaib , Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net 3/3] af_unix: Prepare MSG_OOB deprecation. Date: Tue, 9 Apr 2024 15:52:09 -0700 Message-ID: <20240409225209.58102-4-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240409225209.58102-1-kuniyu@amazon.com> References: <20240409225209.58102-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D041UWB004.ant.amazon.com (10.13.139.143) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org 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 --- 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