Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2073342pxb; Fri, 29 Jan 2021 12:22:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAMj5uSRE7Ivno2cu/7D86kGc+eLIDa+Xjw31K/tYYDxFdjZxWyNxuXJ4jQWeibXZ4R/xs X-Received: by 2002:a05:6402:1a24:: with SMTP id be4mr1013813edb.248.1611951754278; Fri, 29 Jan 2021 12:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611951754; cv=none; d=google.com; s=arc-20160816; b=rFAevC7qjwpYcUE0KwdQLKKJhS1axfT9k+fQ3yvuYU2T1tfcSndUOsW+grgU5MsHfq tXLcPn24Nzmd/zpAr89jYbQ9jpXx6ByFKyG+FpqhzMS/kFzJBvfzTrJ4hHIF0sGH2yj0 EE2ZeEIzWZFrQW3hksvV0nNXY1na/OdpeTopDSQCxuurx9kjTzrxy3h6xfuY4l8ObIHI NliSxz6J0kYXMm7DBMHDXwsH2WEcBht+SLAk4SpTnR9/YasQ8f0TysBaiIQ2982FSumi lgURXiMuc0u4GBLh4SukQaUa+1NZ+YXVPHhEcfcwt4AolrUunCZ6lQHPX7QADJFo9LRX Lrsw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+BYkQfn3CSZhImY6aP95/nYd251TeU/ByQRjk4exb3c=; b=DXz8YW1DoEF2Y7dRorBYbYuzZBRaYTWRjp9ueKeQr8snQFgLO6jpbzWl3aKIl5ogZG lkFgdrKOiUeAno68u5EKBnRQ9Q2JMYH7xvTl0RCaApBql8Mcq/W82Jlx1ksUz19T9uGB OQW+Ga5nINvXNngJgVCGSYLnYczyRp7CPBNCJc0760bUQo6vSEkiurEFZilwdpsunOW5 knEHn28clPJnZO42RQOM034970lxE4f7VWxGilYoMVduzEIvVttsJNhiV/Ij7yYIdM8k roTttdzGd71NNpLVS83nVThpjurWnVbMF9ihu8di2MECYtFjWQufzIv/dgVNZOsWU9UC cS9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VzHl6YgH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba30si6012597edb.470.2021.01.29.12.22.10; Fri, 29 Jan 2021 12:22:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VzHl6YgH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbhA2UTV (ORCPT + 99 others); Fri, 29 Jan 2021 15:19:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbhA2UTU (ORCPT ); Fri, 29 Jan 2021 15:19:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5BB264DD8; Fri, 29 Jan 2021 20:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611951519; bh=+Ej3SeW7aMCRrsn2KltEXlHItvZVOd+FbBUWcZ8glKM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VzHl6YgHWEuu95DpDf8mIGoKpNfEPXztGtxLF2I7KRgOzZwehQk3IyT3F0xD4tvyp bTMpFaxgWb6Zm9lYq+x4+XPEmr7hPi2NZ9EkLmzr1mmBUejGjav2XDpAni3dwfLONx yacR/oqyOIEtpmnxf3DxstxpVoCJ6y56OTGJEzAGiVLC70ktEAoajPoujoYLeBVH2P NLaD86b7Gh/26s1wHtiPibS6Slgu3zT1CCvRadr9Z8dVH+CPQgS8D4nKz3TphKZomg QOfQKPG9r/sp6GngHAZsxRzgL4Z0YKv3C3ljeHbRY3H0qv2HLflsPg3aN3XHqf7KOs CufAWgy2hDFmg== Date: Fri, 29 Jan 2021 12:18:37 -0800 From: Jakub Kicinski To: Shoaib Rao Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , andy.rudoff@intel.com Subject: Re: [PATCH] af_unix: Allow Unix sockets to raise SIGURG Message-ID: <20210129121837.467280fb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210122150638.210444-1-willy@infradead.org> <20210125153650.18c84b1a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <23fc3de2-7541-04c9-a56f-4006a7dc773f@oracle.com> <20210129110605.54df8409@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210129120250.269c366d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Jan 2021 12:10:21 -0800 Shoaib Rao wrote: > On 1/29/21 12:02 PM, Jakub Kicinski wrote: > > On Fri, 29 Jan 2021 11:48:15 -0800 Shoaib Rao wrote: =20 > >> Data was discarded because the flag was not supported, this patch > >> changes that but does not support any urgent data. =20 > > When you say it does not support any urgent data do you mean the > > message len must be =3D=3D 0 because something is checking it, or that > > the code does not support its handling? > > > > I'm perfectly fine with the former, just point me at the check, please.= =20 >=20 > The code does not care about the size of data -- All it does is that if=20 > MSG_OOB is set it will deliver the signal to the peer process=20 > irrespective of the length of the data (which can be zero length). Let's= =20 > look at the code of unix_stream_sendmsg() It does the following (sent is= =20 > initialized to zero) Okay. Let me try again. AFAICS your code makes it so that data sent with MSG_OOB is treated like any other data. It just sends a signal. So you're hijacking the MSG_OOB to send a signal, because OOB also sends a signal. But there is nothing OOB about the data itself. So=20 I'm asking you to make sure that there is no data in the message.=20 That way when someone wants _actual_ OOB data on UNIX sockets they=20 can implement it without breaking backwards compatibility of the=20 kernel uAPI. > while (sent < len) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 size =3D len - sent; > <..> >=20 > } >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (msg->msg_flags & MSG_OOB) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 sk_send_sigurg(other); >=20 > Before the patch there was a check above the while loop that checked the= =20 > flag and returned and error, that has been removed.