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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 22 Mar 2021 13:27:00 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Jie Deng <jie.deng@...el.com>
Cc:     linux-i2c@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, mst@...hat.com, wsa@...nel.org,
        jasowang@...hat.com, wsa+renesas@...g-engineering.com,
        andriy.shevchenko@...ux.intel.com, conghui.chen@...el.com,
        arnd@...db.de, kblaiech@...lanox.com,
        jarkko.nikula@...ux.intel.com, Sergey.Semin@...kalelectronics.ru,
        rppt@...nel.org, loic.poulain@...aro.org, tali.perry1@...il.com,
        u.kleine-koenig@...gutronix.de, bjorn.andersson@...aro.org,
        yu1.wang@...el.com, shuo.a.liu@...el.com, stefanha@...hat.com,
        pbonzini@...hat.com
Subject: Re: [PATCH v9] i2c: virtio: add a virtio i2c frontend driver

On 22-03-21, 15:53, Jie Deng wrote:
> On 2021/3/22 14:41, Viresh Kumar wrote:
> I think your optimization has problems...
> 
> 
> > 	bool err_found = timeout;
> > 
> > 	for (i = 0; i < nr; i++) {
> > 		/* Detach the ith request from the vq */
> > 		req = virtqueue_get_buf(vq, &len);
> > 
> > 		/*
> > 		 * Condition (req && req == &reqs[i]) should always meet since
> > 		 * we have total nr requests in the vq.
> > 		 */
> > 		if (!err_found &&
> >                      (WARN_ON(!(req && req == &reqs[i])) ||
> > 		     (req->in_hdr.status != VIRTIO_I2C_MSG_OK))) {
> > 			err_found = true;
> > 			continue;
> 
> 
> Just continue here, the ith buf leaks ?

Ahh, this needs to be dropped. You are fight.
 
> > 		}
> > 
> > 		i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], err_found);
> 
> 
> i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !err_found); ?

Yes again, my mistake :)

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ