linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mihai Moldovan <ionic@ionic.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: linux-arm-msm@vger.kernel.org,
	Manivannan Sadhasivam <mani@kernel.org>,
	Denis Kenzior <denkenz@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Simon Horman <horms@kernel.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v5 01/11] net: qrtr: ns: validate msglen before ctrl_pkt use
Date: Fri, 22 Aug 2025 21:08:47 +0200	[thread overview]
Message-ID: <d5ae397b-a33a-42c9-91a1-5ba3fcc367a5@ionic.de> (raw)
In-Reply-To: <20250815110900.2da8f3c5@kernel.org>

* On 8/15/25 20:09, Jakub Kicinski wrote:
> If this is a fix it has to go to net, then once it reaches Linus's tree
> the dependent patches should be reposted for net-next.

Thanks.

Will split out the two commits and resend the resend of the series later on 
after the fixes have been merged.

Might take me a few weeks, I'm currently very limited on time and internet access.


>> diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
>> index 3de9350cbf30..2bcfe539dc3e 100644
>> --- a/net/qrtr/ns.c
>> +++ b/net/qrtr/ns.c
>> @@ -619,6 +619,9 @@ static void qrtr_ns_worker(struct work_struct *work)
>>   			break;
>>   		}
>>   
>> +		if ((size_t)msglen < sizeof(*pkt))
>> +			break;
> 
> why not continue?

I don't really know and am not familiar with the QRTR protocol, but here's my 
best guess:

Since we're using non-blocking I/O, it doesn't seem to make sense to continue, 
because the next receive call would just break out anyway once it returns no 
data at all. Notice that we're also breaking out for -EAGAIN.

Also, if we somehow got a short read, and we're currently dropping the buffer we 
just read, any additional data after a subsequent receive would be garbage to us 
anyway. We'd probably have to keep the old buffer content around and concatenate 
it with data returned from a new receive call.



Mihai

  reply	other threads:[~2025-08-22 19:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12  1:35 [PATCH v5 00/11] QRTR Multi-endpoint support Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 01/11] net: qrtr: ns: validate msglen before ctrl_pkt use Mihai Moldovan
2025-08-15 18:09   ` Jakub Kicinski
2025-08-22 19:08     ` Mihai Moldovan [this message]
2025-08-22 22:21       ` Jakub Kicinski
2025-08-12  1:35 ` [PATCH v5 02/11] net: qrtr: allocate and track endpoint ids Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 03/11] net: qrtr: fit node ID + port number combination into unsigned long Mihai Moldovan
2025-08-15 18:10   ` Jakub Kicinski
2025-08-12  1:35 ` [PATCH v5 04/11] net: qrtr: support identical node ids Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 05/11] net: qrtr: Report sender endpoint in aux data Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 06/11] net: qrtr: Report endpoint for locally generated messages Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 07/11] net: qrtr: Allow sendmsg to target an endpoint Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 08/11] net: qrtr: allow socket endpoint binding Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 09/11] net: qrtr: Drop remote {NEW|DEL}_LOOKUP messages Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 10/11] net: qrtr: ns: support multiple endpoints Mihai Moldovan
2025-08-12  1:35 ` [PATCH v5 11/11] net: qrtr: mhi: Report endpoint id in sysfs Mihai Moldovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5ae397b-a33a-42c9-91a1-5ba3fcc367a5@ionic.de \
    --to=ionic@ionic.de \
    --cc=davem@davemloft.net \
    --cc=denkenz@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).