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:	Wed, 30 Apr 2014 08:55:21 +0000
From:	Anil Gurumurthy <Anil.Gurumurthy@...gic.com>
To:	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Sudarsana Kalluru <Sudarsana.Kalluru@...gic.com>
CC:	"James E.J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"ldv-project@...uxtesting.org" <ldv-project@...uxtesting.org>
Subject: RE: [PATCH v2] [SCSI] bfa: allocate memory with GFP_ATOMIC in
 spinlock context

Thanks for the patch.
Acked-by: Anil Gurumurthy <anil.gurumurthy@...gic.com>

-----Original Message-----
From: Alexey Khoroshilov [mailto:khoroshilov@...ras.ru]
Sent: 18 April 2014 13:29
To: Anil Gurumurthy; Sudarsana Kalluru
Cc: Alexey Khoroshilov; James E.J. Bottomley; linux-scsi; linux-kernel; ldv-project@...uxtesting.org
Subject: [PATCH v2] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context

bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(), that is called only from bfad_drv_start() with bfad_lock spinlock held.
So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic spinlock context.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
---
 drivers/scsi/bfa/bfad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index cc0fbcdc5192..7593b7c1d336 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -507,7 +507,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
        struct bfad_vport_s   *vport;
        int rc;

-       vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
+       vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
        if (!vport) {
                bfa_trc(bfad, 0);
                return;
--
1.8.3.2


________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ