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]
Message-ID: <tip-3f10940e4fb69d312602078f2c5234206797ca31@git.kernel.org>
Date:	Wed, 14 Apr 2010 15:01:48 GMT
From:	tip-bot for Arnd Bergmann <arnd@...ay.de.ibm.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	arnd@...ay.de.ibm.com, arnd@...db.de, fweisbec@...il.com,
	dmitry.adamushko@...il.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:x86/microcode] x86/microcode: Use nonseekable_open()

Commit-ID:  3f10940e4fb69d312602078f2c5234206797ca31
Gitweb:     http://git.kernel.org/tip/3f10940e4fb69d312602078f2c5234206797ca31
Author:     Arnd Bergmann <arnd@...ay.de.ibm.com>
AuthorDate: Sat, 10 Apr 2010 16:46:21 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 14 Apr 2010 12:27:34 +0200

x86/microcode: Use nonseekable_open()

No need to seek on this file, so prevent it outright so we can
avoid using default_llseek - removes one more BKL usage.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
[drop useless llseek = no_llseek and smp_lock.h inclusion]
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Arnd Bergmann <arnd@...ay.de.ibm.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Dmitry Adamushko <dmitry.adamushko@...il.com>
LKML-Reference: <1270910781-8786-1-git-send-regression-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 arch/x86/kernel/microcode_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index cceb5bc..2cd8c54 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -201,9 +201,9 @@ static int do_microcode_update(const void __user *buf, size_t size)
 	return error;
 }
 
-static int microcode_open(struct inode *unused1, struct file *unused2)
+static int microcode_open(struct inode *inode, struct file *file)
 {
-	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
+	return capable(CAP_SYS_RAWIO) ? nonseekable_open(inode, file) : -EPERM;
 }
 
 static ssize_t microcode_write(struct file *file, const char __user *buf,
--
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