linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Potential NULL pointer deference in RDMA
@ 2019-10-10  4:44 Yizhuo Zhai
  2019-10-10  6:51 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Yizhuo Zhai @ 2019-10-10  4:44 UTC (permalink / raw)
  To: Moni Shoua, Doug Ledford, Jason Gunthorpe, linux-rdma,
	linux-kernel, Zhiyun Qian, Chengyu Song

Hi All:
drivers/infiniband/sw/rxe/rxe_verbs.c:
The function to_rdev() could return NULL, but no caller in this file
checks the return value but directly dereference them, which seems
potentially unsafe. Callers include rxe_query_device(),
rxe_query_port(), rxe_query_pkey(), etc.


-- 
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside

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

* Re: Potential NULL pointer deference in RDMA
  2019-10-10  4:44 Potential NULL pointer deference in RDMA Yizhuo Zhai
@ 2019-10-10  6:51 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2019-10-10  6:51 UTC (permalink / raw)
  To: Yizhuo Zhai
  Cc: Moni Shoua, Doug Ledford, Jason Gunthorpe, linux-rdma,
	linux-kernel, Zhiyun Qian, Chengyu Song

On Wed, Oct 09, 2019 at 09:44:58PM -0700, Yizhuo Zhai wrote:
> Hi All:
> drivers/infiniband/sw/rxe/rxe_verbs.c:
> The function to_rdev() could return NULL, but no caller in this file
> checks the return value but directly dereference them, which seems
> potentially unsafe. Callers include rxe_query_device(),
> rxe_query_port(), rxe_query_pkey(), etc.


All NULL returns in to_r*() function are useless and can be removed.

Thanks
>
>
> --
> Kind Regards,
>
> Yizhuo Zhai
>
> Computer Science, Graduate Student
> University of California, Riverside

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

end of thread, other threads:[~2019-10-10  6:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  4:44 Potential NULL pointer deference in RDMA Yizhuo Zhai
2019-10-10  6:51 ` Leon Romanovsky

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