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:	Mon, 14 Apr 2014 11:19:41 +0900
From:	DaeSeok Youn <daeseok.youn@...il.com>
To:	David Miller <davem@...emloft.net>, lauro.venancio@...nbossa.org
Cc:	aloisio.almeida@...nbossa.org, sameo@...ux.intel.com,
	linux-wireless@...r.kernel.org, linux-nfc@...ts.01.org,
	netdev@...r.kernel.org, linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] nfc: fix NULL pointer dereference

Hi,

Can you review this patch?

Thanks.
Daeseok Youn

2014-04-02 16:55 GMT+09:00 Daeseok Youn <daeseok.youn@...il.com>:
>
> dev is NULL when nfc_get_device() is failed but
> dev is used for handling error.
>
> coccicheck says:
>  net/nfc/netlink.c:1092:21-24: ERROR:
> dev is NULL but dereferenced.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@...il.com>
> ---
>  net/nfc/netlink.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
> index 43cb1c1..b2ad570 100644
> --- a/net/nfc/netlink.c
> +++ b/net/nfc/netlink.c
> @@ -1026,10 +1026,8 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info)
>         idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
>
>         dev = nfc_get_device(idx);
> -       if (!dev) {
> -               rc = -ENODEV;
> -               goto exit;
> -       }
> +       if (!dev)
> +               return -ENODEV;
>
>         device_lock(&dev->dev);
>
> --
> 1.7.4.4
>
>
--
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