netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	dev.kurt@vandijck-laurijssen.be, wg@grandegger.com
Cc: netdev@vger.kernel.org, kernel@pengutronix.de, linux-can@vger.kernel.org
Subject: Re: [RFC] can: can_create_echo_skb(): fix echo skb generation: always use skb_clone()
Date: Mon, 19 Oct 2020 08:28:16 +0200	[thread overview]
Message-ID: <4e794974-8b87-9961-a144-fe9f5c236de6@pengutronix.de> (raw)
In-Reply-To: <9ad203ae-9a50-3d96-1ac9-3e45ca9c1989@hartkopp.net>


[-- Attachment #1.1: Type: text/plain, Size: 1595 bytes --]

On 10/18/20 10:46 AM, Oliver Hartkopp wrote:
> Oh, answering myself ...
> 
> On 17.10.20 21:13, Oliver Hartkopp wrote:
>>
>>
>> On 16.10.20 21:36, Marc Kleine-Budde wrote:
>>> On 2/14/20 1:09 PM, Oleksij Rempel wrote:
>>>> Hi all,
>>>>
>>>> any comments on this patch?
>>>
>>> I'm going to take this patch now for 5.10....Comments?
>>
>> Yes.
>>
>> Removing the sk reference will lead to the effect, that you will receive 
>> the CAN frames you have sent on that socket - which is disabled by default:
>>
>> https://elixir.bootlin.com/linux/latest/source/net/can/raw.c#L124
>>
>> See concept here:
>>
>> https://elixir.bootlin.com/linux/latest/source/Documentation/networking/can.rst#L560 
>>
>>
>> How can we maintain the CAN_RAW_RECV_OWN_MSGS to be disabled by default 
>> and fix the described problem?
> 
>>>>> +    nskb = skb_clone(skb, GFP_ATOMIC);
>>>>> +    if (unlikely(!nskb)) {
>>>>> +        kfree_skb(skb);
>>>>> +        return NULL;
>>>>>       }
>>>>> -    /* we can assume to have an unshared skb with proper owner */
>>>>> -    return skb;
>>>>> +    can_skb_set_owner(nskb, skb->sk);
> 
> skb-> sk is still set here - so everything should be fine.
> 
> Sorry for the noise.

Is this a Acked-by/Reviewed-by?

regrards,
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: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-10-19  6:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 13:26 [RFC] can: can_create_echo_skb(): fix echo skb generation: always use skb_clone() Oleksij Rempel
2020-02-03 13:43 ` Naresh Kamboju
2020-02-03 13:48   ` Marc Kleine-Budde
2020-02-03 13:52     ` Marc Kleine-Budde
2020-02-03 14:36       ` Naresh Kamboju
2020-02-14 12:09 ` Oleksij Rempel
2020-10-16 19:36   ` Marc Kleine-Budde
2020-10-17 19:13     ` Oliver Hartkopp
2020-10-18  8:46       ` Oliver Hartkopp
2020-10-19  6:28         ` Marc Kleine-Budde [this message]
2020-10-19  6:53           ` Oliver Hartkopp

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=4e794974-8b87-9961-a144-fe9f5c236de6@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.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).