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-next>] [day] [month] [year] [list]
Message-ID: <5212E5E4.8010408@asianux.com>
Date:	Tue, 20 Aug 2013 11:43:32 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	steffen.klassert@...unet.com
CC:	linux-crypto@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] kernel/padata.c: always check the return value of __padata_remove_cpu()
 and __padata_add_cpu()

When failure occures, __padata_add_cpu() and __padata_remove_cpu() will
return -ENOMEM, which need be noticed in any cases (even in cleaning up
cases).

Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
 kernel/padata.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/padata.c b/kernel/padata.c
index 072f4ee..6a124cd 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -871,16 +871,20 @@ static int padata_cpu_callback(struct notifier_block *nfb,
 		if (!pinst_has_cpu(pinst, cpu))
 			break;
 		mutex_lock(&pinst->lock);
-		__padata_remove_cpu(pinst, cpu);
+		err = __padata_remove_cpu(pinst, cpu);
 		mutex_unlock(&pinst->lock);
+		if (err)
+			return notifier_from_errno(err);
 
 	case CPU_DOWN_FAILED:
 	case CPU_DOWN_FAILED_FROZEN:
 		if (!pinst_has_cpu(pinst, cpu))
 			break;
 		mutex_lock(&pinst->lock);
-		__padata_add_cpu(pinst, cpu);
+		err = __padata_add_cpu(pinst, cpu);
 		mutex_unlock(&pinst->lock);
+		if (err)
+			return notifier_from_errno(err);
 	}
 
 	return NOTIFY_OK;
-- 
1.7.7.6
--
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