Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp702895pxb; Tue, 5 Apr 2022 19:27:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLiiyD+ld1xIvobGKPVWWIK7ElGSrQL8Sl+UesOj03fLDVvdcmtn7KT1MyO52w1c8wEPuB X-Received: by 2002:a17:906:a44c:b0:6e7:ed8b:5126 with SMTP id cb12-20020a170906a44c00b006e7ed8b5126mr6263920ejb.75.1649212063823; Tue, 05 Apr 2022 19:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212063; cv=none; d=google.com; s=arc-20160816; b=aIF2pL3xlIQHHLdrXUJrIkZgfwsXwmXFyNIu53AnO4xqLZ/9ercYxBuWlIqI/Id3Ud jSEUPdasAO4FYGqoq3zzwfe04Ud9wAT72QV9BfuR4hgsnnjH0zyM07eo1s27A/xsZojD vhrWgF7sfLDdkbgAXsYwCHaea/W+TfLyLGAY1kVk8tWnQcV/EmiwHGEzIFcvwGSxAiLG ZBVX8mF2qyJ/cJgMfjSAomDMOJYi7ngl8pspQBLTHnCNRrfLqK59uWeYn/e0SNRslhU/ a93CAQoqz1tWUIrgbMMLbttnhD3mx3Myz0VbCSTD1cI8D5bSVtb5QgR7Z/esZFdJcSqc rfTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lzIaFL/eor1rYPspB/XVS/o+KooAwKCrivrDuLNhKY4=; b=xdrXglSsRlKJWMqswT5AbfTu/BQO+P1OwYAEKmhWoDt4/AzmQ80AshsJYDO3Ydx6Xj gfv5Oo+xPIJmSfmvP2OSXNN7reMw212m96cfWe4e0oJNsVFvO9GikQRQkEQirEZ9nzfO zjFagJsHg9YBwHpNcjgApkOwMtGsHGC70EEifVnmg2TRtt/sEHV+OLpUR3lnljTBsMfU vG3ZX5CKAeaAuTVogok13PdXsZ/BvaH/mwf0kUXDv+K9ZBHUiQVom4o5DMBzK9/8uxfh 8cnb4SwRqISZuj1laYx3rb2Gb4GBN6qdziu5rvCL3u2sbAksWMJNrZSmOyXMZxm3+ZrM iMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xbGWWZlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wj21-20020a170907051500b006dfa89bee2asi6054702ejb.593.2022.04.05.19.27.17; Tue, 05 Apr 2022 19:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xbGWWZlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243275AbiDEN7U (ORCPT + 99 others); Tue, 5 Apr 2022 09:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347892AbiDEJ2j (ORCPT ); Tue, 5 Apr 2022 05:28:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE44ADFF98; Tue, 5 Apr 2022 02:15:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 87B8E61645; Tue, 5 Apr 2022 09:15:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99FD4C385A0; Tue, 5 Apr 2022 09:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150156; bh=+I1kIkWfWuQyDHUH07N7TM2+SinRMRMesn+il5ED1Oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xbGWWZlSh7iC5kHKxzH7RqRjxdmCNjZdBYmjSIz8xNgZLMiQSeGqXYi/ap4q5XcCu lrEVLVorQlggEaxw6kb1ijutM4KklDccvhlOHoigg8oLzt0mujN80+7I/Rg8oQs63j +02x0m1FWsoyjHbCW9nw4lu7LwRm7WqSBtzaYCwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuniyuki Iwashima , "David S. Miller" Subject: [PATCH 5.16 0975/1017] af_unix: Support POLLPRI for OOB. Date: Tue, 5 Apr 2022 09:31:28 +0200 Message-Id: <20220405070423.146405004@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuniyuki Iwashima commit d9a232d435dcc966738b0f414a86f7edf4f4c8c4 upstream. The commit 314001f0bf92 ("af_unix: Add OOB support") introduced OOB for AF_UNIX, but it lacks some changes for POLLPRI. Let's add the missing piece. In the selftest, normal datagrams are sent followed by OOB data, so this commit replaces `POLLIN | POLLPRI` with just `POLLPRI` in the first test case. Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/unix/af_unix.c | 4 ++++ tools/testing/selftests/net/af_unix/test_unix_oob.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -3049,6 +3049,10 @@ static __poll_t unix_poll(struct file *f mask |= EPOLLIN | EPOLLRDNORM; if (sk_is_readable(sk)) mask |= EPOLLIN | EPOLLRDNORM; +#if IS_ENABLED(CONFIG_AF_UNIX_OOB) + if (READ_ONCE(unix_sk(sk)->oob_skb)) + mask |= EPOLLPRI; +#endif /* Connection-based need to check for termination and startup */ if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) && --- a/tools/testing/selftests/net/af_unix/test_unix_oob.c +++ b/tools/testing/selftests/net/af_unix/test_unix_oob.c @@ -218,10 +218,10 @@ main(int argc, char **argv) /* Test 1: * veriyf that SIGURG is - * delivered and 63 bytes are - * read and oob is '@' + * delivered, 63 bytes are + * read, oob is '@', and POLLPRI works. */ - wait_for_data(pfd, POLLIN | POLLPRI); + wait_for_data(pfd, POLLPRI); read_oob(pfd, &oob); len = read_data(pfd, buf, 1024); if (!signal_recvd || len != 63 || oob != '@') {