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]
Date:	Sat, 21 Dec 2013 03:31:07 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Sasha Levin <sasha.levin@...cle.com>,
	venkat.x.venkatsubra@...cle.com, davem@...emloft.net
CC:	rds-devel@....oracle.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rds: prevent dereference of a NULL device in rds_iw_laddr_check

Hello.

On 12/21/2013 02:18 AM, Sasha Levin wrote:

> Binding might result in a NULL device which is later dereferenced
> without checking.

> Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
> ---
>   net/rds/iw.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

> diff --git a/net/rds/iw.c b/net/rds/iw.c
> index 7826d46..0298920 100644
> --- a/net/rds/iw.c
> +++ b/net/rds/iw.c
> @@ -239,7 +239,8 @@ static int rds_iw_laddr_check(__be32 addr)
>   	ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin);
>   	/* due to this, we will claim to support IB devices unless we
>   	   check node_type. */
> -	if (ret || cm_id->device->node_type != RDMA_NODE_RNIC)
> +	if (ret || !cm_id->device ||
> +            cm_id->device->node_type != RDMA_NODE_RNIC)

    Indent with tabs and then spaces, not with spaces only please, so that the 
line aligns under 'ret'.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ