lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 18 Oct 2020 10:46:35 +0200
From:   Oliver Hartkopp <socketcan@...tkopp.net>
To:     Marc Kleine-Budde <mkl@...gutronix.de>,
        Oleksij Rempel <o.rempel@...gutronix.de>,
        dev.kurt@...dijck-laurijssen.be, wg@...ndegger.com
Cc:     netdev@...r.kernel.org, kernel@...gutronix.de,
        linux-can@...r.kernel.org
Subject: Re: [RFC] can: can_create_echo_skb(): fix echo skb generation: always
 use skb_clone()

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.

Regards,
Oliver

Powered by blists - more mailing lists