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:   Sun, 19 Apr 2020 23:31:35 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Zhiyun Qian <zhiyunq@...ucr.edu>,
        易林 <yilin@....ac.cn>
Cc:     vishal@...lsio.com, "csong@...ucr.edu" <csong@...ucr.edu>,
        "yiqiuping@...il.com" <yiqiuping@...il.com>,
        jian liu <liujian6@....ac.cn>, netdev@...r.kernel.org
Subject: Re: drivers: target: iscsi: cxgbit: is there exist a memleak in cxgbit_create_server4?

On 4/19/20 11:23 PM, Zhiyun Qian wrote:
> -Zhiyun
> 
> On Mon, Apr 20, 2020 at 2:48 AM 易林 <yilin@....ac.cn> wrote:
>>
>> static int
>> cxgbit_create_server4(struct cxgbit_device *cdev, unsigned int stid,
>>                       struct cxgbit_np *cnp)
>> {
>>         struct sockaddr_in *sin = (struct sockaddr_in *)
>>                                    &amp;cnp-&gt;com.local_addr;
>>         int ret;
>>
>>         pr_debug("%s: dev = %s; stid = %u; sin_port = %u\n",
>>                  __func__, cdev-&gt;lldi.ports[0]-&gt;name, stid, sin-&gt;sin_port);
>>
>>         cxgbit_get_cnp(cnp);
>>         cxgbit_init_wr_wait(&amp;cnp-&gt;com.wr_wait);
>>
>>         ret = cxgb4_create_server(cdev-&gt;lldi.ports[0],
>>                                   stid, sin-&gt;sin_addr.s_addr,
>>                                   sin-&gt;sin_port, 0,
>>                                   cdev-&gt;lldi.rxq_ids[0]);
>>         if (!ret)
>>                 ret = cxgbit_wait_for_reply(cdev,
>>                                             &amp;cnp-&gt;com.wr_wait,
>>                                             0, 10, __func__);
>>         else if (ret &gt; 0)
>>                 ret = net_xmit_errno(ret);
>>         else
>>                 cxgbit_put_cnp(cnp);
>>
>>         if (ret)
>>                 pr_err("create server failed err %d stid %d laddr %pI4 lport %d\n",
>>                        ret, stid, &amp;sin-&gt;sin_addr, ntohs(sin-&gt;sin_port));
>>         return ret;
>> }
>> what if cxgb4_create_server return a &gt;0 value, the cnp reference wouldn't be released. Or, when cxgb4_create_server  return &gt;0 value, cnp has been released somewhere.
> 
> "&gt:0"? typo?
> 

Lots of html conversions of > < etc. Makes it difficult to read.

Convert &gt; to >
Convert &lt; to <

Preferably repost as readable C source code.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ