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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <eaa06c4f-5947-c24e-1415-71c625b1c84c@linuxfoundation.org>
Date:   Fri, 16 Oct 2020 11:03:59 -0600
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Andrey Konovalov <andreyknvl@...gle.com>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        USB list <linux-usb@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Shuah Khan <shuah@...nel.org>,
        Alexander Potapenko <glider@...gle.com>,
        Marco Elver <elver@...gle.com>,
        Aleksandr Nogikh <nogikh@...gle.com>,
        Nazime Hande Harputluoglu <handeharput@...il.com>,
        Nazime Hande Harputluoglu <handeharputlu@...gle.com>,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v2] kcov, usbip: collect coverage from vhci_rx_loop

On 10/16/20 8:18 AM, Andrey Konovalov wrote:
> On Tue, Oct 13, 2020 at 7:28 PM Shuah Khan <skhan@...uxfoundation.org> wrote:
>>
>> On 10/12/20 11:10 AM, Andrey Konovalov wrote:
>>> From: Nazime Hande Harputluoglu <handeharputlu@...gle.com>
>>>
>>> Add kcov_remote_start()/kcov_remote_stop() annotations to the
>>> vhci_rx_loop() function, which is responsible for parsing USB/IP packets
>>> coming into USB/IP client.
>>>
>>> Since vhci_rx_loop() threads are spawned per vhci_hcd device instance, the
>>> common kcov handle is used for kcov_remote_start()/stop() annotations
>>> (see Documentation/dev-tools/kcov.rst for details). As the result kcov
>>> can now be used to collect coverage from vhci_rx_loop() threads.
>>>
>>> Signed-off-by: Nazime Hande Harputluoglu <handeharputlu@...gle.com>
>>> ---
>>>
>>> Changes v1->v2:
>>> - Fix spacing issues.
>>> - Add ifdef CONFIG_KCOV around kcov_handle in usbip_device struct.
>>>
>>
>> Does this compile without CONFIG_KCOV?
>>
>>> ---
>>>    drivers/usb/usbip/usbip_common.h |  4 ++++
>>>    drivers/usb/usbip/vhci_rx.c      |  3 +++
>>>    drivers/usb/usbip/vhci_sysfs.c   | 12 +++++++-----
>>>    3 files changed, 14 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
>>> index 8be857a4fa13..0906182011d6 100644
>>> --- a/drivers/usb/usbip/usbip_common.h
>>> +++ b/drivers/usb/usbip/usbip_common.h
>>> @@ -277,6 +277,10 @@ struct usbip_device {
>>>                void (*reset)(struct usbip_device *);
>>>                void (*unusable)(struct usbip_device *);
>>>        } eh_ops;
>>> +
>>> +#ifdef CONFIG_KCOV
>>> +     u64 kcov_handle;
>>> +#endif
> 
> Hi Shuah,
> 
> We could have this field always defined, which allows us to not check
> CONFIG_KCOV in the places where it's used (this is what we do for
> vhost; the kcov functions will be optimized away). Or we could keep
> the ifdef CONFIG_KCOV check here, and then add the same checks to
> other places.
> 
> What would be your preference here?

Let's keep it in ifdef CONFIG_KCOV and add checks to keep this
limited to just the kcov case.

thanks,
-- Shuah




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ