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:   Thu, 11 Nov 2021 17:45:56 +0530
From:   Pavankumar Kondeti <quic_pkondeti@...cinc.com>
To:     <linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>
CC:     Pavankumar Kondeti <quic_pkondeti@...cinc.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Jens Axboe" <axboe@...nel.dk>, Jack Pham <jackp@...eaurora.org>,
        Peter Chen <peter.chen@....com>,
        Wesley Cheng <wcheng@...eaurora.org>,
        Andrew Gabbasov <andrew_gabbasov@...tor.com>,
        kernel test robot <lkp@...el.com>
Subject: [PATCH v2] usb: gadget: f_fs: Use stream_open() for endpoint files

Function fs endpoint files does not have the notion of file position.
So switch to stream like functionality. This allows concurrent threads
to be blocked in the ffs read/write operations which use ffs_mutex_lock().
The ffs mutex lock deploys interruptible wait. Otherwise, threads are
blocking for the mutex lock in __fdget_pos(). For whatever reason, ff the
host does not send/receive data for longer time, hung task warnings
are observed.

Signed-off-by: Pavankumar Kondeti <quic_pkondeti@...cinc.com>
---
V2:
- Removed Change-Id tag

 drivers/usb/gadget/function/f_fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index e20c19a..3c584da 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -614,7 +614,7 @@ static int ffs_ep0_open(struct inode *inode, struct file *file)
 	file->private_data = ffs;
 	ffs_data_opened(ffs);
 
-	return 0;
+	return stream_open(inode, file);
 }
 
 static int ffs_ep0_release(struct inode *inode, struct file *file)
@@ -1154,7 +1154,7 @@ ffs_epfile_open(struct inode *inode, struct file *file)
 	file->private_data = epfile;
 	ffs_data_opened(epfile->ffs);
 
-	return 0;
+	return stream_open(inode, file);
 }
 
 static int ffs_aio_cancel(struct kiocb *kiocb)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ