All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature
@ 2022-03-28 11:36 Oliver Hartkopp
  2022-03-28 12:22 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2022-03-28 11:36 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Derek Will

In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading
from socket") a new check for recvmsg flags has been introduced that
only checked for the flags that are handled in isotp_recvmsg() itself.

This accidentally removed the MSG_PEEK feature flag which is processed
later in the call chain in __skb_try_recv_from_queue().

Add MSG_PEEK to the set of valid flags to restore the feature.

Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
From: Derek Will <derekrobertwill@gmail.com>
Tested-by: Derek Will <derekrobertwill@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 net/can/isotp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/can/isotp.c b/net/can/isotp.c
index f6f8ba1f816d..bafb0fb5f0e0 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -1048,11 +1048,11 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 	struct sk_buff *skb;
 	struct isotp_sock *so = isotp_sk(sk);
 	int noblock = flags & MSG_DONTWAIT;
 	int ret = 0;
 
-	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC))
+	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
 		return -EINVAL;
 
 	if (!so->bound)
 		return -EADDRNOTAVAIL;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature
  2022-03-28 11:36 [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature Oliver Hartkopp
@ 2022-03-28 12:22 ` Marc Kleine-Budde
  2022-03-31  6:28   ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2022-03-28 12:22 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Derek Will

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

On 28.03.2022 13:36:11, Oliver Hartkopp wrote:
> In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading
> from socket") a new check for recvmsg flags has been introduced that
> only checked for the flags that are handled in isotp_recvmsg() itself.
> 
> This accidentally removed the MSG_PEEK feature flag which is processed
> later in the call chain in __skb_try_recv_from_queue().
> 
> Add MSG_PEEK to the set of valid flags to restore the feature.
> 
> Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
> Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
> From: Derek Will <derekrobertwill@gmail.com>

If this patch is from Derek Will, we need Derek's Signed-off-by [1] and
change to author information accordingly.

[1] https://elixir.bootlin.com/linux/v5.12/source/Documentation/process/submitting-patches.rst#L356

> Tested-by: Derek Will <derekrobertwill@gmail.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

If Derek replies to this mail with his S-o-b line, I'll fix the author
while applying the patch.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature
  2022-03-28 12:22 ` Marc Kleine-Budde
@ 2022-03-31  6:28   ` Oliver Hartkopp
  2022-03-31  7:50     ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2022-03-31  6:28 UTC (permalink / raw)
  To: Marc Kleine-Budde, Derek Will; +Cc: linux-can

Hi Marc,

On 28.03.22 14:22, Marc Kleine-Budde wrote:
> On 28.03.2022 13:36:11, Oliver Hartkopp wrote:
>> In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading
>> from socket") a new check for recvmsg flags has been introduced that
>> only checked for the flags that are handled in isotp_recvmsg() itself.
>>
>> This accidentally removed the MSG_PEEK feature flag which is processed
>> later in the call chain in __skb_try_recv_from_queue().
>>
>> Add MSG_PEEK to the set of valid flags to restore the feature.
>>
>> Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
>> Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
>> From: Derek Will <derekrobertwill@gmail.com>
> 
> If this patch is from Derek Will, we need Derek's Signed-off-by [1] and
> change to author information accordingly.
> 
> [1] https://elixir.bootlin.com/linux/v5.12/source/Documentation/process/submitting-patches.rst#L356
> 
>> Tested-by: Derek Will <derekrobertwill@gmail.com>
>> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> 
> If Derek replies to this mail with his S-o-b line, I'll fix the author
> while applying the patch.

Although I would have liked Derek to show up as author of the patch 
(because of he found the issue) he has not been reacting for some time now.

Therefore I would suggest to take the authorship (I wrote the commit 
message anyway) and tag Derek with
Reported/Suggested?/Tested-by if you do not want to wait to push the 
other pending patches to Jakub.

Best regards,
Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature
  2022-03-31  6:28   ` Oliver Hartkopp
@ 2022-03-31  7:50     ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2022-03-31  7:50 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: Derek Will, linux-can

[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]

On 31.03.2022 08:28:54, Oliver Hartkopp wrote:
> > > Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
> > > Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
> > > From: Derek Will <derekrobertwill@gmail.com>
> > 
> > If this patch is from Derek Will, we need Derek's Signed-off-by [1] and
> > change to author information accordingly.
> > 
> > [1] https://elixir.bootlin.com/linux/v5.12/source/Documentation/process/submitting-patches.rst#L356
> > 
> > > Tested-by: Derek Will <derekrobertwill@gmail.com>
> > > Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> > 
> > If Derek replies to this mail with his S-o-b line, I'll fix the author
> > while applying the patch.
> 
> Although I would have liked Derek to show up as author of the patch
> (because of he found the issue) he has not been reacting for some time
> now.
> 
> Therefore I would suggest to take the authorship (I wrote the commit
> message anyway) and tag Derek with Reported/Suggested?/Tested-by if
> you do not want to wait to push the other pending patches to Jakub.

I've changed it to all 3: Reported/Suggested/Tested-by. :)

| commit e382fea8ae54f5bb62869c6b69b33993d43adeca
| Author: Oliver Hartkopp <socketcan@hartkopp.net>
| Date:   Mon Mar 28 13:36:11 2022 +0200
| 
|     can: isotp: restore accidentally removed MSG_PEEK feature
|     
|     In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when
|     reading from socket") a new check for recvmsg flags has been
|     introduced that only checked for the flags that are handled in
|     isotp_recvmsg() itself.
|     
|     This accidentally removed the MSG_PEEK feature flag which is processed
|     later in the call chain in __skb_try_recv_from_queue().
|     
|     Add MSG_PEEK to the set of valid flags to restore the feature.
|     
|     Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
|     Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
|     Link: https://lore.kernel.org/all/20220328113611.3691-1-socketcan@hartkopp.net
|     Reported-by: Derek Will <derekrobertwill@gmail.com>
|     Suggested-by: Derek Will <derekrobertwill@gmail.com>
|     Tested-by: Derek Will <derekrobertwill@gmail.com>
|     Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
|     Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Writing a pull request after this mail.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-31  7:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 11:36 [PATCH] can: isotp: restore accidentally removed MSG_PEEK feature Oliver Hartkopp
2022-03-28 12:22 ` Marc Kleine-Budde
2022-03-31  6:28   ` Oliver Hartkopp
2022-03-31  7:50     ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.