RE: [PATCH] MUSB: Fix Null Pointer dereference issues in musb gadget code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David, Alan,

These issues were discovered while running klockworks which is a code review
tool that detects coding mistakes. 

I haven't seen an obvious crash due to this.

I agree with your comments.

Do you recommend adding such checks before and after calling container_of()
to make the driver more robust? This would mean checking for all arguments
of functions and validating them before using them. This might be an
overhead.

Thanks,
Maulik

-----Original Message-----
From: David Brownell [mailto:david-b@xxxxxxxxxxx] 
Sent: Tuesday, June 23, 2009 10:29 PM
To: Maulik Mankad
Cc: linux-usb@xxxxxxxxxxxxxxx; gregkh@xxxxxxx; Felipe Balbi
Subject: Re: [PATCH] MUSB: Fix Null Pointer dereference issues in musb
gadget code

On Tuesday 23 June 2009, Maulik Mankad wrote:
> This patch fixes possible NULL pointer dereference issues in MUSB gadget
code.

Alan's comments are on the mark:  several of those routines
can't be entered with invalid "ep" pointers, check for
null pointers *BEFORE* using them for container_of().

So several of those changes are obviously incorrect.

Could you forward the stack backtrace you observed?
Or if there is none ... why are you concerned?



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux