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]
Message-Id: <1428694844-7782-3-git-send-email-hock.leong.kweh@intel.com>
Date:	Sat, 11 Apr 2015 03:40:43 +0800
From:	"Kweh, Hock Leong" <hock.leong.kweh@...el.com>
To:	Ming Lei <ming.lei@...onical.com>,
	Matt Fleming <matt@...sole-pimps.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Ong Boon Leong <boon.leong.ong@...el.com>,
	"Kweh, Hock Leong" <hock.leong.kweh@...el.com>,
	LKML <linux-kernel@...r.kernel.org>, linux-efi@...r.kernel.org,
	Sam Protsenko <semen.protsenko@...aro.org>,
	Peter Jones <pjones@...hat.com>,
	Andy Lutomirski <luto@...capital.net>,
	Roy Franz <roy.franz@...aro.org>,
	Borislav Petkov <bp@...en8.de>
Subject: [PATCH v3 2/3] firmware_loader: fix positive return value being treat as error return

From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>

Due to wait_for_completion_interruptible_timeout() will return
its remaining timeout jiffies value if timeout does not happen,
the error check code "if (ret)" will treat that as error return.
So, fixing the issue by re-assigning back a 'Zero' to the return
value when the wait is completed without timeout.

Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@...el.com>
---
 drivers/base/firmware_class.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index e03235d..b38975d 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -923,6 +923,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
 		mutex_lock(&fw_lock);
 		fw_load_abort(fw_priv);
 		mutex_unlock(&fw_lock);
+	} else {
+		retval = 0;
 	}
 
 	if (is_fw_load_aborted(buf))
-- 
1.7.9.5

--
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