From patchwork Tue May 18 07:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shoaib Rao X-Patchwork-Id: 12264031 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78021C43461 for ; Tue, 18 May 2021 07:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F7F261261 for ; Tue, 18 May 2021 07:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347234AbhERHpp (ORCPT ); Tue, 18 May 2021 03:45:45 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:38284 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239746AbhERHpk (ORCPT ); Tue, 18 May 2021 03:45:40 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14I7YrOJ194741; Tue, 18 May 2021 07:43:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=3/Lemjh3GNztbMfZritdQcQEjPG/zvuY2VSF+TTIYT4=; b=LqUgfmase9XqaStJKYXMWR0x6lAf0aK3YY8I0wVdhy/fE5dFgn8WJ5U+TJmKcbdiExi0 SmrPx28Qdv6aMSXcnxyulxnpdgi4isQU4+rJrVjgjYvL+XfbkwY5NCTCABZmxXdhtW43 hx0zbR+t5ou/4+8xhZ+IpTqi3gmkz6qMtWbiONxl6Q/qDAx5AxGXT6JVbUV+VmEV8NdU 2pw4jf5BMWbYWh5nRaZqp1UWT0a4cnkD+tmUKCmOrUydyv/B4Qd8YLGqk93Nb8Ejn9b3 QVkdLTnnxY87v8klJwGbcaMRI1aaV2amYwPpc0XlbQdX2wzUy5btRW4lQRZoCUExISN8 uQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 38j68mdd2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 May 2021 07:43:54 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14I7eONx155427; Tue, 18 May 2021 07:43:53 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by userp3020.oracle.com with ESMTP id 38kb37pgy1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 May 2021 07:43:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MW/YolgYCOVJ7UYLyJL4DkFo0qvG/0TpW/+yQokHhWU5SgHFwyq/cQAXGcoQMTcDgAjH2+8oSSo19qmmU6BI7wmRYcbqlu/qtkhe3DrdWc/GlPObGufPTw+c5ZvZHN7PAQMWt3kgCvzCTi880pS+47sxtuUuP8VZ47peGOl4NC9ln5XadPNCSPeIzmCbuCrM5/McDdYIZJfGDdHGvmVv7kM+ceVAeikdVhapBQ40hQ1hDiTGl2w7vgLu7/ZKFs+jogZtDOIDtrYYqsITgL7w76Mhdb4jIUe/w7Qzd1m6Q4xFhCwrTqq/q/yzFWuhmG7y6H4QpAWJ+1DTLbMonT8Aeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3/Lemjh3GNztbMfZritdQcQEjPG/zvuY2VSF+TTIYT4=; b=X19N4ps6oC6FkD+0fJHf5dwCfK3EcygA+vJSqW1/WQvi1FyeNTheeXB38H7dVkv4AU14EXUpw9riuUukSY1/pzuho7TqqScbqY8i2fJqGmdo9fRv1OrGNE9wOnnsjaTukTfme/pWCeanqkKkBVu7Uau0YnIn18/TLXwSOu4Umi4gbXoKgyaI0BPP3oMSxJim3M2yeXPMrnDu48L4XNINHwTX5TAi8Mu5vS2O8b+bO9Dm5INNmj9LAwlA5vcBii1ScpPSu7s9OVisWox1KRO96Q3Bw6izqlfBnA0pFZfv1uAEuJegc8su2Jn3H85ejV//scjHHtTpR91giRwKD46goA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3/Lemjh3GNztbMfZritdQcQEjPG/zvuY2VSF+TTIYT4=; b=kt4GPF32YsSeul1Y/npOwqailSXZJZzGrfaGQCPqj5i6dAR/Ue9FD4zukXNIaOoZcAJnZ+rI2vv0QEwgmt+eelBwlT1v/9aDOdig1MllDv+pOZC8tjY3ydmXKpgqemuGBl+s+DO5kOVGmUhWJVRjDATFgwOtoJUKCLpBNmvwRTc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from SJ0PR10MB4494.namprd10.prod.outlook.com (2603:10b6:a03:2d4::12) by BYAPR10MB3717.namprd10.prod.outlook.com (2603:10b6:a03:11a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.28; Tue, 18 May 2021 07:43:51 +0000 Received: from SJ0PR10MB4494.namprd10.prod.outlook.com ([fe80::103c:70e1:fefe:a5b]) by SJ0PR10MB4494.namprd10.prod.outlook.com ([fe80::103c:70e1:fefe:a5b%7]) with mapi id 15.20.4129.032; Tue, 18 May 2021 07:43:51 +0000 From: Rao Shoaib To: netdev@vger.kernel.org Cc: kuba@kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, matthew.wilcox@oracle.com, rao.shoaib@oracle.com Subject: [RFC net-next af_unix v1 1/1] net:af_unix: Allow unix sockets to raise SIGURG Date: Tue, 18 May 2021 00:43:43 -0700 Message-Id: <20210518074343.980438-1-Rao.Shoaib@oracle.com> X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2606:b400:8301:1010::16aa] X-ClientProxiedBy: SA9PR13CA0003.namprd13.prod.outlook.com (2603:10b6:806:21::8) To SJ0PR10MB4494.namprd10.prod.outlook.com (2603:10b6:a03:2d4::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from shoaib-laptop.us.oracle.com (2606:b400:8301:1010::16aa) by SA9PR13CA0003.namprd13.prod.outlook.com (2603:10b6:806:21::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.11 via Frontend Transport; Tue, 18 May 2021 07:43:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 014a99d6-f73e-40ad-6ad5-08d919d0adcc X-MS-TrafficTypeDiagnostic: BYAPR10MB3717: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3dPaF69XeouZW/iY+pFdHw8sjicyNW13bjECfBCvFaCYoT7Z8Oe3G+HPK3XRVoe4OzJHxIskhZDiWUIHXTAx0XhTc92b7/3qpbeuQf4YdZU2/7uWJOk2h4QM9xWrDJvJSfM4W///KW+YPGkr+sW0HIYwtLED1cQwYN7JgLr1066UpEA/H3E5SIO4K8Cb+lpQX77Y1h4YRnk/Jvi7QFgmqq1Cd0x7/PBdKjjNXXzf1I8oDAKGz8BQXPRNw755O5Kd8dusw5sAoLj2OkLCDwuCWbrt1mDxj5Vo13kR/rK54wlXYk+2wcalFnlht1Y/XLGFa23o34hOE8CH5jvN8+RxiH22r34bW1ujR7Xz/PO8/lLuHGXtDsXxMqKcfyHdJ1OkyBblwybWxFxnVh9I/cgON61lgOobMbbgSzs3wuUzw9A4+DTCPUI2Cs3eWMOAQJXqzK4DrTuhJCkwEwLRTei0kaZNBgnaz8BCCClQqBAf/DMusgkeYE+Tt7jFn642Q4lr7L/p15e3PyjAutcjX05ry20govucDeXsGym3ETZzzHTeQDl7gCUDqjPhK8J+YrzSwauof4VtmdEne6CgDDAKW0cFb/h5Im4QLrHAmIb+FW8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4494.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(346002)(376002)(39860400002)(136003)(366004)(2616005)(316002)(107886003)(66476007)(66556008)(66946007)(8936002)(36756003)(8676002)(6916009)(52116002)(5660300002)(86362001)(6666004)(1076003)(38100700002)(2906002)(4326008)(7696005)(186003)(83380400001)(6486002)(16526019)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IFS2v1/jbBqq5dduhqq+MGUDO+f5gyksRDZ8N13cvUJFwvsEl7j8LvheG6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JVLe9kfBK/E4Tnl0P8ZiDTxXQfphZgSSZYC3IamdsTSb1cEOsKvFPZK9X6u2xy9ZxlV+z+Tf3TFkbMv02z3fpxZ2AkzLmzrZx3+AADkzHROz6icAjvO5LBS1obBIC14opF0acubNjTw0w8MsH57Jo/LD/UIY+Dw2uczEqAEAUbjs1Tncl2TQ3jFr9uXQtYeGbW+QxHb5vrlrFt5FeoatwUYbfbtTDI1bZrVgSl9OP5X4w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 014a99d6-f73e-40ad-6ad5-08d919d0adcc X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4494.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2021 07:43:51.0955 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 35878THLTdlB3PiQIMV5Wuu90liisEKli6fviP+y4Q8nuhTnPB9yy/au0DmQtdGgbiWGqk1jyYVNTW2MGDZOkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3717 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9987 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105180054 X-Proofpoint-ORIG-GUID: XgBvNntRkGa_bIGs07Yn2oXX0ybUZUP9 X-Proofpoint-GUID: XgBvNntRkGa_bIGs07Yn2oXX0ybUZUP9 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9987 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 suspectscore=0 clxscore=1011 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105180053 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: Rao Shoaib TCP sockets allow SIGURG to be sent to the process holding the other end of the socket. Extend Unix sockets to have the same ability. The API is the same in that the sender uses sendmsg() with MSG_OOB to raise SIGURG. Unix sockets behave in the same way as TCP sockets with SO_OOBINLINE set. SIGURG is ignored by default, so applications which do not know about this feature will be unaffected. In addition to installing a SIGURG handler, the receiving application must call F_SETOWN or F_SETOWN_EX to indicate which process or thread should receive the signal. Signed-off-by: Rao Shoaib Signed-off-by: Matthew Wilcox Reviewed-by: Matthew Wilcox (Oracle) --- net/unix/af_unix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 5a31307ceb76..c8400c002882 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1838,8 +1838,6 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, return err; err = -EOPNOTSUPP; - if (msg->msg_flags&MSG_OOB) - goto out_err; if (msg->msg_namelen) { err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP; @@ -1904,6 +1902,9 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, sent += size; } + if (msg->msg_flags & MSG_OOB) + sk_send_sigurg(other); + scm_destroy(&scm); return sent;