kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] usb: mtu3: disable USB2 LPM
       [not found] <1593410434-19406-1-git-send-email-chunfeng.yun@mediatek.com>
@ 2020-06-29  7:30 ` Markus Elfring
  2020-06-29  8:10   ` Greg Kroah-Hartman
       [not found] ` <1593410434-19406-2-git-send-email-chunfeng.yun@mediatek.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2020-06-29  7:30 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Felipe Balbi, Matthias Brugger,
	linux-usb, linux-arm-kernel, linux-mediatek
  Cc: kernel-janitors, linux-kernel

> A SuperSpeed device shall include the USB 2.0 extension descriptor
> and shall support LPM when operating in USB 2.0 HS mode(see usb3.2
> spec9.6.2.1). But we always don't support it, so disable it by
> default, otherwise device will enter LPM suspend mode when
> connected to Win10 system.

How do you think about a wording variant like the following?

   Change description:
   A SuperSpeed device shall include the USB 2.0 extension descriptor
   and shall support Link Power Management when operating in USB 2.0
   High Speed mode. (See also: USB 3.2 specification 9.6.2.1)
   But we do not support it generally. Thus disable this functionality
   by default.
   Otherwise, the device will enter LPM suspend mode when connected
   to Win10 system.


Would you like to add the tag “Fixes” to the commit message?

Regards,
Markus

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

* Re: [PATCH 2/2] usb: mtu3: fix NULL pointer dereference
       [not found] ` <1593410434-19406-2-git-send-email-chunfeng.yun@mediatek.com>
@ 2020-06-29  8:00   ` Markus Elfring
  2020-06-29  8:10     ` Greg Kroah-Hartman
  2020-06-30  7:28     ` Chunfeng Yun
  2020-06-29 16:19   ` Searching for initialisation of variables by function calls before null pointer checks Markus Elfring
  1 sibling, 2 replies; 6+ messages in thread
From: Markus Elfring @ 2020-06-29  8:00 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Felipe Balbi, Matthias Brugger,
	linux-usb, linux-arm-kernel, linux-mediatek
  Cc: Colin Ian King, kernel-janitors, linux-kernel

> Some pointers are dereferenced before successful checks.

I suggest to reconsider and improve the change description.

* Would a null pointer dereference be possible only with the variables “mep”
  and “mreq” in the implementation of the function “mtu3_gadget_dequeue”?

* How do you think about to adjust any more variable initialisations?

* Will it become helpful to add the tag “Fixes” to the commit message?

Regards,
Markus

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

* Re: [PATCH 2/2] usb: mtu3: fix NULL pointer dereference
  2020-06-29  8:00   ` [PATCH 2/2] usb: mtu3: fix NULL pointer dereference Markus Elfring
@ 2020-06-29  8:10     ` Greg Kroah-Hartman
  2020-06-30  7:28     ` Chunfeng Yun
  1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-06-29  8:10 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Felipe Balbi, linux-usb, kernel-janitors, linux-kernel,
	Matthias Brugger, linux-mediatek, Chunfeng Yun, Colin Ian King,
	linux-arm-kernel

On Mon, Jun 29, 2020 at 10:00:22AM +0200, Markus Elfring wrote:
> > Some pointers are dereferenced before successful checks.
> 
> I suggest to reconsider and improve the change description.
> 
> * Would a null pointer dereference be possible only with the variables “mep”
>   and “mreq” in the implementation of the function “mtu3_gadget_dequeue”?
> 
> * How do you think about to adjust any more variable initialisations?
> 
> * Will it become helpful to add the tag “Fixes” to the commit message?
> 
> Regards,
> Markus

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

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

* Re: [PATCH 1/2] usb: mtu3: disable USB2 LPM
  2020-06-29  7:30 ` [PATCH 1/2] usb: mtu3: disable USB2 LPM Markus Elfring
@ 2020-06-29  8:10   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-06-29  8:10 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Felipe Balbi, linux-usb, kernel-janitors, linux-kernel,
	Matthias Brugger, linux-mediatek, Chunfeng Yun, linux-arm-kernel

On Mon, Jun 29, 2020 at 09:30:58AM +0200, Markus Elfring wrote:
> > A SuperSpeed device shall include the USB 2.0 extension descriptor
> > and shall support LPM when operating in USB 2.0 HS mode(see usb3.2
> > spec9.6.2.1). But we always don't support it, so disable it by
> > default, otherwise device will enter LPM suspend mode when
> > connected to Win10 system.
> 
> How do you think about a wording variant like the following?
> 
>    Change description:
>    A SuperSpeed device shall include the USB 2.0 extension descriptor
>    and shall support Link Power Management when operating in USB 2.0
>    High Speed mode. (See also: USB 3.2 specification 9.6.2.1)
>    But we do not support it generally. Thus disable this functionality
>    by default.
>    Otherwise, the device will enter LPM suspend mode when connected
>    to Win10 system.
> 
> 
> Would you like to add the tag “Fixes” to the commit message?
> 
> Regards,
> Markus

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

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

* Re: Searching for initialisation of variables by function calls before null pointer checks
       [not found] ` <1593410434-19406-2-git-send-email-chunfeng.yun@mediatek.com>
  2020-06-29  8:00   ` [PATCH 2/2] usb: mtu3: fix NULL pointer dereference Markus Elfring
@ 2020-06-29 16:19   ` Markus Elfring
  1 sibling, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2020-06-29 16:19 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Felipe Balbi, Matthias Brugger,
	linux-usb, linux-arm-kernel, linux-mediatek, Coccinelle
  Cc: Colin Ian King, kernel-janitors, linux-kernel

> Some pointers are dereferenced before successful checks.

A source code place can be pointed out in an acceptable time frame for
a single file by the following script variant for the semantic patch language.


@display@
expression action1, action2;
expression* pointer1, pointer2;
identifier result1, result2;
statement is, es;
type t1, t2;
@@
 t1 result1 = <+...
*             action1(..., pointer1, ...)
              ...+>;
 ... when any
     when != pointer1
 t2 result2 = <+...
*             action2(..., pointer2, ...)
              ...+>;
 ... when any
     when != pointer1
     when != pointer2
*if (!pointer1 || !pointer2 || ...)
    is
 else
    es


elfring@Sonne:~/Projekte/Linux/next-patched> time spatch --profile --no-loops drivers/usb/mtu3/mtu3_gadget.c ~/Projekte/Coccinelle/janitor/show_pointer_usage_before_null_check11.cocci
…
@@ -332,14 +332,11 @@ error:

 static int mtu3_gadget_dequeue(struct usb_ep *ep, struct usb_request *req)
 {
-	struct mtu3_ep *mep = to_mtu3_ep(ep);
-	struct mtu3_request *mreq = to_mtu3_request(req);
 	struct mtu3_request *r;
 	unsigned long flags;
 	int ret = 0;
 	struct mtu3 *mtu = mep->mtu;

-	if (!ep || !req || mreq->mep != mep)
 		return -EINVAL;

 	dev_dbg(mtu->dev, "%s : req=%p\n", __func__, req);
---------------------
profiling result
---------------------
Main total                               : 2.030205 sec          1 count
Main.outfiles computation                : 1.648542 sec          1 count
…
real	0m2,122s
user	0m1,977s
sys	0m0,037s


I have tried this analysis approach out also for source files from
the software “Linux next-20200626”.

elfring@Sonne:~/Projekte/Linux/next-patched> XX=$(date) && spatch --no-loops --timeout 12 -j 4 --chunksize 1 -dir ~/Projekte/Linux/next-patched ~/Projekte/Coccinelle/janitor/show_pointer_usage_before_null_check11.cocci > ~/Projekte/Bau/Linux/scripts/Coccinelle/null/next/20200626/show_pointer_usage_before_null_check11.diff 2> ~/Projekte/Bau/Linux/scripts/Coccinelle/null/next/20200626/show_pointer_usage_before_null_check11-errors.txt; YY=$(date) && echo "$XX | $YY"
Mo 29. Jun 13:54:54 CEST 2020 | Mo 29. Jun 17:22:37 CEST 2020


Unfortunately, a lot of “exceptional” data processing results were logged then.

elfring@Sonne:~/Projekte/Bau/Linux/scripts/Coccinelle/null/next/20200626> grep 'EXN: Coccinelle_modules.Common.Timeout' show_pointer_usage_before_null_check11-errors.txt | wc -l
454


Will such a test run trigger any further development considerations?

Regards,
Markus

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

* Re: [PATCH 2/2] usb: mtu3: fix NULL pointer dereference
  2020-06-29  8:00   ` [PATCH 2/2] usb: mtu3: fix NULL pointer dereference Markus Elfring
  2020-06-29  8:10     ` Greg Kroah-Hartman
@ 2020-06-30  7:28     ` Chunfeng Yun
  1 sibling, 0 replies; 6+ messages in thread
From: Chunfeng Yun @ 2020-06-30  7:28 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, kernel-janitors,
	linux-kernel, linux-mediatek, Matthias Brugger, Colin Ian King,
	linux-arm-kernel

T24gTW9uLCAyMDIwLTA2LTI5IGF0IDEwOjAwICswMjAwLCBNYXJrdXMgRWxmcmluZyB3cm90ZToN
Cj4gPiBTb21lIHBvaW50ZXJzIGFyZSBkZXJlZmVyZW5jZWQgYmVmb3JlIHN1Y2Nlc3NmdWwgY2hl
Y2tzLg0KPiANCj4gSSBzdWdnZXN0IHRvIHJlY29uc2lkZXIgYW5kIGltcHJvdmUgdGhlIGNoYW5n
ZSBkZXNjcmlwdGlvbi4NCj4gDQo+ICogV291bGQgYSBudWxsIHBvaW50ZXIgZGVyZWZlcmVuY2Ug
YmUgcG9zc2libGUgb25seSB3aXRoIHRoZSB2YXJpYWJsZXMg4oCcbWVw4oCdDQo+ICAgYW5kIOKA
nG1yZXHigJ0gaW4gdGhlIGltcGxlbWVudGF0aW9uIG9mIHRoZSBmdW5jdGlvbiDigJxtdHUzX2dh
ZGdldF9kZXF1ZXVl4oCdPw0KPiANCj4gKiBIb3cgZG8geW91IHRoaW5rIGFib3V0IHRvIGFkanVz
dCBhbnkgbW9yZSB2YXJpYWJsZSBpbml0aWFsaXNhdGlvbnM/DQpZZXMsIEknbGwgZG8gaXQgaWYg
bmVlZCwgdGhhbmtzDQoNCj4gDQo+ICogV2lsbCBpdCBiZWNvbWUgaGVscGZ1bCB0byBhZGQgdGhl
IHRhZyDigJxGaXhlc+KAnSB0byB0aGUgY29tbWl0IG1lc3NhZ2U/DQpNYXliZSBuZWVkbid0DQoN
Cj4gDQo+IFJlZ2FyZHMsDQo+IE1hcmt1cw0KDQo

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

end of thread, other threads:[~2020-06-30  7:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1593410434-19406-1-git-send-email-chunfeng.yun@mediatek.com>
2020-06-29  7:30 ` [PATCH 1/2] usb: mtu3: disable USB2 LPM Markus Elfring
2020-06-29  8:10   ` Greg Kroah-Hartman
     [not found] ` <1593410434-19406-2-git-send-email-chunfeng.yun@mediatek.com>
2020-06-29  8:00   ` [PATCH 2/2] usb: mtu3: fix NULL pointer dereference Markus Elfring
2020-06-29  8:10     ` Greg Kroah-Hartman
2020-06-30  7:28     ` Chunfeng Yun
2020-06-29 16:19   ` Searching for initialisation of variables by function calls before null pointer checks Markus Elfring

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).