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
| ||
|
Date: Mon, 2 Mar 2020 21:50:12 -0500 From: Sasha Levin <sashal@...nel.org> To: linux-kernel@...r.kernel.org, stable@...r.kernel.org Cc: Lars-Peter Clausen <lars@...afoo.de>, Michal Nazarewicz <mina86@...a86.com>, Alexandru Ardelean <alexandru.ardelean@...log.com>, Felipe Balbi <balbi@...nel.org>, Sasha Levin <sashal@...nel.org>, linux-usb@...r.kernel.org Subject: [PATCH AUTOSEL 4.4 02/11] usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags From: Lars-Peter Clausen <lars@...afoo.de> [ Upstream commit 43d565727a3a6fd24e37c7c2116475106af71806 ] ffs_aio_cancel() can be called from both interrupt and thread context. Make sure that the current IRQ state is saved and restored by using spin_{un,}lock_irq{save,restore}(). Otherwise undefined behavior might occur. Acked-by: Michal Nazarewicz <mina86@...a86.com> Signed-off-by: Lars-Peter Clausen <lars@...afoo.de> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com> Signed-off-by: Felipe Balbi <balbi@...nel.org> Signed-off-by: Sasha Levin <sashal@...nel.org> --- drivers/usb/gadget/function/f_fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 4cb1355271ec4..9536c409a90d5 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -888,18 +888,19 @@ static int ffs_aio_cancel(struct kiocb *kiocb) { struct ffs_io_data *io_data = kiocb->private; struct ffs_epfile *epfile = kiocb->ki_filp->private_data; + unsigned long flags; int value; ENTER(); - spin_lock_irq(&epfile->ffs->eps_lock); + spin_lock_irqsave(&epfile->ffs->eps_lock, flags); if (likely(io_data && io_data->ep && io_data->req)) value = usb_ep_dequeue(io_data->ep, io_data->req); else value = -EINVAL; - spin_unlock_irq(&epfile->ffs->eps_lock); + spin_unlock_irqrestore(&epfile->ffs->eps_lock, flags); return value; } -- 2.20.1
Powered by blists - more mailing lists