Linux 3.3
This commit is contained in:
parent
77c32d730a
commit
7954e4a201
@ -1,78 +0,0 @@
|
||||
From 0769c5de24621141c953fbe1f943582d37cb4244 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stephan=20B=C3=A4rwolf?= <stephan.baerwolf@tu-ilmenau.de>
|
||||
Date: Thu, 12 Jan 2012 16:43:03 +0100
|
||||
Subject: [PATCH 1/2] KVM: x86: extend "struct x86_emulate_ops" with
|
||||
"get_cpuid"
|
||||
|
||||
In order to be able to proceed checks on CPU-specific properties
|
||||
within the emulator, function "get_cpuid" is introduced.
|
||||
With "get_cpuid" it is possible to virtually call the guests
|
||||
"cpuid"-opcode without changing the VM's context.
|
||||
|
||||
[mtosatti: cleanup/beautify code]
|
||||
|
||||
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
|
||||
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
---
|
||||
arch/x86/include/asm/kvm_emulate.h | 3 +++
|
||||
arch/x86/kvm/x86.c | 23 +++++++++++++++++++++++
|
||||
2 files changed, 26 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
|
||||
index ab4092e..c8b2868 100644
|
||||
--- a/arch/x86/include/asm/kvm_emulate.h
|
||||
+++ b/arch/x86/include/asm/kvm_emulate.h
|
||||
@@ -190,6 +190,9 @@ struct x86_emulate_ops {
|
||||
int (*intercept)(struct x86_emulate_ctxt *ctxt,
|
||||
struct x86_instruction_info *info,
|
||||
enum x86_intercept_stage stage);
|
||||
+
|
||||
+ bool (*get_cpuid)(struct x86_emulate_ctxt *ctxt,
|
||||
+ u32 *eax, u32 *ebx, u32 *ecx, u32 *edx);
|
||||
};
|
||||
|
||||
typedef u32 __attribute__((vector_size(16))) sse128_t;
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index f0fa3fb..c95ca2d 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -4205,6 +4205,28 @@ static int emulator_intercept(struct x86_emulate_ctxt *ctxt,
|
||||
return kvm_x86_ops->check_intercept(emul_to_vcpu(ctxt), info, stage);
|
||||
}
|
||||
|
||||
+static bool emulator_get_cpuid(struct x86_emulate_ctxt *ctxt,
|
||||
+ u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
|
||||
+{
|
||||
+ struct kvm_cpuid_entry2 *cpuid = NULL;
|
||||
+
|
||||
+ if (eax && ecx)
|
||||
+ cpuid = kvm_find_cpuid_entry(emul_to_vcpu(ctxt),
|
||||
+ *eax, *ecx);
|
||||
+
|
||||
+ if (cpuid) {
|
||||
+ *eax = cpuid->eax;
|
||||
+ *ecx = cpuid->ecx;
|
||||
+ if (ebx)
|
||||
+ *ebx = cpuid->ebx;
|
||||
+ if (edx)
|
||||
+ *edx = cpuid->edx;
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static struct x86_emulate_ops emulate_ops = {
|
||||
.read_std = kvm_read_guest_virt_system,
|
||||
.write_std = kvm_write_guest_virt_system,
|
||||
@@ -4236,6 +4258,7 @@ static struct x86_emulate_ops emulate_ops = {
|
||||
.get_fpu = emulator_get_fpu,
|
||||
.put_fpu = emulator_put_fpu,
|
||||
.intercept = emulator_intercept,
|
||||
+ .get_cpuid = emulator_get_cpuid,
|
||||
};
|
||||
|
||||
static void cache_all_regs(struct kvm_vcpu *vcpu)
|
||||
--
|
||||
1.7.7.5
|
||||
|
@ -1,144 +0,0 @@
|
||||
From e28ba7bb020f07193bc000453c8775e9d2c0dda7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stephan=20B=C3=A4rwolf?= <stephan.baerwolf@tu-ilmenau.de>
|
||||
Date: Thu, 12 Jan 2012 16:43:04 +0100
|
||||
Subject: [PATCH 2/2] KVM: x86: fix missing checks in syscall emulation
|
||||
|
||||
On hosts without this patch, 32bit guests will crash (and 64bit guests
|
||||
may behave in a wrong way) for example by simply executing following
|
||||
nasm-demo-application:
|
||||
|
||||
[bits 32]
|
||||
global _start
|
||||
SECTION .text
|
||||
_start: syscall
|
||||
|
||||
(I tested it with winxp and linux - both always crashed)
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <_start>:
|
||||
0: 0f 05 syscall
|
||||
|
||||
The reason seems a missing "invalid opcode"-trap (int6) for the
|
||||
syscall opcode "0f05", which is not available on Intel CPUs
|
||||
within non-longmodes, as also on some AMD CPUs within legacy-mode.
|
||||
(depending on CPU vendor, MSR_EFER and cpuid)
|
||||
|
||||
Because previous mentioned OSs may not engage corresponding
|
||||
syscall target-registers (STAR, LSTAR, CSTAR), they remain
|
||||
NULL and (non trapping) syscalls are leading to multiple
|
||||
faults and finally crashs.
|
||||
|
||||
Depending on the architecture (AMD or Intel) pretended by
|
||||
guests, various checks according to vendor's documentation
|
||||
are implemented to overcome the current issue and behave
|
||||
like the CPUs physical counterparts.
|
||||
|
||||
[mtosatti: cleanup/beautify code]
|
||||
|
||||
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
|
||||
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
---
|
||||
arch/x86/include/asm/kvm_emulate.h | 13 +++++++++
|
||||
arch/x86/kvm/emulate.c | 51 ++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 64 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
|
||||
index c8b2868..7b9cfc4 100644
|
||||
--- a/arch/x86/include/asm/kvm_emulate.h
|
||||
+++ b/arch/x86/include/asm/kvm_emulate.h
|
||||
@@ -301,6 +301,19 @@ struct x86_emulate_ctxt {
|
||||
#define X86EMUL_MODE_PROT (X86EMUL_MODE_PROT16|X86EMUL_MODE_PROT32| \
|
||||
X86EMUL_MODE_PROT64)
|
||||
|
||||
+/* CPUID vendors */
|
||||
+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx 0x68747541
|
||||
+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx 0x444d4163
|
||||
+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_edx 0x69746e65
|
||||
+
|
||||
+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx 0x69444d41
|
||||
+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx 0x21726574
|
||||
+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_edx 0x74656273
|
||||
+
|
||||
+#define X86EMUL_CPUID_VENDOR_GenuineIntel_ebx 0x756e6547
|
||||
+#define X86EMUL_CPUID_VENDOR_GenuineIntel_ecx 0x6c65746e
|
||||
+#define X86EMUL_CPUID_VENDOR_GenuineIntel_edx 0x49656e69
|
||||
+
|
||||
enum x86_intercept_stage {
|
||||
X86_ICTP_NONE = 0, /* Allow zero-init to not match anything */
|
||||
X86_ICPT_PRE_EXCEPT,
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index 05a562b..0982507 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -1891,6 +1891,51 @@ setup_syscalls_segments(struct x86_emulate_ctxt *ctxt,
|
||||
ss->p = 1;
|
||||
}
|
||||
|
||||
+static bool em_syscall_is_enabled(struct x86_emulate_ctxt *ctxt)
|
||||
+{
|
||||
+ struct x86_emulate_ops *ops = ctxt->ops;
|
||||
+ u32 eax, ebx, ecx, edx;
|
||||
+
|
||||
+ /*
|
||||
+ * syscall should always be enabled in longmode - so only become
|
||||
+ * vendor specific (cpuid) if other modes are active...
|
||||
+ */
|
||||
+ if (ctxt->mode == X86EMUL_MODE_PROT64)
|
||||
+ return true;
|
||||
+
|
||||
+ eax = 0x00000000;
|
||||
+ ecx = 0x00000000;
|
||||
+ if (ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx)) {
|
||||
+ /*
|
||||
+ * Intel ("GenuineIntel")
|
||||
+ * remark: Intel CPUs only support "syscall" in 64bit
|
||||
+ * longmode. Also an 64bit guest with a
|
||||
+ * 32bit compat-app running will #UD !! While this
|
||||
+ * behaviour can be fixed (by emulating) into AMD
|
||||
+ * response - CPUs of AMD can't behave like Intel.
|
||||
+ */
|
||||
+ if (ebx == X86EMUL_CPUID_VENDOR_GenuineIntel_ebx &&
|
||||
+ ecx == X86EMUL_CPUID_VENDOR_GenuineIntel_ecx &&
|
||||
+ edx == X86EMUL_CPUID_VENDOR_GenuineIntel_edx)
|
||||
+ return false;
|
||||
+
|
||||
+ /* AMD ("AuthenticAMD") */
|
||||
+ if (ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx &&
|
||||
+ ecx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx &&
|
||||
+ edx == X86EMUL_CPUID_VENDOR_AuthenticAMD_edx)
|
||||
+ return true;
|
||||
+
|
||||
+ /* AMD ("AMDisbetter!") */
|
||||
+ if (ebx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx &&
|
||||
+ ecx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx &&
|
||||
+ edx == X86EMUL_CPUID_VENDOR_AMDisbetterI_edx)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /* default: (not Intel, not AMD), apply Intel's stricter rules... */
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static int em_syscall(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
struct x86_emulate_ops *ops = ctxt->ops;
|
||||
@@ -1904,9 +1949,15 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt)
|
||||
ctxt->mode == X86EMUL_MODE_VM86)
|
||||
return emulate_ud(ctxt);
|
||||
|
||||
+ if (!(em_syscall_is_enabled(ctxt)))
|
||||
+ return emulate_ud(ctxt);
|
||||
+
|
||||
ops->get_msr(ctxt, MSR_EFER, &efer);
|
||||
setup_syscalls_segments(ctxt, &cs, &ss);
|
||||
|
||||
+ if (!(efer & EFER_SCE))
|
||||
+ return emulate_ud(ctxt);
|
||||
+
|
||||
ops->get_msr(ctxt, MSR_STAR, &msr_data);
|
||||
msr_data >>= 32;
|
||||
cs_sel = (u16)(msr_data & 0xfffc);
|
||||
--
|
||||
1.7.7.5
|
||||
|
@ -1,605 +0,0 @@
|
||||
ommit 6926afd1925a54a13684ebe05987868890665e2b
|
||||
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
Date: Sat Jan 7 13:22:46 2012 -0500
|
||||
|
||||
NFSv4: Save the owner/group name string when doing open
|
||||
|
||||
...so that we can do the uid/gid mapping outside the asynchronous RPC
|
||||
context.
|
||||
This fixes a bug in the current NFSv4 atomic open code where the client
|
||||
isn't able to determine what the true uid/gid fields of the file are,
|
||||
(because the asynchronous nature of the OPEN call denies it the ability
|
||||
to do an upcall) and so fills them with default values, marking the
|
||||
inode as needing revalidation.
|
||||
Unfortunately, in some cases, the VFS will do some additional sanity
|
||||
checks on the file, and may override the server's decision to allow
|
||||
the open because it sees the wrong owner/group fields.
|
||||
|
||||
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
|
||||
diff -up linux-3.2.noarch/fs/nfs/idmap.c.orig linux-3.2.noarch/fs/nfs/idmap.c
|
||||
--- linux-3.2.noarch/fs/nfs/idmap.c.orig 2012-03-15 10:38:58.876578000 -0400
|
||||
+++ linux-3.2.noarch/fs/nfs/idmap.c 2012-03-15 10:51:10.344228000 -0400
|
||||
@@ -38,6 +38,89 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/nfs_idmap.h>
|
||||
+#include <linux/nfs_fs.h>
|
||||
+
|
||||
+/**
|
||||
+ * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
|
||||
+ * @fattr: fully initialised struct nfs_fattr
|
||||
+ * @owner_name: owner name string cache
|
||||
+ * @group_name: group name string cache
|
||||
+ */
|
||||
+void nfs_fattr_init_names(struct nfs_fattr *fattr,
|
||||
+ struct nfs4_string *owner_name,
|
||||
+ struct nfs4_string *group_name)
|
||||
+{
|
||||
+ fattr->owner_name = owner_name;
|
||||
+ fattr->group_name = group_name;
|
||||
+}
|
||||
+
|
||||
+static void nfs_fattr_free_owner_name(struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ fattr->valid &= ~NFS_ATTR_FATTR_OWNER_NAME;
|
||||
+ kfree(fattr->owner_name->data);
|
||||
+}
|
||||
+
|
||||
+static void nfs_fattr_free_group_name(struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ fattr->valid &= ~NFS_ATTR_FATTR_GROUP_NAME;
|
||||
+ kfree(fattr->group_name->data);
|
||||
+}
|
||||
+
|
||||
+static bool nfs_fattr_map_owner_name(struct nfs_server *server, struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ struct nfs4_string *owner = fattr->owner_name;
|
||||
+ __u32 uid;
|
||||
+
|
||||
+ if (!(fattr->valid & NFS_ATTR_FATTR_OWNER_NAME))
|
||||
+ return false;
|
||||
+ if (nfs_map_name_to_uid(server, owner->data, owner->len, &uid) == 0) {
|
||||
+ fattr->uid = uid;
|
||||
+ fattr->valid |= NFS_ATTR_FATTR_OWNER;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static bool nfs_fattr_map_group_name(struct nfs_server *server, struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ struct nfs4_string *group = fattr->group_name;
|
||||
+ __u32 gid;
|
||||
+
|
||||
+ if (!(fattr->valid & NFS_ATTR_FATTR_GROUP_NAME))
|
||||
+ return false;
|
||||
+ if (nfs_map_group_to_gid(server, group->data, group->len, &gid) == 0) {
|
||||
+ fattr->gid = gid;
|
||||
+ fattr->valid |= NFS_ATTR_FATTR_GROUP;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * nfs_fattr_free_names - free up the NFSv4 owner and group strings
|
||||
+ * @fattr: a fully initialised nfs_fattr structure
|
||||
+ */
|
||||
+void nfs_fattr_free_names(struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ if (fattr->valid & NFS_ATTR_FATTR_OWNER_NAME)
|
||||
+ nfs_fattr_free_owner_name(fattr);
|
||||
+ if (fattr->valid & NFS_ATTR_FATTR_GROUP_NAME)
|
||||
+ nfs_fattr_free_group_name(fattr);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * nfs_fattr_map_and_free_names - map owner/group strings into uid/gid and free
|
||||
+ * @server: pointer to the filesystem nfs_server structure
|
||||
+ * @fattr: a fully initialised nfs_fattr structure
|
||||
+ *
|
||||
+ * This helper maps the cached NFSv4 owner/group strings in fattr into
|
||||
+ * their numeric uid/gid equivalents, and then frees the cached strings.
|
||||
+ */
|
||||
+void nfs_fattr_map_and_free_names(struct nfs_server *server, struct nfs_fattr *fattr)
|
||||
+{
|
||||
+ if (nfs_fattr_map_owner_name(server, fattr))
|
||||
+ nfs_fattr_free_owner_name(fattr);
|
||||
+ if (nfs_fattr_map_group_name(server, fattr))
|
||||
+ nfs_fattr_free_group_name(fattr);
|
||||
+}
|
||||
|
||||
static int nfs_map_string_to_numeric(const char *name, size_t namelen, __u32 *res)
|
||||
{
|
||||
diff -up linux-3.2.noarch/fs/nfs/inode.c.orig linux-3.2.noarch/fs/nfs/inode.c
|
||||
--- linux-3.2.noarch/fs/nfs/inode.c.orig 2012-03-15 10:39:00.362624000 -0400
|
||||
+++ linux-3.2.noarch/fs/nfs/inode.c 2012-03-15 10:51:10.352227000 -0400
|
||||
@@ -1020,6 +1020,8 @@ void nfs_fattr_init(struct nfs_fattr *fa
|
||||
fattr->valid = 0;
|
||||
fattr->time_start = jiffies;
|
||||
fattr->gencount = nfs_inc_attr_generation_counter();
|
||||
+ fattr->owner_name = NULL;
|
||||
+ fattr->group_name = NULL;
|
||||
}
|
||||
|
||||
struct nfs_fattr *nfs_alloc_fattr(void)
|
||||
diff -up linux-3.2.noarch/fs/nfs/nfs4proc.c.orig linux-3.2.noarch/fs/nfs/nfs4proc.c
|
||||
--- linux-3.2.noarch/fs/nfs/nfs4proc.c.orig 2012-03-15 10:39:00.380629000 -0400
|
||||
+++ linux-3.2.noarch/fs/nfs/nfs4proc.c 2012-03-15 10:51:10.362231000 -0400
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <linux/namei.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/nfs_idmap.h>
|
||||
#include <linux/sunrpc/bc_xprt.h>
|
||||
#include <linux/xattr.h>
|
||||
#include <linux/utsname.h>
|
||||
@@ -765,6 +766,8 @@ struct nfs4_opendata {
|
||||
struct nfs_openres o_res;
|
||||
struct nfs_open_confirmargs c_arg;
|
||||
struct nfs_open_confirmres c_res;
|
||||
+ struct nfs4_string owner_name;
|
||||
+ struct nfs4_string group_name;
|
||||
struct nfs_fattr f_attr;
|
||||
struct nfs_fattr dir_attr;
|
||||
struct dentry *dir;
|
||||
@@ -788,6 +791,7 @@ static void nfs4_init_opendata_res(struc
|
||||
p->o_res.server = p->o_arg.server;
|
||||
nfs_fattr_init(&p->f_attr);
|
||||
nfs_fattr_init(&p->dir_attr);
|
||||
+ nfs_fattr_init_names(&p->f_attr, &p->owner_name, &p->group_name);
|
||||
}
|
||||
|
||||
static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
|
||||
@@ -819,6 +823,7 @@ static struct nfs4_opendata *nfs4_openda
|
||||
p->o_arg.name = &dentry->d_name;
|
||||
p->o_arg.server = server;
|
||||
p->o_arg.bitmask = server->attr_bitmask;
|
||||
+ p->o_arg.dir_bitmask = server->cache_consistency_bitmask;
|
||||
p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
|
||||
if (flags & O_CREAT) {
|
||||
u32 *s;
|
||||
@@ -855,6 +860,7 @@ static void nfs4_opendata_free(struct kr
|
||||
dput(p->dir);
|
||||
dput(p->dentry);
|
||||
nfs_sb_deactive(sb);
|
||||
+ nfs_fattr_free_names(&p->f_attr);
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
@@ -1579,6 +1585,8 @@ static int _nfs4_recover_proc_open(struc
|
||||
if (status != 0 || !data->rpc_done)
|
||||
return status;
|
||||
|
||||
+ nfs_fattr_map_and_free_names(NFS_SERVER(dir), &data->f_attr);
|
||||
+
|
||||
nfs_refresh_inode(dir, o_res->dir_attr);
|
||||
|
||||
if (o_res->rflags & NFS4_OPEN_RESULT_CONFIRM) {
|
||||
@@ -1611,6 +1619,8 @@ static int _nfs4_proc_open(struct nfs4_o
|
||||
return status;
|
||||
}
|
||||
|
||||
+ nfs_fattr_map_and_free_names(server, &data->f_attr);
|
||||
+
|
||||
if (o_arg->open_flags & O_CREAT) {
|
||||
update_changeattr(dir, &o_res->cinfo);
|
||||
nfs_post_op_update_inode(dir, o_res->dir_attr);
|
||||
diff -up linux-3.2.noarch/fs/nfs/nfs4xdr.c.orig linux-3.2.noarch/fs/nfs/nfs4xdr.c
|
||||
--- linux-3.2.noarch/fs/nfs/nfs4xdr.c.orig 2012-03-15 10:38:54.054438000 -0400
|
||||
+++ linux-3.2.noarch/fs/nfs/nfs4xdr.c 2012-03-15 10:51:10.373231000 -0400
|
||||
@@ -2298,7 +2298,7 @@ static void nfs4_xdr_enc_open(struct rpc
|
||||
encode_getfh(xdr, &hdr);
|
||||
encode_getfattr(xdr, args->bitmask, &hdr);
|
||||
encode_restorefh(xdr, &hdr);
|
||||
- encode_getfattr(xdr, args->bitmask, &hdr);
|
||||
+ encode_getfattr(xdr, args->dir_bitmask, &hdr);
|
||||
encode_nops(&hdr);
|
||||
}
|
||||
|
||||
@@ -3791,7 +3791,8 @@ out_overflow:
|
||||
}
|
||||
|
||||
static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap,
|
||||
- const struct nfs_server *server, uint32_t *uid, int may_sleep)
|
||||
+ const struct nfs_server *server, uint32_t *uid,
|
||||
+ struct nfs4_string *owner_name)
|
||||
{
|
||||
uint32_t len;
|
||||
__be32 *p;
|
||||
@@ -3808,8 +3809,12 @@ static int decode_attr_owner(struct xdr_
|
||||
p = xdr_inline_decode(xdr, len);
|
||||
if (unlikely(!p))
|
||||
goto out_overflow;
|
||||
- if (!may_sleep) {
|
||||
- /* do nothing */
|
||||
+ if (owner_name != NULL) {
|
||||
+ owner_name->data = kmemdup(p, len, GFP_NOWAIT);
|
||||
+ if (owner_name->data != NULL) {
|
||||
+ owner_name->len = len;
|
||||
+ ret = NFS_ATTR_FATTR_OWNER_NAME;
|
||||
+ }
|
||||
} else if (len < XDR_MAX_NETOBJ) {
|
||||
if (nfs_map_name_to_uid(server, (char *)p, len, uid) == 0)
|
||||
ret = NFS_ATTR_FATTR_OWNER;
|
||||
@@ -3829,7 +3834,8 @@ out_overflow:
|
||||
}
|
||||
|
||||
static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap,
|
||||
- const struct nfs_server *server, uint32_t *gid, int may_sleep)
|
||||
+ const struct nfs_server *server, uint32_t *gid,
|
||||
+ struct nfs4_string *group_name)
|
||||
{
|
||||
uint32_t len;
|
||||
__be32 *p;
|
||||
@@ -3846,8 +3852,12 @@ static int decode_attr_group(struct xdr_
|
||||
p = xdr_inline_decode(xdr, len);
|
||||
if (unlikely(!p))
|
||||
goto out_overflow;
|
||||
- if (!may_sleep) {
|
||||
- /* do nothing */
|
||||
+ if (group_name != NULL) {
|
||||
+ group_name->data = kmemdup(p, len, GFP_NOWAIT);
|
||||
+ if (group_name->data != NULL) {
|
||||
+ group_name->len = len;
|
||||
+ ret = NFS_ATTR_FATTR_GROUP_NAME;
|
||||
+ }
|
||||
} else if (len < XDR_MAX_NETOBJ) {
|
||||
if (nfs_map_group_to_gid(server, (char *)p, len, gid) == 0)
|
||||
ret = NFS_ATTR_FATTR_GROUP;
|
||||
@@ -4284,7 +4294,7 @@ xdr_error:
|
||||
|
||||
static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
|
||||
struct nfs_fattr *fattr, struct nfs_fh *fh,
|
||||
- const struct nfs_server *server, int may_sleep)
|
||||
+ const struct nfs_server *server)
|
||||
{
|
||||
int status;
|
||||
umode_t fmode = 0;
|
||||
@@ -4351,12 +4361,12 @@ static int decode_getfattr_attrs(struct
|
||||
goto xdr_error;
|
||||
fattr->valid |= status;
|
||||
|
||||
- status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, may_sleep);
|
||||
+ status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, fattr->owner_name);
|
||||
if (status < 0)
|
||||
goto xdr_error;
|
||||
fattr->valid |= status;
|
||||
|
||||
- status = decode_attr_group(xdr, bitmap, server, &fattr->gid, may_sleep);
|
||||
+ status = decode_attr_group(xdr, bitmap, server, &fattr->gid, fattr->group_name);
|
||||
if (status < 0)
|
||||
goto xdr_error;
|
||||
fattr->valid |= status;
|
||||
@@ -4397,7 +4407,7 @@ xdr_error:
|
||||
}
|
||||
|
||||
static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr,
|
||||
- struct nfs_fh *fh, const struct nfs_server *server, int may_sleep)
|
||||
+ struct nfs_fh *fh, const struct nfs_server *server)
|
||||
{
|
||||
__be32 *savep;
|
||||
uint32_t attrlen,
|
||||
@@ -4416,7 +4426,7 @@ static int decode_getfattr_generic(struc
|
||||
if (status < 0)
|
||||
goto xdr_error;
|
||||
|
||||
- status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server, may_sleep);
|
||||
+ status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server);
|
||||
if (status < 0)
|
||||
goto xdr_error;
|
||||
|
||||
@@ -4427,9 +4437,9 @@ xdr_error:
|
||||
}
|
||||
|
||||
static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr,
|
||||
- const struct nfs_server *server, int may_sleep)
|
||||
+ const struct nfs_server *server)
|
||||
{
|
||||
- return decode_getfattr_generic(xdr, fattr, NULL, server, may_sleep);
|
||||
+ return decode_getfattr_generic(xdr, fattr, NULL, server);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5710,8 +5720,7 @@ static int nfs4_xdr_dec_open_downgrade(s
|
||||
status = decode_open_downgrade(xdr, res);
|
||||
if (status != 0)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5737,8 +5746,7 @@ static int nfs4_xdr_dec_access(struct rp
|
||||
status = decode_access(xdr, res);
|
||||
if (status != 0)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5767,8 +5775,7 @@ static int nfs4_xdr_dec_lookup(struct rp
|
||||
status = decode_getfh(xdr, res->fh);
|
||||
if (status)
|
||||
goto out;
|
||||
- status = decode_getfattr(xdr, res->fattr, res->server
|
||||
- ,!RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ status = decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5794,8 +5801,7 @@ static int nfs4_xdr_dec_lookup_root(stru
|
||||
goto out;
|
||||
status = decode_getfh(xdr, res->fh);
|
||||
if (status == 0)
|
||||
- status = decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ status = decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5821,8 +5827,7 @@ static int nfs4_xdr_dec_remove(struct rp
|
||||
status = decode_remove(xdr, &res->cinfo);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->dir_attr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->dir_attr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5855,14 +5860,12 @@ static int nfs4_xdr_dec_rename(struct rp
|
||||
if (status)
|
||||
goto out;
|
||||
/* Current FH is target directory */
|
||||
- if (decode_getfattr(xdr, res->new_fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
|
||||
+ if (decode_getfattr(xdr, res->new_fattr, res->server))
|
||||
goto out;
|
||||
status = decode_restorefh(xdr);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->old_fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->old_fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5898,14 +5901,12 @@ static int nfs4_xdr_dec_link(struct rpc_
|
||||
* Note order: OP_LINK leaves the directory as the current
|
||||
* filehandle.
|
||||
*/
|
||||
- if (decode_getfattr(xdr, res->dir_attr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
|
||||
+ if (decode_getfattr(xdr, res->dir_attr, res->server))
|
||||
goto out;
|
||||
status = decode_restorefh(xdr);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5937,14 +5938,12 @@ static int nfs4_xdr_dec_create(struct rp
|
||||
status = decode_getfh(xdr, res->fh);
|
||||
if (status)
|
||||
goto out;
|
||||
- if (decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
|
||||
+ if (decode_getfattr(xdr, res->fattr, res->server))
|
||||
goto out;
|
||||
status = decode_restorefh(xdr);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->dir_fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->dir_fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -5976,8 +5975,7 @@ static int nfs4_xdr_dec_getattr(struct r
|
||||
status = decode_putfh(xdr);
|
||||
if (status)
|
||||
goto out;
|
||||
- status = decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ status = decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6079,8 +6077,7 @@ static int nfs4_xdr_dec_close(struct rpc
|
||||
* an ESTALE error. Shouldn't be a problem,
|
||||
* though, since fattr->valid will remain unset.
|
||||
*/
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6111,13 +6108,11 @@ static int nfs4_xdr_dec_open(struct rpc_
|
||||
goto out;
|
||||
if (decode_getfh(xdr, &res->fh) != 0)
|
||||
goto out;
|
||||
- if (decode_getfattr(xdr, res->f_attr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
|
||||
+ if (decode_getfattr(xdr, res->f_attr, res->server) != 0)
|
||||
goto out;
|
||||
if (decode_restorefh(xdr) != 0)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->dir_attr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->dir_attr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6165,8 +6160,7 @@ static int nfs4_xdr_dec_open_noattr(stru
|
||||
status = decode_open(xdr, res);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->f_attr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->f_attr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6193,8 +6187,7 @@ static int nfs4_xdr_dec_setattr(struct r
|
||||
status = decode_setattr(xdr);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6374,8 +6367,7 @@ static int nfs4_xdr_dec_write(struct rpc
|
||||
if (status)
|
||||
goto out;
|
||||
if (res->fattr)
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
if (!status)
|
||||
status = res->count;
|
||||
out:
|
||||
@@ -6404,8 +6396,7 @@ static int nfs4_xdr_dec_commit(struct rp
|
||||
if (status)
|
||||
goto out;
|
||||
if (res->fattr)
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6564,8 +6555,7 @@ static int nfs4_xdr_dec_delegreturn(stru
|
||||
status = decode_delegreturn(xdr);
|
||||
if (status != 0)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6594,8 +6584,7 @@ static int nfs4_xdr_dec_fs_locations(str
|
||||
goto out;
|
||||
xdr_enter_page(xdr, PAGE_SIZE);
|
||||
status = decode_getfattr(xdr, &res->fs_locations->fattr,
|
||||
- res->fs_locations->server,
|
||||
- !RPC_IS_ASYNC(req->rq_task));
|
||||
+ res->fs_locations->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6844,8 +6833,7 @@ static int nfs4_xdr_dec_layoutcommit(str
|
||||
status = decode_layoutcommit(xdr, rqstp, res);
|
||||
if (status)
|
||||
goto out;
|
||||
- decode_getfattr(xdr, res->fattr, res->server,
|
||||
- !RPC_IS_ASYNC(rqstp->rq_task));
|
||||
+ decode_getfattr(xdr, res->fattr, res->server);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
@@ -6976,7 +6964,7 @@ int nfs4_decode_dirent(struct xdr_stream
|
||||
goto out_overflow;
|
||||
|
||||
if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
|
||||
- entry->server, 1) < 0)
|
||||
+ entry->server) < 0)
|
||||
goto out_overflow;
|
||||
if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
|
||||
entry->ino = entry->fattr->mounted_on_fileid;
|
||||
diff -up linux-3.2.noarch/include/linux/nfs_idmap.h.orig linux-3.2.noarch/include/linux/nfs_idmap.h
|
||||
--- linux-3.2.noarch/include/linux/nfs_idmap.h.orig 2012-01-04 18:55:44.000000000 -0500
|
||||
+++ linux-3.2.noarch/include/linux/nfs_idmap.h 2012-03-15 10:51:10.395228000 -0400
|
||||
@@ -66,6 +66,8 @@ struct idmap_msg {
|
||||
/* Forward declaration to make this header independent of others */
|
||||
struct nfs_client;
|
||||
struct nfs_server;
|
||||
+struct nfs_fattr;
|
||||
+struct nfs4_string;
|
||||
|
||||
#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
|
||||
|
||||
@@ -97,6 +99,12 @@ void nfs_idmap_delete(struct nfs_client
|
||||
|
||||
#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
|
||||
|
||||
+void nfs_fattr_init_names(struct nfs_fattr *fattr,
|
||||
+ struct nfs4_string *owner_name,
|
||||
+ struct nfs4_string *group_name);
|
||||
+void nfs_fattr_free_names(struct nfs_fattr *);
|
||||
+void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *);
|
||||
+
|
||||
int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *);
|
||||
int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *);
|
||||
int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t);
|
||||
diff -up linux-3.2.noarch/include/linux/nfs_xdr.h.orig linux-3.2.noarch/include/linux/nfs_xdr.h
|
||||
--- linux-3.2.noarch/include/linux/nfs_xdr.h.orig 2012-03-15 10:38:54.464449000 -0400
|
||||
+++ linux-3.2.noarch/include/linux/nfs_xdr.h 2012-03-15 10:51:10.415229000 -0400
|
||||
@@ -18,6 +18,11 @@
|
||||
/* Forward declaration for NFS v3 */
|
||||
struct nfs4_secinfo_flavors;
|
||||
|
||||
+struct nfs4_string {
|
||||
+ unsigned int len;
|
||||
+ char *data;
|
||||
+};
|
||||
+
|
||||
struct nfs_fsid {
|
||||
uint64_t major;
|
||||
uint64_t minor;
|
||||
@@ -61,6 +66,8 @@ struct nfs_fattr {
|
||||
struct timespec pre_ctime; /* pre_op_attr.ctime */
|
||||
unsigned long time_start;
|
||||
unsigned long gencount;
|
||||
+ struct nfs4_string *owner_name;
|
||||
+ struct nfs4_string *group_name;
|
||||
};
|
||||
|
||||
#define NFS_ATTR_FATTR_TYPE (1U << 0)
|
||||
@@ -85,6 +92,8 @@ struct nfs_fattr {
|
||||
#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
|
||||
#define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
|
||||
#define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21)
|
||||
+#define NFS_ATTR_FATTR_OWNER_NAME (1U << 22)
|
||||
+#define NFS_ATTR_FATTR_GROUP_NAME (1U << 23)
|
||||
|
||||
#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
|
||||
| NFS_ATTR_FATTR_MODE \
|
||||
@@ -324,6 +333,7 @@ struct nfs_openargs {
|
||||
const struct qstr * name;
|
||||
const struct nfs_server *server; /* Needed for ID mapping */
|
||||
const u32 * bitmask;
|
||||
+ const u32 * dir_bitmask;
|
||||
__u32 claim;
|
||||
struct nfs4_sequence_args seq_args;
|
||||
};
|
||||
@@ -342,6 +352,8 @@ struct nfs_openres {
|
||||
__u32 do_recall;
|
||||
__u64 maxsize;
|
||||
__u32 attrset[NFS4_BITMAP_SIZE];
|
||||
+ struct nfs4_string *owner;
|
||||
+ struct nfs4_string *group_owner;
|
||||
struct nfs4_sequence_res seq_res;
|
||||
};
|
||||
|
||||
@@ -778,11 +790,6 @@ struct nfs3_getaclres {
|
||||
struct posix_acl * acl_default;
|
||||
};
|
||||
|
||||
-struct nfs4_string {
|
||||
- unsigned int len;
|
||||
- char *data;
|
||||
-};
|
||||
-
|
||||
#ifdef CONFIG_NFS_V4
|
||||
|
||||
typedef u64 clientid4;
|
1861
alps.patch
1861
alps.patch
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
|
||||
asm/bug.h header which uses it. This causes a build error:
|
||||
|
||||
...include/linux/mtd/map.h: In function 'inline_map_read':
|
||||
...include/linux/mtd/map.h:408:3: error: implicit declaration of function
|
||||
'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
|
||||
|
||||
The check is not essential and is not present for other architectures, so
|
||||
just remove it.
|
||||
|
||||
Signed-off-by: Simon Glass <sjg <at> chromium.org>
|
||||
---
|
||||
arch/arm/include/asm/bug.h | 1 -
|
||||
1 files changed, 0 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
|
||||
index 9abe7a0..fac79dc 100644
|
||||
--- a/arch/arm/include/asm/bug.h
|
||||
+++ b/arch/arm/include/asm/bug.h
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#define __BUG(__file, __line, __value) \
|
||||
do { \
|
||||
- BUILD_BUG_ON(sizeof(struct bug_entry) != 12); \
|
||||
asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \
|
||||
".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
|
||||
"2:\t.asciz " #__file "\n" \
|
||||
--
|
@ -1,26 +0,0 @@
|
||||
Fix this error:
|
||||
|
||||
CC drivers/net/ethernet/stmicro/stmmac/mmc_core.o
|
||||
drivers/net/ethernet/stmicro/stmmac/mmc_core.c: In function 'dwmac_mmc_ctrl':
|
||||
drivers/net/ethernet/stmicro/stmmac/mmc_core.c:143:2: error: implicit
|
||||
declaration of function 'pr_debug' [-Werror=implicit-function-declaration]
|
||||
|
||||
Signed-off-by: Stefan Roese <sr <at> denx.de>
|
||||
Cc: Giuseppe Cavallaro <peppe.cavallaro <at> st.com>
|
||||
---
|
||||
drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
|
||||
index 41e6b33..c07cfe9 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
|
||||
@@ -22,6 +22,7 @@
|
||||
Author: Giuseppe Cavallaro <peppe.cavallaro <at> st.com>
|
||||
*******************************************************************************/
|
||||
|
||||
+#include <linux/kernel.h>
|
||||
#include <linux/io.h>
|
||||
#include "mmc.h"
|
||||
|
||||
--
|
@ -22,14 +22,14 @@ diff -up linux-3.1.x86_64/drivers/bcma/host_pci.c.orig linux-3.1.x86_64/drivers/
|
||||
{ 0, },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl);
|
||||
diff -up linux-3.1.x86_64/drivers/net/wireless/brcm80211/Kconfig.orig linux-3.1.x86_64/drivers/net/wireless/brcm80211/Kconfig
|
||||
--- linux-3.1.x86_64/drivers/net/wireless/brcm80211/Kconfig.orig 2011-11-10 11:42:31.764930961 -0500
|
||||
+++ linux-3.1.x86_64/drivers/net/wireless/brcm80211/Kconfig 2011-11-10 11:42:33.613907846 -0500
|
||||
@@ -5,7 +5,6 @@ config BRCMSMAC
|
||||
|
||||
--- linux-2.6.43.noarch/drivers/net/wireless/brcm80211/Kconfig~ 2012-03-26 12:37:17.512820450 -0400
|
||||
+++ linux-2.6.43.noarch/drivers/net/wireless/brcm80211/Kconfig 2012-03-26 12:37:36.270777605 -0400
|
||||
@@ -4,7 +4,6 @@ config BRCMUTIL
|
||||
config BRCMSMAC
|
||||
tristate "Broadcom IEEE802.11n PCIe SoftMAC WLAN driver"
|
||||
depends on PCI
|
||||
depends on MAC80211
|
||||
- depends on BCMA=n
|
||||
- depends on BCMA
|
||||
select BRCMUTIL
|
||||
select FW_LOADER
|
||||
select CRC_CCITT
|
||||
|
105
bluetooth-use-after-free.patch
Normal file
105
bluetooth-use-after-free.patch
Normal file
@ -0,0 +1,105 @@
|
||||
From 2a5a5ec620a29d4ba07743c3151cdf0a417c8f8c Mon Sep 17 00:00:00 2001
|
||||
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
|
||||
Date: Thu, 2 Feb 2012 10:32:18 +0200
|
||||
Subject: [PATCH] Bluetooth: Use list _safe deleting from conn chan_list
|
||||
|
||||
Fixes possible bug when deleting element from the list in
|
||||
function hci_chan_list_flush. list_for_each_entry_rcu is used
|
||||
and after deleting element from the list we also free pointer
|
||||
and then list_entry_rcu is taken from freed pointer.
|
||||
|
||||
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
|
||||
Acked-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
|
||||
---
|
||||
net/bluetooth/hci_conn.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
|
||||
index b074bd6..b4ecdde 100644
|
||||
--- a/net/bluetooth/hci_conn.c
|
||||
+++ b/net/bluetooth/hci_conn.c
|
||||
@@ -975,10 +975,10 @@ int hci_chan_del(struct hci_chan *chan)
|
||||
|
||||
void hci_chan_list_flush(struct hci_conn *conn)
|
||||
{
|
||||
- struct hci_chan *chan;
|
||||
+ struct hci_chan *chan, *n;
|
||||
|
||||
BT_DBG("conn %p", conn);
|
||||
|
||||
- list_for_each_entry_rcu(chan, &conn->chan_list, list)
|
||||
+ list_for_each_entry_safe(chan, n, &conn->chan_list, list)
|
||||
hci_chan_del(chan);
|
||||
}
|
||||
--
|
||||
1.7.6.5
|
||||
|
||||
From 3c4e0df028935618d052235ba85bc7079be13394 Mon Sep 17 00:00:00 2001
|
||||
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
|
||||
Date: Thu, 2 Feb 2012 10:32:17 +0200
|
||||
Subject: [PATCH] Bluetooth: Use list _safe deleting from conn_hash_list
|
||||
|
||||
Use list_for_each_entry_safe which is safe version against removal
|
||||
of list entry. Otherwise we remove hci_conn element and reference
|
||||
next element which result in accessing LIST_POISON.
|
||||
|
||||
[ 95.571834] Bluetooth: unknown link type 127
|
||||
[ 95.578349] BUG: unable to handle kernel paging request at 20002000
|
||||
[ 95.580236] IP: [<20002000>] 0x20001fff
|
||||
[ 95.580763] *pde = 00000000
|
||||
[ 95.581196] Oops: 0000 [#1] SMP
|
||||
...
|
||||
[ 95.582298] Pid: 3355, comm: hciconfig Tainted: G O 3.2.0-VirttualBox
|
||||
[ 95.582298] EIP: 0060:[<20002000>] EFLAGS: 00210206 CPU: 0
|
||||
[ 95.582298] EIP is at 0x20002000
|
||||
...
|
||||
[ 95.582298] Call Trace:
|
||||
[ 95.582298] [<f8231ab6>] ? hci_conn_hash_flush+0x76/0xf0 [bluetooth]
|
||||
[ 95.582298] [<f822bcb1>] hci_dev_do_close+0xc1/0x2e0 [bluetooth]
|
||||
[ 95.582298] [<f822d679>] ? hci_dev_get+0x69/0xb0 [bluetooth]
|
||||
[ 95.582298] [<f822e1da>] hci_dev_close+0x2a/0x50 [bluetooth]
|
||||
[ 95.582298] [<f824102f>] hci_sock_ioctl+0x1af/0x3f0 [bluetooth]
|
||||
[ 95.582298] [<c11153ea>] ? handle_pte_fault+0x8a/0x8f0
|
||||
[ 95.582298] [<c146becf>] sock_ioctl+0x5f/0x260
|
||||
[ 95.582298] [<c146be70>] ? sock_fasync+0x90/0x90
|
||||
[ 95.582298] [<c1152b33>] do_vfs_ioctl+0x83/0x5b0
|
||||
[ 95.582298] [<c1563f87>] ? do_page_fault+0x297/0x500
|
||||
[ 95.582298] [<c1563cf0>] ? spurious_fault+0xd0/0xd0
|
||||
[ 95.582298] [<c107165b>] ? up_read+0x1b/0x30
|
||||
[ 95.582298] [<c1563f87>] ? do_page_fault+0x297/0x500
|
||||
[ 95.582298] [<c100aa9f>] ? init_fpu+0xef/0x160
|
||||
[ 95.582298] [<c15617c0>] ? do_debug+0x180/0x180
|
||||
[ 95.582298] [<c100a958>] ? fpu_finit+0x28/0x80
|
||||
[ 95.582298] [<c11530e7>] sys_ioctl+0x87/0x90
|
||||
[ 95.582298] [<c156795f>] sysenter_do_call+0x12/0x38
|
||||
...
|
||||
|
||||
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
|
||||
Acked-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
|
||||
---
|
||||
net/bluetooth/hci_conn.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
|
||||
index aca71c0..b074bd6 100644
|
||||
--- a/net/bluetooth/hci_conn.c
|
||||
+++ b/net/bluetooth/hci_conn.c
|
||||
@@ -795,11 +795,11 @@ timer:
|
||||
void hci_conn_hash_flush(struct hci_dev *hdev)
|
||||
{
|
||||
struct hci_conn_hash *h = &hdev->conn_hash;
|
||||
- struct hci_conn *c;
|
||||
+ struct hci_conn *c, *n;
|
||||
|
||||
BT_DBG("hdev %s", hdev->name);
|
||||
|
||||
- list_for_each_entry_rcu(c, &h->list, list) {
|
||||
+ list_for_each_entry_safe(c, n, &h->list, list) {
|
||||
c->state = BT_CLOSED;
|
||||
|
||||
hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM);
|
||||
--
|
||||
1.7.6.5
|
||||
|
@ -1,58 +0,0 @@
|
||||
From http://permalink.gmane.org/gmane.linux.usb.general/9236
|
||||
|
||||
attempt to diagnose https://bugzilla.redhat.com/show_bug.cgi?id=787607
|
||||
|
||||
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
|
||||
index 9543b19..6dcc3a3 100644
|
||||
--- a/drivers/usb/class/cdc-acm.c
|
||||
+++ b/drivers/usb/class/cdc-acm.c
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <linux/serial.h>
|
||||
#include <linux/tty_driver.h>
|
||||
#include <linux/tty_flip.h>
|
||||
+#include <linux/serial.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/uaccess.h>
|
||||
@@ -734,15 +734,40 @@ static int acm_tty_tiocmset(struct tty_s
|
||||
return acm_set_control(acm, acm->ctrlout = newctrl);
|
||||
}
|
||||
|
||||
+static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
|
||||
+{
|
||||
+ struct serial_struct tmp;
|
||||
+
|
||||
+ if (!info)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ memset(&tmp, 0, sizeof(tmp));
|
||||
+ tmp.flags = ASYNC_LOW_LATENCY;
|
||||
+ tmp.xmit_fifo_size = acm->writesize;
|
||||
+ tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);
|
||||
+
|
||||
+ if (copy_to_user(info, &tmp, sizeof(tmp)))
|
||||
+ return -EFAULT;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int acm_tty_ioctl(struct tty_struct *tty,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct acm *acm = tty->driver_data;
|
||||
+ int rv = -ENOIOCTLCMD;
|
||||
|
||||
if (!ACM_READY(acm))
|
||||
return -EINVAL;
|
||||
|
||||
- return -ENOIOCTLCMD;
|
||||
+ switch (cmd) {
|
||||
+ case TIOCGSERIAL: /* gets serial port data */
|
||||
+ rv = get_serial_info(acm, (struct serial_struct __user *) arg);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return rv;
|
||||
}
|
||||
|
||||
static const __u32 acm_tty_speed[] = {
|
@ -186,9 +186,6 @@ CONFIG_LSM_MMAP_MIN_ADDR=32768
|
||||
# CONFIG_DRM_NOUVEAU is not set
|
||||
# CONFIG_MLX4_EN is not set
|
||||
|
||||
# drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]
|
||||
# CONFIG_TOUCHSCREEN_EETI is not set
|
||||
|
||||
# FIXME: Guesses, need checking
|
||||
# CONFIG_MACH_EUKREA_CPUIMX35SD is not set
|
||||
CONFIG_ARM_ERRATA_720789=y
|
||||
@ -197,3 +194,15 @@ CONFIG_ARM_ERRATA_751472=y
|
||||
# CONFIG_MX3_IPU is not set
|
||||
# CONFIG_MX3_IPU_IRQS is not set
|
||||
|
||||
# CONFIG_OF_SELFTEST is not set
|
||||
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
|
||||
# CONFIG_INPUT_GP2A is not set
|
||||
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
|
||||
|
||||
# CONFIG_MACH_IMX51_DT is not set
|
||||
# CONFIG_MACH_IMX53_DT is not set
|
||||
# CONFIG_MACH_MX53_EVK is not set
|
||||
# CONFIG_MACH_MX53_SMD is not set
|
||||
# CONFIG_MACH_MX53_LOCO is not set
|
||||
# CONFIG_MACH_MX53_ARD is not set
|
||||
# CONFIG_ARM_EXYNOS4210_CPUFREQ is not set
|
||||
|
@ -14,3 +14,4 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
|
||||
CONFIG_CPU_FREQ_TABLE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_FREQ_STAT_DETAILS=y
|
||||
CONFIG_NET_CALXEDA_XGMAC=y
|
||||
|
@ -33,7 +33,7 @@ CONFIG_MXC_IRQ_PRIOR=y
|
||||
CONFIG_MXC_PWM=m
|
||||
CONFIG_MXC_DEBUG_BOARD=y
|
||||
# CONFIG_CPU_BPREDICT_DISABLE is not set
|
||||
CONFIG_CACHE_L2X0=y
|
||||
# CONFIG_CACHE_L2X0 is not set
|
||||
CONFIG_ARM_DMA_MEM_BUFFERABLE=y
|
||||
CONFIG_ARM_ERRATA_411920=y
|
||||
CONFIG_PL310_ERRATA_588369=y
|
||||
@ -56,7 +56,7 @@ CONFIG_DVB_TDA1004X=m
|
||||
CONFIG_DVB_PLL=m
|
||||
CONFIG_SND_IMX_SOC=m
|
||||
CONFIG_USB_EHCI_MXC=y
|
||||
# CONFIG_USB_IMX21_HCD is not set
|
||||
CONFIG_USB_IMX21_HCD=m
|
||||
CONFIG_MMC_SDHCI_ESDHC_IMX=m
|
||||
CONFIG_MMC_MXC=m
|
||||
CONFIG_RTC_MXC=m
|
||||
|
@ -39,3 +39,5 @@ CONFIG_LEDS_NETXBIG=m
|
||||
CONFIG_RTC_DRV_MV=m
|
||||
CONFIG_MV_XOR=y
|
||||
CONFIG_CRYPTO_DEV_MV_CESA=m
|
||||
|
||||
# CONFIG_TOUCHSCREEN_EETI is not set
|
||||
|
@ -1083,3 +1083,14 @@ CONFIG_LEDS_RENESAS_TPU=y
|
||||
# CONFIG_OMAP_IOMMU is not set
|
||||
CONFIG_USB_RENESAS_USBHS_HCD=m
|
||||
|
||||
# CONFIG_SOC_OMAPTI81XX is not set
|
||||
# CONFIG_SOC_OMAPAM33XX is not set
|
||||
# CONFIG_MACH_TI8148EVM is not set
|
||||
# CONFIG_OMAP4_ERRATA_I688 is not set
|
||||
# CONFIG_ARM_LPAE is not set
|
||||
# CONFIG_MICREL_KS8995MA is not set
|
||||
# CONFIG_CHARGER_MANAGER is not set
|
||||
# CONFIG_MFD_DA9052_SPI is not set
|
||||
# CONFIG_MFD_DA9052_I2C is not set
|
||||
# CONFIG_MFD_S5M_CORE is not set
|
||||
# CONFIG_VIDEO_AS3645A is not set
|
||||
|
@ -68,7 +68,6 @@ CONFIG_KEYBOARD_NVEC=y
|
||||
CONFIG_SERIO_NVEC_PS2=y
|
||||
CONFIG_NVEC_POWER=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_NVEC_LEDS=y
|
||||
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEBUG=y
|
||||
@ -91,3 +90,12 @@ CONFIG_ARM_CPU_TOPOLOGY=y
|
||||
CONFIG_SCHED_MC=y
|
||||
CONFIG_SCHED_SMT=y
|
||||
CONFIG_LEDS_RENESAS_TPU=y
|
||||
|
||||
# CONFIG_ARCH_TEGRA_2x_SOC is not set
|
||||
# CONFIG_ARCH_TEGRA_3x_SOC is not set
|
||||
# CONFIG_ETHERNET is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_DVB_TDA1004X is not set
|
||||
# CONFIG_DVB_PLL is not set
|
||||
# CONFIG_SND_SOC_TEGRA_ALC5632 is not set
|
||||
|
||||
|
@ -4600,7 +4600,57 @@ CONFIG_BCMA_HOST_PCI=y
|
||||
# CONFIG_BCMA_DEBUG is not set
|
||||
|
||||
# CONFIG_GOOGLE_FIRMWARE is not set
|
||||
CONFIG_INTEL_MID_PTI=m
|
||||
# CONFIG_INTEL_MID_PTI is not set
|
||||
CONFIG_IOMMU_SUPPORT=y
|
||||
|
||||
# CONFIG_PM_DEVFREQ is not set
|
||||
# CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set
|
||||
CONFIG_CGROUP_MEM_RES_CTLR_KMEM=y
|
||||
CONFIG_UNIX_DIAG=m
|
||||
CONFIG_INET_UDP_DIAG=m
|
||||
CONFIG_NETFILTER_NETLINK_ACCT=m
|
||||
CONFIG_NF_CONNTRACK_PROCFS=y
|
||||
CONFIG_NETFILTER_XT_MATCH_ECN=m
|
||||
CONFIG_NETFILTER_XT_MATCH_NFACCT=m
|
||||
CONFIG_IP_VS_SH_TAB_BITS=8
|
||||
CONFIG_IP_NF_MATCH_RPFILTER=m
|
||||
CONFIG_IP6_NF_MATCH_RPFILTER=m
|
||||
CONFIG_OPENVSWITCH=m
|
||||
CONFIG_NETPRIO_CGROUP=m
|
||||
# CONFIG_BLK_DEV_NVME is not set
|
||||
CONFIG_NET_TEAM=m
|
||||
CONFIG_NET_TEAM_MODE_ROUNDROBIN=m
|
||||
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
|
||||
CONFIG_NET_CALXEDA_XGMAC=m
|
||||
# CONFIG_STMMAC_PLATFORM is not set
|
||||
# CONFIG_STMMAC_PCI is not set
|
||||
CONFIG_ATH9K_BTCOEX_SUPPORT=y
|
||||
# CONFIG_B43_BCMA_EXTRA is not set
|
||||
CONFIG_BRCMFMAC_SDIO=y
|
||||
# CONFIG_IWLWIFI_P2P is not set
|
||||
CONFIG_IWLEGACY_DEBUG=y
|
||||
CONFIG_IWLEGACY_DEBUGFS=y
|
||||
CONFIG_IWLEGACY_DEBUGFS=y
|
||||
# CONFIG_KEYBOARD_TCA8418 is not set
|
||||
# CONFIG_KEYBOARD_SAMSUNG is not set
|
||||
CONFIG_TOUCHSCREEN_EGALAX=m
|
||||
CONFIG_TOUCHSCREEN_PIXCIR=m
|
||||
# CONFIG_BATTERY_SBS is not set
|
||||
# CONFIG_CHARGER_LP8727 is not set
|
||||
CONFIG_IR_SANYO_DECODER=m
|
||||
CONFIG_MEDIA_TUNER_MT2063=m
|
||||
CONFIG_USB_GSPCA_JL2005BCD=m
|
||||
CONFIG_V4L_PCI_DRIVERS=y
|
||||
# CONFIG_V4L_ISA_PARPORT_DRIVERS is not set
|
||||
# CONFIG_V4L_PLATFORM_DRIVERS is not set
|
||||
CONFIG_DVB_HD29L2=m
|
||||
CONFIG_HID_ROCCAT_ISKU=m
|
||||
CONFIG_HID_WIIMOTE_EXT=y
|
||||
# CONFIG_USB_EHCI_MV is not set
|
||||
# CONFIG_LEDS_TCA6507 is not set
|
||||
# CONFIG_LEDS_OT200 is not set
|
||||
CONFIG_INFINIBAND_SRPT=m
|
||||
# CONFIG_RTLLIB is not set
|
||||
# CONFIG_ANDROID is not set
|
||||
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
|
||||
# CONFIG_NFSD_FAULT_INJECTION is not set
|
||||
|
@ -353,3 +353,10 @@ CONFIG_RFKILL_GPIO=m
|
||||
|
||||
# Disable btrfs until it is shown to work with 64k pages (rhbz 747079)
|
||||
# CONFIG_BTRFS_FS is not set
|
||||
# CONFIG_OF_SELFTEST is not set
|
||||
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
|
||||
# CONFIG_INPUT_GP2A is not set
|
||||
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
|
||||
# CONFIG_CPU_IDLE is not set
|
||||
# CONFIG_V4L_RADIO_ISA_DRIVERS is not set
|
||||
CONFIG_STRICT_DEVMEM=y
|
||||
|
@ -158,3 +158,6 @@ CONFIG_IO_EVENT_IRQ=y
|
||||
CONFIG_HW_RANDOM_AMD=m
|
||||
|
||||
CONFIG_BPF_JIT=y
|
||||
# CONFIG_PPC_ICSWX_PID is not set
|
||||
# CONFIG_PPC_ICSWX_USE_SIGILL is not set
|
||||
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
|
||||
|
@ -195,3 +195,4 @@ CONFIG_CRYPTO_DEV_NIAGARA2=y
|
||||
# CONFIG_MTD_OF_PARTS is not set
|
||||
# CONFIG_MTD_PHYSMAP_OF is not set
|
||||
# CONFIG_MMC_SDHCI_OF is not set
|
||||
# CONFIG_OF_SELFTEST is not set
|
||||
|
@ -203,3 +203,7 @@ CONFIG_I2O_BUS=m
|
||||
# CONFIG_EDAC_SBRIDGE is not set
|
||||
|
||||
# CONFIG_X86_WANT_INTEL_MID is not set
|
||||
# CONFIG_OF_SELFTEST is not set
|
||||
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
|
||||
# CONFIG_INPUT_GP2A is not set
|
||||
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
|
||||
|
@ -384,3 +384,15 @@ CONFIG_RELOCATABLE=y
|
||||
|
||||
# CONFIG_HYPERV is not set
|
||||
|
||||
CONFIG_EFI_STUB=y
|
||||
CONFIG_PCI_IOAPIC=y
|
||||
CONFIG_BLK_DEV_PCIESSD_MTIP32XX=m
|
||||
CONFIG_VIA_WDT=m
|
||||
# CONFIG_V4L_RADIO_ISA_DRIVERS is not set
|
||||
CONFIG_DRM_GMA500=m
|
||||
CONFIG_FUJITSU_TABLET=m
|
||||
CONFIG_AMILO_RFKILL=m
|
||||
# CONFIG_DEBUG_NMI_SELFTEST is not set
|
||||
CONFIG_CRYPTO_SERPENT_SSE2_586=m
|
||||
# CONFIG_DRM_GMA600 is not set
|
||||
# CONFIG_DRM_GMA3600 is not set
|
||||
|
@ -118,3 +118,6 @@ CONFIG_BPF_JIT=y
|
||||
# Should be 32bit only, but lacks KConfig depends
|
||||
# CONFIG_XO15_EBOOK is not set
|
||||
|
||||
# CONFIG_X86_NUMACHIP is not set
|
||||
CONFIG_AMD_IOMMU_V2=m
|
||||
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
|
||||
|
69
drm-i915-dp-stfu.patch
Normal file
69
drm-i915-dp-stfu.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From 04a43e2598db35b3d0ec25925bb8475b5c0a3809 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Jackson <ajax@redhat.com>
|
||||
Date: Fri, 16 Mar 2012 16:39:11 -0400
|
||||
Subject: [PATCH] drm/i915/dp: Use DRM_ERROR not WARN for sanity checks
|
||||
|
||||
These are noisy as shit and creating a ton of abrt reports. I don't
|
||||
need more, thanks. Proper fix upstream eventually.
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
---
|
||||
drivers/gpu/drm/i915/intel_dp.c | 14 ++++++++------
|
||||
1 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
|
||||
index 94f860c..6bf27c9 100644
|
||||
--- a/drivers/gpu/drm/i915/intel_dp.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_dp.c
|
||||
@@ -331,7 +331,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
|
||||
if (!is_edp(intel_dp))
|
||||
return;
|
||||
if (!ironlake_edp_have_panel_power(intel_dp) && !ironlake_edp_have_panel_vdd(intel_dp)) {
|
||||
- WARN(1, "eDP powered off while attempting aux channel communication.\n");
|
||||
+ DRM_ERROR("eDP powered off while attempting aux channel communication.\n");
|
||||
DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n",
|
||||
I915_READ(PCH_PP_STATUS),
|
||||
I915_READ(PCH_PP_CONTROL));
|
||||
@@ -386,7 +386,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
|
||||
}
|
||||
|
||||
if (try == 3) {
|
||||
- WARN(1, "dp_aux_ch not started status 0x%08x\n",
|
||||
+ DRM_ERROR("dp_aux_ch not started status 0x%08x\n",
|
||||
I915_READ(ch_ctl));
|
||||
return -EBUSY;
|
||||
}
|
||||
@@ -992,8 +992,8 @@ static void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
|
||||
return;
|
||||
DRM_DEBUG_KMS("Turn eDP VDD on\n");
|
||||
|
||||
- WARN(intel_dp->want_panel_vdd,
|
||||
- "eDP VDD already requested on\n");
|
||||
+ if (intel_dp->want_panel_vdd)
|
||||
+ DRM_ERROR("eDP VDD already requested on\n");
|
||||
|
||||
intel_dp->want_panel_vdd = true;
|
||||
|
||||
@@ -1058,7 +1058,8 @@ static void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
|
||||
return;
|
||||
|
||||
DRM_DEBUG_KMS("Turn eDP VDD off %d\n", intel_dp->want_panel_vdd);
|
||||
- WARN(!intel_dp->want_panel_vdd, "eDP VDD not forced on");
|
||||
+ if (!intel_dp->want_panel_vdd)
|
||||
+ DRM_ERROR("eDP VDD not forced on");
|
||||
|
||||
intel_dp->want_panel_vdd = false;
|
||||
|
||||
@@ -1128,7 +1129,8 @@ static void ironlake_edp_panel_off(struct intel_dp *intel_dp)
|
||||
|
||||
DRM_DEBUG_KMS("Turn eDP power off\n");
|
||||
|
||||
- WARN(intel_dp->want_panel_vdd, "Cannot turn power off while VDD is on\n");
|
||||
+ if (intel_dp->want_panel_vdd)
|
||||
+ DRM_ERROR("Cannot turn power off while VDD is on\n");
|
||||
|
||||
pp = ironlake_get_pp_control(dev_priv);
|
||||
pp &= ~(POWER_TARGET_ON | EDP_FORCE_VDD | PANEL_POWER_RESET | EDP_BLC_ENABLE);
|
||||
--
|
||||
1.7.7.6
|
||||
|
@ -1,95 +0,0 @@
|
||||
From 09357b00255c233705b1cf6d76a8d147340545b8 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
|
||||
Date: Fri, 18 Nov 2011 14:25:00 +0000
|
||||
Subject: [PATCH] e1000e: Avoid wrong check on TX hang
|
||||
|
||||
Based on the original patch submitted my Michael Wang
|
||||
<wangyun@linux.vnet.ibm.com>.
|
||||
Descriptors may not be write-back while checking TX hang with flag
|
||||
FLAG2_DMA_BURST on.
|
||||
So when we detect hang, we just flush the descriptor and detect
|
||||
again for once.
|
||||
|
||||
-v2 change 1 to true and 0 to false and remove extra ()
|
||||
|
||||
CC: Michael Wang <wangyun@linux.vnet.ibm.com>
|
||||
CC: Flavio Leitner <fbl@redhat.com>
|
||||
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
|
||||
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
|
||||
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
|
||||
---
|
||||
drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
|
||||
drivers/net/ethernet/intel/e1000e/netdev.c | 23 ++++++++++++++++++++---
|
||||
2 files changed, 21 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
index 9fe18d1..f478a22 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
@@ -309,6 +309,7 @@ struct e1000_adapter {
|
||||
u32 txd_cmd;
|
||||
|
||||
bool detect_tx_hung;
|
||||
+ bool tx_hang_recheck;
|
||||
u8 tx_timeout_factor;
|
||||
|
||||
u32 tx_int_delay;
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
index c6e9763..c12df69 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
@@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
||||
struct e1000_adapter *adapter = container_of(work,
|
||||
struct e1000_adapter,
|
||||
print_hang_task);
|
||||
+ struct net_device *netdev = adapter->netdev;
|
||||
struct e1000_ring *tx_ring = adapter->tx_ring;
|
||||
unsigned int i = tx_ring->next_to_clean;
|
||||
unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
|
||||
@@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
||||
if (test_bit(__E1000_DOWN, &adapter->state))
|
||||
return;
|
||||
|
||||
+ if (!adapter->tx_hang_recheck &&
|
||||
+ (adapter->flags2 & FLAG2_DMA_BURST)) {
|
||||
+ /* May be block on write-back, flush and detect again
|
||||
+ * flush pending descriptor writebacks to memory
|
||||
+ */
|
||||
+ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
|
||||
+ /* execute the writes immediately */
|
||||
+ e1e_flush();
|
||||
+ adapter->tx_hang_recheck = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ /* Real hang detected */
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
+ netif_stop_queue(netdev);
|
||||
+
|
||||
e1e_rphy(hw, PHY_STATUS, &phy_status);
|
||||
e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
|
||||
e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
|
||||
@@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
|
||||
if (tx_ring->buffer_info[i].time_stamp &&
|
||||
time_after(jiffies, tx_ring->buffer_info[i].time_stamp
|
||||
+ (adapter->tx_timeout_factor * HZ)) &&
|
||||
- !(er32(STATUS) & E1000_STATUS_TXOFF)) {
|
||||
+ !(er32(STATUS) & E1000_STATUS_TXOFF))
|
||||
schedule_work(&adapter->print_hang_task);
|
||||
- netif_stop_queue(netdev);
|
||||
- }
|
||||
+ else
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
}
|
||||
adapter->total_tx_bytes += total_tx_bytes;
|
||||
adapter->total_tx_packets += total_tx_packets;
|
||||
@@ -3838,6 +3854,7 @@ static int e1000_open(struct net_device *netdev)
|
||||
|
||||
e1000_irq_enable(adapter);
|
||||
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
netif_start_queue(netdev);
|
||||
|
||||
adapter->idle_check = true;
|
||||
--
|
||||
1.7.9
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 1415dd8705394399d59a3df1ab48d149e1e41e77 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Thu, 8 Dec 2011 21:13:46 +0100
|
||||
Subject: [PATCH] ext3: Fix error handling on inode bitmap corruption
|
||||
|
||||
When insert_inode_locked() fails in ext3_new_inode() it most likely
|
||||
means inode bitmap got corrupted and we allocated again inode which
|
||||
is already in use. Also doing unlock_new_inode() during error recovery
|
||||
is wrong since inode does not have I_NEW set. Fix the problem by jumping
|
||||
to fail: (instead of fail_drop:) which declares filesystem error and
|
||||
does not call unlock_new_inode().
|
||||
|
||||
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
fs/ext3/ialloc.c | 8 ++++++--
|
||||
1 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
|
||||
index 5c866e0..adae962 100644
|
||||
--- a/fs/ext3/ialloc.c
|
||||
+++ b/fs/ext3/ialloc.c
|
||||
@@ -525,8 +525,12 @@ got:
|
||||
if (IS_DIRSYNC(inode))
|
||||
handle->h_sync = 1;
|
||||
if (insert_inode_locked(inode) < 0) {
|
||||
- err = -EINVAL;
|
||||
- goto fail_drop;
|
||||
+ /*
|
||||
+ * Likely a bitmap corruption causing inode to be allocated
|
||||
+ * twice.
|
||||
+ */
|
||||
+ err = -EIO;
|
||||
+ goto fail;
|
||||
}
|
||||
spin_lock(&sbi->s_next_gen_lock);
|
||||
inode->i_generation = sbi->s_next_generation++;
|
||||
--
|
||||
1.7.6.5
|
||||
|
@ -1,19 +0,0 @@
|
||||
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
|
||||
index 00beb4f..8fb6844 100644
|
||||
--- a/fs/ext4/ialloc.c
|
||||
+++ b/fs/ext4/ialloc.c
|
||||
@@ -885,8 +885,12 @@ got:
|
||||
if (IS_DIRSYNC(inode))
|
||||
ext4_handle_sync(handle);
|
||||
if (insert_inode_locked(inode) < 0) {
|
||||
- err = -EINVAL;
|
||||
- goto fail_drop;
|
||||
+ /*
|
||||
+ * Likely a bitmap corruption causing inode to be allocated
|
||||
+ * twice.
|
||||
+ */
|
||||
+ err = -EIO;
|
||||
+ goto fail;
|
||||
}
|
||||
spin_lock(&sbi->s_next_gen_lock);
|
||||
inode->i_generation = sbi->s_next_generation++;
|
@ -1,59 +1,35 @@
|
||||
From: Rafael J. Wysocki <rjw@sisk.pl>
|
||||
commit b94887bbc0621e1e8402e7f0ec4bc3adf46c9a6e
|
||||
Author: Rafael J. Wysocki <rjw@sisk.pl>
|
||||
Date: Fri Feb 17 12:42:08 2012 -0500
|
||||
|
||||
Freeze all filesystems during system suspend and (kernel-driven)
|
||||
hibernation by calling freeze_supers() for all superblocks and thaw
|
||||
them during the subsequent resume with the help of thaw_supers().
|
||||
Freeze all filesystems during system suspend and (kernel-driven)
|
||||
hibernation by calling freeze_supers() for all superblocks and thaw
|
||||
them during the subsequent resume with the help of thaw_supers().
|
||||
|
||||
This makes filesystems stay in a consistent state in case something
|
||||
goes wrong between system suspend (or hibernation) and the subsequent
|
||||
resume (e.g. journal replays won't be necessary in those cases). In
|
||||
particular, this should help to solve a long-standing issue that, in
|
||||
some cases, during resume from hibernation the boot loader causes the
|
||||
journal to be replied for the filesystem containing the kernel image
|
||||
and/or initrd causing it to become inconsistent with the information
|
||||
stored in the hibernation image.
|
||||
|
||||
The user-space-driven hibernation (s2disk) is not covered by this
|
||||
change, because the freezing of filesystems prevents s2disk from
|
||||
accessing device special files it needs to do its job.
|
||||
|
||||
This change is based on earlier work by Nigel Cunningham.
|
||||
|
||||
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
|
||||
|
||||
Rebased to 3.3-rc3 by Josh Boyer <jwboyer@redhat.com>
|
||||
|
||||
This makes filesystems stay in a consistent state in case something
|
||||
goes wrong between system suspend (or hibernation) and the subsequent
|
||||
resume (e.g. journal replays won't be necessary in those cases). In
|
||||
particular, this should help to solve a long-standing issue that, in
|
||||
some cases, during resume from hibernation the boot loader causes the
|
||||
journal to be replied for the filesystem containing the kernel image
|
||||
and/or initrd causing it to become inconsistent with the information
|
||||
stored in the hibernation image.
|
||||
|
||||
The user-space-driven hibernation (s2disk) is not covered by this
|
||||
change, because the freezing of filesystems prevents s2disk from
|
||||
accessing device special files it needs to do its job.
|
||||
|
||||
This change is based on earlier work by Nigel Cunningham.
|
||||
|
||||
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
|
||||
---
|
||||
fs/super.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/linux/fs.h | 3 +
|
||||
kernel/power/hibernate.c | 11 +++++--
|
||||
kernel/power/power.h | 23 --------------
|
||||
kernel/power/suspend.c | 42 +++++++++++++++++++++++++++
|
||||
5 files changed, 128 insertions(+), 24 deletions(-)
|
||||
|
||||
Index: linux/include/linux/fs.h
|
||||
===================================================================
|
||||
--- linux.orig/include/linux/fs.h
|
||||
+++ linux/include/linux/fs.h
|
||||
@@ -210,6 +210,7 @@ struct inodes_stat_t {
|
||||
#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
|
||||
#define MS_I_VERSION (1<<23) /* Update inode I_version field */
|
||||
#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
|
||||
+#define MS_FROZEN (1<<25) /* Frozen filesystem */
|
||||
#define MS_NOSEC (1<<28)
|
||||
#define MS_BORN (1<<29)
|
||||
#define MS_ACTIVE (1<<30)
|
||||
@@ -2501,6 +2502,8 @@ extern void drop_super(struct super_bloc
|
||||
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
|
||||
extern void iterate_supers_type(struct file_system_type *,
|
||||
void (*)(struct super_block *, void *), void *);
|
||||
+extern int freeze_supers(void);
|
||||
+extern void thaw_supers(void);
|
||||
|
||||
extern int dcache_dir_open(struct inode *, struct file *);
|
||||
extern int dcache_dir_close(struct inode *, struct file *);
|
||||
Index: linux/fs/super.c
|
||||
===================================================================
|
||||
--- linux.orig/fs/super.c
|
||||
+++ linux/fs/super.c
|
||||
@@ -594,6 +594,79 @@ void iterate_supers_type(struct file_sys
|
||||
diff --git a/fs/super.c b/fs/super.c
|
||||
index 6015c02..c8057fa 100644
|
||||
--- a/fs/super.c
|
||||
+++ b/fs/super.c
|
||||
@@ -594,6 +594,79 @@ void iterate_supers_type(struct file_system_type *type,
|
||||
EXPORT_SYMBOL(iterate_supers_type);
|
||||
|
||||
/**
|
||||
@ -65,7 +41,7 @@ Index: linux/fs/super.c
|
||||
+
|
||||
+ spin_lock(&sb_lock);
|
||||
+ list_for_each_entry(sb, &super_blocks, s_list) {
|
||||
+ if (list_empty(&sb->s_instances))
|
||||
+ if (hlist_unhashed(&sb->s_instances))
|
||||
+ continue;
|
||||
+ sb->s_count++;
|
||||
+ spin_unlock(&sb_lock);
|
||||
@ -99,7 +75,7 @@ Index: linux/fs/super.c
|
||||
+ * frozen in the right order (eg. loopback on ext3).
|
||||
+ */
|
||||
+ list_for_each_entry_reverse(sb, &super_blocks, s_list) {
|
||||
+ if (list_empty(&sb->s_instances))
|
||||
+ if (hlist_unhashed(&sb->s_instances))
|
||||
+ continue;
|
||||
+ sb->s_count++;
|
||||
+ spin_unlock(&sb_lock);
|
||||
@ -133,98 +109,31 @@ Index: linux/fs/super.c
|
||||
* get_super - get the superblock of a device
|
||||
* @bdev: device to get the superblock for
|
||||
*
|
||||
Index: linux/kernel/power/power.h
|
||||
===================================================================
|
||||
--- linux.orig/kernel/power/power.h
|
||||
+++ linux/kernel/power/power.h
|
||||
@@ -1,3 +1,4 @@
|
||||
+#include <linux/fs.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/suspend_ioctls.h>
|
||||
#include <linux/utsname.h>
|
||||
@@ -227,25 +228,3 @@ enum {
|
||||
#define TEST_MAX (__TEST_AFTER_LAST - 1)
|
||||
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||
index 386da09..a164f4a 100644
|
||||
--- a/include/linux/fs.h
|
||||
+++ b/include/linux/fs.h
|
||||
@@ -210,6 +210,7 @@ struct inodes_stat_t {
|
||||
#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
|
||||
#define MS_I_VERSION (1<<23) /* Update inode I_version field */
|
||||
#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
|
||||
+#define MS_FROZEN (1<<25) /* Frozen filesystem */
|
||||
#define MS_NOSEC (1<<28)
|
||||
#define MS_BORN (1<<29)
|
||||
#define MS_ACTIVE (1<<30)
|
||||
@@ -2501,6 +2502,8 @@ extern void drop_super(struct super_block *sb);
|
||||
extern void iterate_supers(void (*)(struct super_block *, void *), void *);
|
||||
extern void iterate_supers_type(struct file_system_type *,
|
||||
void (*)(struct super_block *, void *), void *);
|
||||
+extern int freeze_supers(void);
|
||||
+extern void thaw_supers(void);
|
||||
|
||||
extern int pm_test_level;
|
||||
-
|
||||
-#ifdef CONFIG_SUSPEND_FREEZER
|
||||
-static inline int suspend_freeze_processes(void)
|
||||
-{
|
||||
- int error = freeze_processes();
|
||||
- return error ? : freeze_kernel_threads();
|
||||
-}
|
||||
-
|
||||
-static inline void suspend_thaw_processes(void)
|
||||
-{
|
||||
- thaw_processes();
|
||||
-}
|
||||
-#else
|
||||
-static inline int suspend_freeze_processes(void)
|
||||
-{
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static inline void suspend_thaw_processes(void)
|
||||
-{
|
||||
-}
|
||||
-#endif
|
||||
Index: linux/kernel/power/suspend.c
|
||||
===================================================================
|
||||
--- linux.orig/kernel/power/suspend.c
|
||||
+++ linux/kernel/power/suspend.c
|
||||
@@ -29,6 +29,48 @@
|
||||
|
||||
#include "power.h"
|
||||
|
||||
+#ifdef CONFIG_SUSPEND_FREEZER
|
||||
+
|
||||
+static inline int suspend_freeze_processes(void)
|
||||
+{
|
||||
+ int error;
|
||||
+
|
||||
+ error = freeze_processes();
|
||||
+ if (error)
|
||||
+ return error;
|
||||
+
|
||||
+ error = freeze_supers();
|
||||
+ if (error) {
|
||||
+ thaw_processes();
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ error = freeze_kernel_threads();
|
||||
+ if (error)
|
||||
+ thaw_supers();
|
||||
+
|
||||
+ return error;
|
||||
+}
|
||||
+
|
||||
+static inline void suspend_thaw_processes(void)
|
||||
+{
|
||||
+ thaw_supers();
|
||||
+ thaw_processes();
|
||||
+}
|
||||
+
|
||||
+#else /* !CONFIG_SUSPEND_FREEZER */
|
||||
+
|
||||
+static inline int suspend_freeze_processes(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void suspend_thaw_processes(void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#endif /* !CONFIG_SUSPEND_FREEZER */
|
||||
+
|
||||
const char *const pm_states[PM_SUSPEND_MAX] = {
|
||||
[PM_SUSPEND_STANDBY] = "standby",
|
||||
[PM_SUSPEND_MEM] = "mem",
|
||||
Index: linux/kernel/power/hibernate.c
|
||||
===================================================================
|
||||
--- linux.orig/kernel/power/hibernate.c
|
||||
+++ linux/kernel/power/hibernate.c
|
||||
extern int dcache_dir_open(struct inode *, struct file *);
|
||||
extern int dcache_dir_close(struct inode *, struct file *);
|
||||
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
|
||||
index 6d6d288..492fc62 100644
|
||||
--- a/kernel/power/hibernate.c
|
||||
+++ b/kernel/power/hibernate.c
|
||||
@@ -626,12 +626,17 @@ int hibernate(void)
|
||||
if (error)
|
||||
goto Finish;
|
||||
@ -254,4 +163,125 @@ Index: linux/kernel/power/hibernate.c
|
||||
Thaw:
|
||||
thaw_processes();
|
||||
Finish:
|
||||
|
||||
diff --git a/kernel/power/power.h b/kernel/power/power.h
|
||||
index 21724ee..40d6f64 100644
|
||||
--- a/kernel/power/power.h
|
||||
+++ b/kernel/power/power.h
|
||||
@@ -1,3 +1,4 @@
|
||||
+#include <linux/fs.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/suspend_ioctls.h>
|
||||
#include <linux/utsname.h>
|
||||
@@ -227,45 +228,3 @@ enum {
|
||||
#define TEST_MAX (__TEST_AFTER_LAST - 1)
|
||||
|
||||
extern int pm_test_level;
|
||||
-
|
||||
-#ifdef CONFIG_SUSPEND_FREEZER
|
||||
-static inline int suspend_freeze_processes(void)
|
||||
-{
|
||||
- int error;
|
||||
-
|
||||
- error = freeze_processes();
|
||||
-
|
||||
- /*
|
||||
- * freeze_processes() automatically thaws every task if freezing
|
||||
- * fails. So we need not do anything extra upon error.
|
||||
- */
|
||||
- if (error)
|
||||
- goto Finish;
|
||||
-
|
||||
- error = freeze_kernel_threads();
|
||||
-
|
||||
- /*
|
||||
- * freeze_kernel_threads() thaws only kernel threads upon freezing
|
||||
- * failure. So we have to thaw the userspace tasks ourselves.
|
||||
- */
|
||||
- if (error)
|
||||
- thaw_processes();
|
||||
-
|
||||
- Finish:
|
||||
- return error;
|
||||
-}
|
||||
-
|
||||
-static inline void suspend_thaw_processes(void)
|
||||
-{
|
||||
- thaw_processes();
|
||||
-}
|
||||
-#else
|
||||
-static inline int suspend_freeze_processes(void)
|
||||
-{
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static inline void suspend_thaw_processes(void)
|
||||
-{
|
||||
-}
|
||||
-#endif
|
||||
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
|
||||
index 4fd51be..5f51fc7 100644
|
||||
--- a/kernel/power/suspend.c
|
||||
+++ b/kernel/power/suspend.c
|
||||
@@ -29,6 +29,62 @@
|
||||
|
||||
#include "power.h"
|
||||
|
||||
+#ifdef CONFIG_SUSPEND_FREEZER
|
||||
+
|
||||
+static inline int suspend_freeze_processes(void)
|
||||
+{
|
||||
+ int error;
|
||||
+
|
||||
+ error = freeze_processes();
|
||||
+
|
||||
+ /*
|
||||
+ * freeze_processes() automatically thaws every task if freezing
|
||||
+ * fails. So we need not do anything extra upon error.
|
||||
+ */
|
||||
+
|
||||
+ if (error)
|
||||
+ goto Finish;
|
||||
+
|
||||
+ error = freeze_supers();
|
||||
+ if (error) {
|
||||
+ thaw_processes();
|
||||
+ goto Finish;
|
||||
+ }
|
||||
+
|
||||
+ error = freeze_kernel_threads();
|
||||
+
|
||||
+ /*
|
||||
+ * freeze_kernel_threads() thaws only kernel threads upon freezing
|
||||
+ * failure. So we have to thaw the userspace tasks ourselves.
|
||||
+ */
|
||||
+ if (error) {
|
||||
+ thaw_supers();
|
||||
+ thaw_processes();
|
||||
+ }
|
||||
+
|
||||
+Finish:
|
||||
+ return error;
|
||||
+}
|
||||
+
|
||||
+static inline void suspend_thaw_processes(void)
|
||||
+{
|
||||
+ thaw_supers();
|
||||
+ thaw_processes();
|
||||
+}
|
||||
+
|
||||
+#else /* !CONFIG_SUSPEND_FREEZER */
|
||||
+
|
||||
+static inline int suspend_freeze_processes(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void suspend_thaw_processes(void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#endif /* !CONFIG_SUSPEND_FREEZER */
|
||||
+
|
||||
const char *const pm_states[PM_SUSPEND_MAX] = {
|
||||
[PM_SUSPEND_STANDBY] = "standby",
|
||||
[PM_SUSPEND_MEM] = "mem",
|
||||
|
@ -1,34 +0,0 @@
|
||||
hpsa: Add IRQF_SHARED back in for the non-MSI(X) interrupt handler
|
||||
|
||||
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
|
||||
|
||||
IRQF_SHARED is required for older controllers that don't support MSI(X)
|
||||
and which may end up sharing an interrupt. All the controllers hpsa
|
||||
normally supports have MSI(X) capability, but older controllers may be
|
||||
encountered via the hpsa_allow_any=1 module parameter.
|
||||
|
||||
Also remove deprecated IRQF_DISABLED.
|
||||
|
||||
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
|
||||
---
|
||||
drivers/scsi/hpsa.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
RHBZ 754907
|
||||
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
|
||||
index 865d452..594ce83 100644
|
||||
--- a/drivers/scsi/hpsa.c
|
||||
+++ b/drivers/scsi/hpsa.c
|
||||
@@ -4072,10 +4072,10 @@ static int hpsa_request_irq(struct ctlr_info *h,
|
||||
|
||||
if (h->msix_vector || h->msi_vector)
|
||||
rc = request_irq(h->intr[h->intr_mode], msixhandler,
|
||||
- IRQF_DISABLED, h->devname, h);
|
||||
+ 0, h->devname, h);
|
||||
else
|
||||
rc = request_irq(h->intr[h->intr_mode], intxhandler,
|
||||
- IRQF_DISABLED, h->devname, h);
|
||||
+ IRQF_SHARED, h->devname, h);
|
||||
if (rc) {
|
||||
dev_err(&h->pdev->dev, "unable to get irq %d for %s\n",
|
||||
h->intr[h->intr_mode], h->devname);
|
152
kernel.spec
152
kernel.spec
@ -42,16 +42,16 @@ Summary: The Linux kernel
|
||||
# When changing real_sublevel below, reset this by hand to 1
|
||||
# (or to 0 and then use rpmdev-bumpspec).
|
||||
#
|
||||
%global baserelease 3
|
||||
%global baserelease 1
|
||||
%global fedora_build %{baserelease}
|
||||
|
||||
# real_sublevel is the 3.x kernel version we're starting with
|
||||
%define real_sublevel 2
|
||||
%define real_sublevel 3
|
||||
# fake_sublevel is the 2.6.x version we're faking
|
||||
%define fake_sublevel %(echo $((40 + %{real_sublevel})))
|
||||
|
||||
# Do we have a -stable update to apply?
|
||||
%define stable_update 13
|
||||
%define stable_update 0
|
||||
# Is it a -stable RC?
|
||||
%define stable_rc 0
|
||||
# Set rpm version accordingly
|
||||
@ -600,6 +600,7 @@ Patch470: die-floppy-die.patch
|
||||
Patch471: floppy-drop-disable_hlt-warning.patch
|
||||
|
||||
Patch510: linux-2.6-silence-noise.patch
|
||||
Patch511: silence-timekeeping-spew.patch
|
||||
Patch520: quite-apm.patch
|
||||
Patch530: linux-2.6-silence-fbcon-logo.patch
|
||||
|
||||
@ -614,10 +615,10 @@ Patch1500: fix_xen_guest_on_old_EC2.patch
|
||||
|
||||
# DRM
|
||||
|
||||
# nouveau + drm fixes
|
||||
Patch1810: drm-nouveau-updates.patch
|
||||
# intel drm is all merged upstream
|
||||
Patch1824: drm-intel-next.patch
|
||||
Patch1825: drm-i915-dp-stfu.patch
|
||||
|
||||
# hush the i915 fbc noise
|
||||
Patch1826: drm-i915-fbc-stfu.patch
|
||||
|
||||
@ -640,7 +641,6 @@ Patch3500: jbd-jbd2-validate-sb-s_first-in-journal_get_superblo.patch
|
||||
# NFSv4
|
||||
Patch4000: NFSv4-Reduce-the-footprint-of-the-idmapper.patch
|
||||
Patch4001: NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
|
||||
Patch4003: NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
|
||||
|
||||
# patches headed upstream
|
||||
|
||||
@ -648,89 +648,57 @@ Patch12016: disable-i8042-check-on-apple-mac.patch
|
||||
|
||||
Patch12303: dmar-disable-when-ricoh-multifunction.patch
|
||||
|
||||
Patch13002: revert-efi-rtclock.patch
|
||||
Patch13003: efi-dont-map-boot-services-on-32bit.patch
|
||||
|
||||
Patch14000: cdc-acm-tiocgserial.patch
|
||||
Patch14000: hibernate-freeze-filesystems.patch
|
||||
|
||||
Patch15000: hibernate-freeze-filesystems.patch
|
||||
Patch14010: lis3-improve-handling-of-null-rate.patch
|
||||
|
||||
Patch15010: lis3-improve-handling-of-null-rate.patch
|
||||
Patch15000: bluetooth-use-after-free.patch
|
||||
|
||||
Patch20000: utrace.patch
|
||||
|
||||
# Flattened devicetree support
|
||||
Patch21000: arm-omap-dt-compat.patch
|
||||
Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch
|
||||
Patch21002: arm-build-bug-on.patch
|
||||
Patch21003: arm-stmmac-mmc-core.patch
|
||||
Patch21004: arm-tegra-nvec-kconfig.patch
|
||||
|
||||
#rhbz 717735
|
||||
Patch21045: nfs-client-freezer.patch
|
||||
|
||||
#rhbz 590880
|
||||
Patch21050: alps.patch
|
||||
|
||||
Patch21070: ext4-Support-check-none-nocheck-mount-options.patch
|
||||
Patch21071: ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
|
||||
Patch21072: ext3-Fix-error-handling-on-inode-bitmap-corruption.patch
|
||||
|
||||
#rhbz 769766
|
||||
Patch21073: mac80211-fix-rx-key-NULL-ptr-deref-in-promiscuous-mode.patch
|
||||
|
||||
#rhbz 773392
|
||||
Patch21074: KVM-x86-extend-struct-x86_emulate_ops-with-get_cpuid.patch
|
||||
Patch21075: KVM-x86-fix-missing-checks-in-syscall-emulation.patch
|
||||
|
||||
#rhbz 728740
|
||||
Patch21076: rtl8192cu-Fix-WARNING-on-suspend-resume.patch
|
||||
|
||||
#rhbz752176
|
||||
Patch21080: sysfs-msi-irq-per-device.patch
|
||||
|
||||
#rhbz 782686
|
||||
Patch21082: procfs-parse-mount-options.patch
|
||||
Patch21083: procfs-add-hidepid-and-gid-mount-options.patch
|
||||
Patch21084: proc-fix-null-pointer-deref-in-proc_pid_permission.patch
|
||||
|
||||
#rhbz 788260
|
||||
Patch21085: jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
||||
Patch21072: mac80211-fix-rx-key-NULL-ptr-deref-in-promiscuous-mode.patch
|
||||
|
||||
# Remove overlap between bcma/b43 and brcmsmac and reenable bcm4331
|
||||
Patch21091: bcma-brcmsmac-compat.patch
|
||||
|
||||
#rhbz 785806
|
||||
Patch21092: e1000e-Avoid-wrong-check-on-TX-hang.patch
|
||||
#rhbz 772772
|
||||
Patch21232: rt2x00_fix_MCU_request_failures.patch
|
||||
|
||||
#rhbz 754518
|
||||
#Patch21093: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
||||
#rhbz 788260
|
||||
Patch21233: jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
||||
|
||||
#rhbz 771058
|
||||
Patch21100: msi-irq-sysfs-warning.patch
|
||||
|
||||
# rhbz 754907
|
||||
Patch21101: hpsa-add-irqf-shared.patch
|
||||
#rhbz 789644
|
||||
Patch21237: mcelog-rcu-splat.patch
|
||||
|
||||
#rhbz 727865 730007
|
||||
Patch21102: ACPICA-Fix-regression-in-FADT-revision-checks.patch
|
||||
Patch21240: ACPICA-Fix-regression-in-FADT-revision-checks.patch
|
||||
|
||||
#rhbz 728478
|
||||
Patch21104: sony-laptop-Enable-keyboard-backlight-by-default.patch
|
||||
Patch21242: sony-laptop-Enable-keyboard-backlight-by-default.patch
|
||||
|
||||
#rhbz 803809 CVE-2012-1179
|
||||
Patch21106: mm-thp-fix-pmd_bad-triggering.patch
|
||||
Patch21244: mm-thp-fix-pmd_bad-triggering.patch
|
||||
|
||||
#rhbz 804947 CVE-2012-1568
|
||||
Patch21107: SHLIB_BASE-randomization.patch
|
||||
|
||||
Patch21110: x86-ioapic-add-register-checks-for-bogus-io-apic-entries.patch
|
||||
|
||||
Patch21200: unhandled-irqs-switch-to-polling.patch
|
||||
Patch21300: unhandled-irqs-switch-to-polling.patch
|
||||
|
||||
#rhbz 804007
|
||||
Patch21305: mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch
|
||||
|
||||
#rhbz 804957 CVE-2012-1568
|
||||
Patch21306: shlib_base_randomize.patch
|
||||
|
||||
Patch21350: x86-ioapic-add-register-checks-for-bogus-io-apic-entries.patch
|
||||
|
||||
Patch21501: nfs-Fix-length-of-buffer-copied-in-__nfs4_get_acl_uncached.patch
|
||||
|
||||
#rhbz 808207 CVE-2012-1601
|
||||
@ -1159,10 +1127,8 @@ ApplyOptionalPatch linux-2.6-upstream-reverts.patch -R
|
||||
#
|
||||
# ARM
|
||||
#
|
||||
ApplyPatch arm-omap-dt-compat.patch
|
||||
#ApplyPatch arm-omap-dt-compat.patch
|
||||
ApplyPatch arm-smsc-support-reading-mac-address-from-device-tree.patch
|
||||
ApplyPatch arm-build-bug-on.patch
|
||||
ApplyPatch arm-stmmac-mmc-core.patch
|
||||
ApplyPatch arm-tegra-nvec-kconfig.patch
|
||||
|
||||
ApplyPatch taint-vbox.patch
|
||||
@ -1191,7 +1157,6 @@ ApplyPatch jbd-jbd2-validate-sb-s_first-in-journal_get_superblo.patch
|
||||
# NFSv4
|
||||
ApplyPatch NFSv4-Reduce-the-footprint-of-the-idmapper.patch
|
||||
ApplyPatch NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
|
||||
ApplyPatch NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
|
||||
|
||||
# USB
|
||||
|
||||
@ -1240,6 +1205,8 @@ ApplyPatch linux-2.6-serial-460800.patch
|
||||
# Silence some useless messages that still get printed with 'quiet'
|
||||
ApplyPatch linux-2.6-silence-noise.patch
|
||||
|
||||
ApplyPatch silence-timekeeping-spew.patch
|
||||
|
||||
# Make fbcon not show the penguins with 'quiet'
|
||||
ApplyPatch linux-2.6-silence-fbcon-logo.patch
|
||||
|
||||
@ -1259,11 +1226,9 @@ ApplyPatch fix_xen_guest_on_old_EC2.patch
|
||||
|
||||
# DRM core
|
||||
|
||||
# Nouveau DRM
|
||||
ApplyOptionalPatch drm-nouveau-updates.patch
|
||||
|
||||
# Intel DRM
|
||||
ApplyOptionalPatch drm-intel-next.patch
|
||||
ApplyPatch drm-i915-dp-stfu.patch
|
||||
ApplyPatch drm-i915-fbc-stfu.patch
|
||||
|
||||
ApplyPatch linux-2.6-intel-iommu-igfx.patch
|
||||
@ -1285,62 +1250,31 @@ ApplyPatch disable-i8042-check-on-apple-mac.patch
|
||||
# rhbz#605888
|
||||
ApplyPatch dmar-disable-when-ricoh-multifunction.patch
|
||||
|
||||
ApplyPatch revert-efi-rtclock.patch
|
||||
ApplyPatch efi-dont-map-boot-services-on-32bit.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=787607
|
||||
ApplyPatch cdc-acm-tiocgserial.patch
|
||||
|
||||
ApplyPatch hibernate-freeze-filesystems.patch
|
||||
|
||||
ApplyPatch lis3-improve-handling-of-null-rate.patch
|
||||
|
||||
ApplyPatch bluetooth-use-after-free.patch
|
||||
|
||||
# utrace.
|
||||
ApplyPatch utrace.patch
|
||||
|
||||
#rhbz 752176
|
||||
ApplyPatch sysfs-msi-irq-per-device.patch
|
||||
|
||||
# rhbz 754907
|
||||
ApplyPatch hpsa-add-irqf-shared.patch
|
||||
|
||||
#rhbz 717735
|
||||
ApplyPatch nfs-client-freezer.patch
|
||||
|
||||
#rhbz 590880
|
||||
ApplyPatch alps.patch
|
||||
|
||||
#rhbz 771058
|
||||
ApplyPatch msi-irq-sysfs-warning.patch
|
||||
|
||||
ApplyPatch ext4-Support-check-none-nocheck-mount-options.patch
|
||||
ApplyPatch ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
|
||||
ApplyPatch ext3-Fix-error-handling-on-inode-bitmap-corruption.patch
|
||||
|
||||
#rhbz 773392
|
||||
ApplyPatch KVM-x86-extend-struct-x86_emulate_ops-with-get_cpuid.patch
|
||||
ApplyPatch KVM-x86-fix-missing-checks-in-syscall-emulation.patch
|
||||
#rhbz 772772
|
||||
ApplyPatch rt2x00_fix_MCU_request_failures.patch
|
||||
|
||||
#rhbz 728740
|
||||
ApplyPatch rtl8192cu-Fix-WARNING-on-suspend-resume.patch
|
||||
|
||||
#rhbz 782686
|
||||
ApplyPatch procfs-parse-mount-options.patch
|
||||
ApplyPatch procfs-add-hidepid-and-gid-mount-options.patch
|
||||
ApplyPatch proc-fix-null-pointer-deref-in-proc_pid_permission.patch
|
||||
|
||||
#rhbz 788260
|
||||
#rhbz 788269
|
||||
ApplyPatch jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
||||
|
||||
#rhbz 785806
|
||||
ApplyPatch e1000e-Avoid-wrong-check-on-TX-hang.patch
|
||||
|
||||
#rhbz 754518
|
||||
#ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
|
||||
|
||||
# Remove overlap between bcma/b43 and brcmsmac and reenable bcm4331
|
||||
ApplyPatch bcma-brcmsmac-compat.patch
|
||||
|
||||
#rhbz 789644
|
||||
ApplyPatch mcelog-rcu-splat.patch
|
||||
|
||||
#rhbz 727865 730007
|
||||
ApplyPatch ACPICA-Fix-regression-in-FADT-revision-checks.patch
|
||||
|
||||
@ -1350,6 +1284,9 @@ ApplyPatch sony-laptop-Enable-keyboard-backlight-by-default.patch
|
||||
#rhbz 804007
|
||||
ApplyPatch mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch
|
||||
|
||||
#rhbz 804957 CVE-2012-1568
|
||||
ApplyPatch shlib_base_randomize.patch
|
||||
|
||||
ApplyPatch unhandled-irqs-switch-to-polling.patch
|
||||
|
||||
ApplyPatch weird-root-dentry-name-debug.patch
|
||||
@ -1359,9 +1296,6 @@ ApplyPatch x86-ioapic-add-register-checks-for-bogus-io-apic-entries.patch
|
||||
#rhbz 803809 CVE-2012-1179
|
||||
ApplyPatch mm-thp-fix-pmd_bad-triggering.patch
|
||||
|
||||
#rhbz 804947 CVE-2012-1568
|
||||
ApplyPatch SHLIB_BASE-randomization.patch
|
||||
|
||||
ApplyPatch nfs-Fix-length-of-buffer-copied-in-__nfs4_get_acl_uncached.patch
|
||||
|
||||
#rhbz 808207 CVE-2012-1601
|
||||
@ -2014,6 +1948,12 @@ fi
|
||||
# and build.
|
||||
|
||||
%changelog
|
||||
* Mon Apr 02 2012 Dave Jones <davej@redhat.com>
|
||||
- Linux 3.3
|
||||
|
||||
* Fri Mar 30 2012 Dave Jones <davej@redhat.com>
|
||||
- Silence the timekeeping "Adjusting tsc more then 11%" spew. (rhbz 798600)
|
||||
|
||||
* Fri Mar 30 2012 Josh Boyer <jwboyer@redhat.com>
|
||||
- CVE-2012-1601: kvm: NULL dereference from irqchip_in_kernel and
|
||||
vcpu->arch.apic inconsistency (rhbz 808207)
|
||||
|
@ -1,13 +1,13 @@
|
||||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
|
||||
index d8d7596..a1b7117 100644
|
||||
index eaef02a..2029819 100644
|
||||
--- a/drivers/acpi/video.c
|
||||
+++ b/drivers/acpi/video.c
|
||||
@@ -71,7 +71,7 @@ MODULE_AUTHOR("Bruno Ducrot");
|
||||
@@ -69,7 +69,7 @@ MODULE_AUTHOR("Bruno Ducrot");
|
||||
MODULE_DESCRIPTION("ACPI Video Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
-static int brightness_switch_enabled = 1;
|
||||
+static int brightness_switch_enabled = 0;
|
||||
-static bool brightness_switch_enabled = 1;
|
||||
+static bool brightness_switch_enabled = 0;
|
||||
module_param(brightness_switch_enabled, bool, 0644);
|
||||
|
||||
static int acpi_video_bus_add(struct acpi_device *device);
|
||||
/*
|
||||
|
@ -1,7 +1,7 @@
|
||||
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
|
||||
index 2209620..659c1bb 100644
|
||||
--- a/drivers/tty/serial/8250.c
|
||||
+++ b/drivers/tty/serial/8250.c
|
||||
--- a/drivers/tty/serial/8250/8250.c
|
||||
+++ b/drivers/tty/serial/8250/8250.c
|
||||
@@ -7,6 +7,9 @@
|
||||
*
|
||||
* Copyright (C) 2001 Russell King.
|
||||
|
15
mcelog-rcu-splat.patch
Normal file
15
mcelog-rcu-splat.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
|
||||
index f22a9f7..f525f99 100644
|
||||
--- a/arch/x86/kernel/cpu/mcheck/mce.c
|
||||
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
|
||||
@@ -191,7 +191,7 @@ static void drain_mcelog_buffer(void)
|
||||
{
|
||||
unsigned int next, i, prev = 0;
|
||||
|
||||
- next = rcu_dereference_check_mce(mcelog.next);
|
||||
+ next = ACCESS_ONCE(mcelog.next);
|
||||
|
||||
do {
|
||||
struct mce *m;
|
||||
|
||||
|
@ -363,7 +363,7 @@ index fa2f04e..e3090fc 100644
|
||||
@@ -1251,12 +1251,20 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
|
||||
VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem));
|
||||
split_huge_page_pmd(vma->vm_mm, pmd);
|
||||
} else if (zap_huge_pmd(tlb, vma, pmd))
|
||||
} else if (zap_huge_pmd(tlb, vma, pmd, addr))
|
||||
- continue;
|
||||
+ goto next;
|
||||
/* fall through */
|
||||
@ -444,4 +444,4 @@ To unsubscribe, send a message with 'unsubscribe linux-mm' in
|
||||
the body to majordomo@kvack.org. For more info on Linux MM,
|
||||
see: http://www.linux-mm.org/ .
|
||||
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
|
||||
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
|
||||
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
|
@ -1,87 +0,0 @@
|
||||
commit 3ff0e97a1bc3059bfbcc1d864c5d4ff5f8d3c2b9
|
||||
Author: Neil Horman <nhorman@tuxdriver.com>
|
||||
Date: Tue Jan 3 10:17:21 2012 -0500
|
||||
|
||||
msi: fix imbalanced refcount of msi irq sysfs objects
|
||||
|
||||
This warning was recently reported to me:
|
||||
|
||||
------------[ cut here ]------------
|
||||
WARNING: at lib/kobject.c:595 kobject_put+0x50/0x60()
|
||||
Hardware name: VMware Virtual Platform
|
||||
kobject: '(null)' (ffff880027b0df40): is not initialized, yet kobject_put() is
|
||||
being called.
|
||||
Modules linked in: vmxnet3(+) vmw_balloon i2c_piix4 i2c_core shpchp raid10
|
||||
vmw_pvscsi
|
||||
Pid: 630, comm: modprobe Tainted: G W 3.1.6-1.fc16.x86_64 #1
|
||||
Call Trace:
|
||||
[<ffffffff8106b73f>] warn_slowpath_common+0x7f/0xc0
|
||||
[<ffffffff8106b836>] warn_slowpath_fmt+0x46/0x50
|
||||
[<ffffffff810da293>] ? free_desc+0x63/0x70
|
||||
[<ffffffff812a9aa0>] kobject_put+0x50/0x60
|
||||
[<ffffffff812e4c25>] free_msi_irqs+0xd5/0x120
|
||||
[<ffffffff812e524c>] pci_enable_msi_block+0x24c/0x2c0
|
||||
[<ffffffffa017c273>] vmxnet3_alloc_intr_resources+0x173/0x240 [vmxnet3]
|
||||
[<ffffffffa0182e94>] vmxnet3_probe_device+0x615/0x834 [vmxnet3]
|
||||
[<ffffffff812d141c>] local_pci_probe+0x5c/0xd0
|
||||
[<ffffffff812d2cb9>] pci_device_probe+0x109/0x130
|
||||
[<ffffffff8138ba2c>] driver_probe_device+0x9c/0x2b0
|
||||
[<ffffffff8138bceb>] __driver_attach+0xab/0xb0
|
||||
[<ffffffff8138bc40>] ? driver_probe_device+0x2b0/0x2b0
|
||||
[<ffffffff8138bc40>] ? driver_probe_device+0x2b0/0x2b0
|
||||
[<ffffffff8138a8ac>] bus_for_each_dev+0x5c/0x90
|
||||
[<ffffffff8138b63e>] driver_attach+0x1e/0x20
|
||||
[<ffffffff8138b240>] bus_add_driver+0x1b0/0x2a0
|
||||
[<ffffffffa0188000>] ? 0xffffffffa0187fff
|
||||
[<ffffffff8138c246>] driver_register+0x76/0x140
|
||||
[<ffffffff815ca414>] ? printk+0x51/0x53
|
||||
[<ffffffffa0188000>] ? 0xffffffffa0187fff
|
||||
[<ffffffff812d2996>] __pci_register_driver+0x56/0xd0
|
||||
[<ffffffffa018803a>] vmxnet3_init_module+0x3a/0x3c [vmxnet3]
|
||||
[<ffffffff81002042>] do_one_initcall+0x42/0x180
|
||||
[<ffffffff810aad71>] sys_init_module+0x91/0x200
|
||||
[<ffffffff815dccc2>] system_call_fastpath+0x16/0x1b
|
||||
---[ end trace 44593438a59a9558 ]---
|
||||
Using INTx interrupt, #Rx queues: 1.
|
||||
|
||||
It occurs when populate_msi_sysfs fails, which in turn causes free_msi_irqs to
|
||||
be called. Because populate_msi_sysfs fails, we never registered any of the
|
||||
msi irq sysfs objects, but free_msi_irqs still calls kobject_del and kobject_put
|
||||
on each of them, which gets flagged in the above stack trace.
|
||||
|
||||
The fix is pretty straightforward. We can key of the parent pointer in the
|
||||
kobject. It is only set if the kobject_init_and_add succededs in
|
||||
populate_msi_sysfs. If anything fails there, each kobject has its parent reset
|
||||
to NULL
|
||||
|
||||
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
|
||||
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
|
||||
CC: Bjorn Helgaas <bhelgaas@google.com>
|
||||
CC: Greg Kroah-Hartman <gregkh@suse.de>
|
||||
CC: linux-pci@vger.kernel.org
|
||||
|
||||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
|
||||
index 337e16a..82de95e 100644
|
||||
--- a/drivers/pci/msi.c
|
||||
+++ b/drivers/pci/msi.c
|
||||
@@ -323,8 +323,18 @@ static void free_msi_irqs(struct pci_dev *dev)
|
||||
if (list_is_last(&entry->list, &dev->msi_list))
|
||||
iounmap(entry->mask_base);
|
||||
}
|
||||
- kobject_del(&entry->kobj);
|
||||
- kobject_put(&entry->kobj);
|
||||
+
|
||||
+ /*
|
||||
+ * Its possible that we get into this path
|
||||
+ * When populate_msi_sysfs fails, which means the entries
|
||||
+ * were not registered with sysfs. In that case don't
|
||||
+ * unregister them.
|
||||
+ */
|
||||
+ if (entry->kobj.parent) {
|
||||
+ kobject_del(&entry->kobj);
|
||||
+ kobject_put(&entry->kobj);
|
||||
+ }
|
||||
+
|
||||
list_del(&entry->list);
|
||||
kfree(entry);
|
||||
}
|
@ -1,197 +0,0 @@
|
||||
@@ -, +, @@
|
||||
fs/nfs/inode.c | 3 ++-
|
||||
fs/nfs/nfs3proc.c | 3 ++-
|
||||
fs/nfs/nfs4proc.c | 5 +++--
|
||||
fs/nfs/proc.c | 3 ++-
|
||||
include/linux/freezer.h | 28 ++++++++++++++++++++++++++++
|
||||
net/sunrpc/sched.c | 3 ++-
|
||||
6 files changed, 39 insertions(+), 6 deletions(-)
|
||||
--- a/fs/nfs/inode.c
|
||||
+++ a/fs/nfs/inode.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <linux/nfs_xdr.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/compat.h>
|
||||
+#include <linux/freezer.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -77,7 +78,7 @@ int nfs_wait_bit_killable(void *word)
|
||||
{
|
||||
if (fatal_signal_pending(current))
|
||||
return -ERESTARTSYS;
|
||||
- schedule();
|
||||
+ freezable_schedule();
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/fs/nfs/nfs3proc.c
|
||||
+++ a/fs/nfs/nfs3proc.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/nfs_page.h>
|
||||
#include <linux/lockd/bind.h>
|
||||
#include <linux/nfs_mount.h>
|
||||
+#include <linux/freezer.h>
|
||||
|
||||
#include "iostat.h"
|
||||
#include "internal.h"
|
||||
@@ -32,7 +33,7 @@ nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
|
||||
res = rpc_call_sync(clnt, msg, flags);
|
||||
if (res != -EJUKEBOX && res != -EKEYEXPIRED)
|
||||
break;
|
||||
- schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
|
||||
+ freezable_schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
|
||||
res = -ERESTARTSYS;
|
||||
} while (!fatal_signal_pending(current));
|
||||
return res;
|
||||
--- a/fs/nfs/nfs4proc.c
|
||||
+++ a/fs/nfs/nfs4proc.c
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <linux/sunrpc/bc_xprt.h>
|
||||
#include <linux/xattr.h>
|
||||
#include <linux/utsname.h>
|
||||
+#include <linux/freezer.h>
|
||||
|
||||
#include "nfs4_fs.h"
|
||||
#include "delegation.h"
|
||||
@@ -241,7 +242,7 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
|
||||
*timeout = NFS4_POLL_RETRY_MIN;
|
||||
if (*timeout > NFS4_POLL_RETRY_MAX)
|
||||
*timeout = NFS4_POLL_RETRY_MAX;
|
||||
- schedule_timeout_killable(*timeout);
|
||||
+ freezable_schedule_timeout_killable(*timeout);
|
||||
if (fatal_signal_pending(current))
|
||||
res = -ERESTARTSYS;
|
||||
*timeout <<= 1;
|
||||
@@ -3950,7 +3951,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4
|
||||
static unsigned long
|
||||
nfs4_set_lock_task_retry(unsigned long timeout)
|
||||
{
|
||||
- schedule_timeout_killable(timeout);
|
||||
+ freezable_schedule_timeout_killable(timeout);
|
||||
timeout <<= 1;
|
||||
if (timeout > NFS4_LOCK_MAXTIMEOUT)
|
||||
return NFS4_LOCK_MAXTIMEOUT;
|
||||
--- a/fs/nfs/proc.c
|
||||
+++ a/fs/nfs/proc.c
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <linux/nfs_fs.h>
|
||||
#include <linux/nfs_page.h>
|
||||
#include <linux/lockd/bind.h>
|
||||
+#include <linux/freezer.h>
|
||||
#include "internal.h"
|
||||
|
||||
#define NFSDBG_FACILITY NFSDBG_PROC
|
||||
@@ -59,7 +60,7 @@ nfs_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
|
||||
res = rpc_call_sync(clnt, msg, flags);
|
||||
if (res != -EKEYEXPIRED)
|
||||
break;
|
||||
- schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
|
||||
+ freezable_schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
|
||||
res = -ERESTARTSYS;
|
||||
} while (!fatal_signal_pending(current));
|
||||
return res;
|
||||
--- a/include/linux/freezer.h
|
||||
+++ a/include/linux/freezer.h
|
||||
@@ -135,6 +135,29 @@ static inline void set_freezable_with_signal(void)
|
||||
}
|
||||
|
||||
/*
|
||||
+ * These macros are intended to be used whenever you want allow a task that's
|
||||
+ * sleeping in TASK_UNINTERRUPTIBLE or TASK_KILLABLE state to be frozen. Note
|
||||
+ * that neither return any clear indication of whether a freeze event happened
|
||||
+ * while in this function.
|
||||
+ */
|
||||
+
|
||||
+/* Like schedule(), but should not block the freezer. */
|
||||
+#define freezable_schedule() \
|
||||
+({ \
|
||||
+ freezer_do_not_count(); \
|
||||
+ schedule(); \
|
||||
+ freezer_count(); \
|
||||
+})
|
||||
+
|
||||
+/* Like schedule_timeout_killable(), but should not block the freezer. */
|
||||
+#define freezable_schedule_timeout_killable(timeout) \
|
||||
+({ \
|
||||
+ freezer_do_not_count(); \
|
||||
+ schedule_timeout_killable(timeout); \
|
||||
+ freezer_count(); \
|
||||
+})
|
||||
+
|
||||
+/*
|
||||
* Freezer-friendly wrappers around wait_event_interruptible(),
|
||||
* wait_event_killable() and wait_event_interruptible_timeout(), originally
|
||||
* defined in <linux/wait.h>
|
||||
@@ -194,6 +217,11 @@ static inline int freezer_should_skip(struct task_struct *p) { return 0; }
|
||||
static inline void set_freezable(void) {}
|
||||
static inline void set_freezable_with_signal(void) {}
|
||||
|
||||
+#define freezable_schedule() schedule()
|
||||
+
|
||||
+#define freezable_schedule_timeout_killable(timeout) \
|
||||
+ schedule_timeout_killable(timeout)
|
||||
+
|
||||
#define wait_event_freezable(wq, condition) \
|
||||
wait_event_interruptible(wq, condition)
|
||||
|
||||
--- a/net/sunrpc/sched.c
|
||||
+++ a/net/sunrpc/sched.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/mutex.h>
|
||||
+#include <linux/freezer.h>
|
||||
|
||||
#include <linux/sunrpc/clnt.h>
|
||||
|
||||
@@ -231,7 +232,7 @@ static int rpc_wait_bit_killable(void *word)
|
||||
{
|
||||
if (fatal_signal_pending(current))
|
||||
return -ERESTARTSYS;
|
||||
- schedule();
|
||||
+ freezable_schedule();
|
||||
return 0;
|
||||
}
|
||||
|
||||
include/linux/freezer.h | 21 ++++++++++++++++++---
|
||||
1 files changed, 18 insertions(+), 3 deletions(-)
|
||||
--- a/include/linux/freezer.h
|
||||
+++ a/include/linux/freezer.h
|
||||
@@ -141,18 +141,33 @@ static inline void set_freezable_with_signal(void)
|
||||
* while in this function.
|
||||
*/
|
||||
|
||||
-/* Like schedule(), but should not block the freezer. */
|
||||
+/*
|
||||
+ * Like schedule(), but should not block the freezer. It may return immediately
|
||||
+ * if it ends up racing with the freezer. Callers must be able to deal with
|
||||
+ * spurious wakeups.
|
||||
+ */
|
||||
#define freezable_schedule() \
|
||||
({ \
|
||||
freezer_do_not_count(); \
|
||||
- schedule(); \
|
||||
+ if (!try_to_freeze()) \
|
||||
+ schedule(); \
|
||||
freezer_count(); \
|
||||
})
|
||||
|
||||
-/* Like schedule_timeout_killable(), but should not block the freezer. */
|
||||
+/*
|
||||
+ * Like schedule_timeout_killable(), but should not block the freezer. It may
|
||||
+ * end up returning immediately if it ends up racing with the freezer. Callers
|
||||
+ * must be able to deal with the loose wakeup timing that can occur when the
|
||||
+ * freezer races in. When that occurs, this function will return the timeout
|
||||
+ * value instead of 0.
|
||||
+ */
|
||||
#define freezable_schedule_timeout_killable(timeout) \
|
||||
({ \
|
||||
freezer_do_not_count(); \
|
||||
+ if (try_to_freeze()) { \
|
||||
+ freezer_count(); \
|
||||
+ return timeout; \
|
||||
+ } \
|
||||
schedule_timeout_killable(timeout); \
|
||||
freezer_count(); \
|
||||
})
|
@ -1,44 +0,0 @@
|
||||
From a2ef990ab5a6705a356d146dd773a3b359787497 Mon Sep 17 00:00:00 2001
|
||||
From: Xiaotian Feng <xtfeng@gmail.com>
|
||||
Date: Thu, 12 Jan 2012 17:17:08 -0800
|
||||
Subject: [PATCH] proc: fix null pointer deref in proc_pid_permission()
|
||||
|
||||
get_proc_task() can fail to search the task and return NULL,
|
||||
put_task_struct() will then bomb the kernel with following oops:
|
||||
|
||||
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
|
||||
IP: [<ffffffff81217d34>] proc_pid_permission+0x64/0xe0
|
||||
PGD 112075067 PUD 112814067 PMD 0
|
||||
Oops: 0002 [#1] PREEMPT SMP
|
||||
|
||||
This is a regression introduced by commit 0499680a ("procfs: add hidepid=
|
||||
and gid= mount options"). The kernel should return -ESRCH if
|
||||
get_proc_task() failed.
|
||||
|
||||
Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
|
||||
Cc: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Cc: Vasiliy Kulikov <segoon@openwall.com>
|
||||
Cc: Stephen Wilson <wilsons@start.ca>
|
||||
Acked-by: David Rientjes <rientjes@google.com>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
---
|
||||
fs/proc/base.c | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/fs/proc/base.c b/fs/proc/base.c
|
||||
index 8173dfd..5485a53 100644
|
||||
--- a/fs/proc/base.c
|
||||
+++ b/fs/proc/base.c
|
||||
@@ -654,6 +654,8 @@ static int proc_pid_permission(struct inode *inode, int mask)
|
||||
bool has_perms;
|
||||
|
||||
task = get_proc_task(inode);
|
||||
+ if (!task)
|
||||
+ return -ESRCH;
|
||||
has_perms = has_pid_permissions(pid, task, 1);
|
||||
put_task_struct(task);
|
||||
|
||||
--
|
||||
1.7.7.5
|
||||
|
@ -1,342 +0,0 @@
|
||||
From 0499680a42141d86417a8fbaa8c8db806bea1201 Mon Sep 17 00:00:00 2001
|
||||
From: Vasiliy Kulikov <segooon@gmail.com>
|
||||
Date: Tue, 10 Jan 2012 15:11:31 -0800
|
||||
Subject: [PATCH] procfs: add hidepid= and gid= mount options
|
||||
|
||||
Add support for mount options to restrict access to /proc/PID/
|
||||
directories. The default backward-compatible "relaxed" behaviour is left
|
||||
untouched.
|
||||
|
||||
The first mount option is called "hidepid" and its value defines how much
|
||||
info about processes we want to be available for non-owners:
|
||||
|
||||
hidepid=0 (default) means the old behavior - anybody may read all
|
||||
world-readable /proc/PID/* files.
|
||||
|
||||
hidepid=1 means users may not access any /proc/<pid>/ directories, but
|
||||
their own. Sensitive files like cmdline, sched*, status are now protected
|
||||
against other users. As permission checking done in proc_pid_permission()
|
||||
and files' permissions are left untouched, programs expecting specific
|
||||
files' modes are not confused.
|
||||
|
||||
hidepid=2 means hidepid=1 plus all /proc/PID/ will be invisible to other
|
||||
users. It doesn't mean that it hides whether a process exists (it can be
|
||||
learned by other means, e.g. by kill -0 $PID), but it hides process' euid
|
||||
and egid. It compicates intruder's task of gathering info about running
|
||||
processes, whether some daemon runs with elevated privileges, whether
|
||||
another user runs some sensitive program, whether other users run any
|
||||
program at all, etc.
|
||||
|
||||
gid=XXX defines a group that will be able to gather all processes' info
|
||||
(as in hidepid=0 mode). This group should be used instead of putting
|
||||
nonroot user in sudoers file or something. However, untrusted users (like
|
||||
daemons, etc.) which are not supposed to monitor the tasks in the whole
|
||||
system should not be added to the group.
|
||||
|
||||
hidepid=1 or higher is designed to restrict access to procfs files, which
|
||||
might reveal some sensitive private information like precise keystrokes
|
||||
timings:
|
||||
|
||||
http://www.openwall.com/lists/oss-security/2011/11/05/3
|
||||
|
||||
hidepid=1/2 doesn't break monitoring userspace tools. ps, top, pgrep, and
|
||||
conky gracefully handle EPERM/ENOENT and behave as if the current user is
|
||||
the only user running processes. pstree shows the process subtree which
|
||||
contains "pstree" process.
|
||||
|
||||
Note: the patch doesn't deal with setuid/setgid issues of keeping
|
||||
preopened descriptors of procfs files (like
|
||||
https://lkml.org/lkml/2011/2/7/368). We rely on that the leaked
|
||||
information like the scheduling counters of setuid apps doesn't threaten
|
||||
anybody's privacy - only the user started the setuid program may read the
|
||||
counters.
|
||||
|
||||
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
|
||||
Cc: Alexey Dobriyan <adobriyan@gmail.com>
|
||||
Cc: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Cc: Randy Dunlap <rdunlap@xenotime.net>
|
||||
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
||||
Cc: Greg KH <greg@kroah.com>
|
||||
Cc: Theodore Tso <tytso@MIT.EDU>
|
||||
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
|
||||
Cc: James Morris <jmorris@namei.org>
|
||||
Cc: Oleg Nesterov <oleg@redhat.com>
|
||||
Cc: Hugh Dickins <hughd@google.com>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
---
|
||||
Documentation/filesystems/proc.txt | 39 ++++++++++++++++++++
|
||||
fs/proc/base.c | 69 +++++++++++++++++++++++++++++++++++-
|
||||
fs/proc/inode.c | 8 ++++
|
||||
fs/proc/root.c | 21 +++++++++--
|
||||
include/linux/pid_namespace.h | 2 +
|
||||
5 files changed, 135 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
|
||||
index 0ec91f0..12fee13 100644
|
||||
--- a/Documentation/filesystems/proc.txt
|
||||
+++ b/Documentation/filesystems/proc.txt
|
||||
@@ -41,6 +41,8 @@ Table of Contents
|
||||
3.5 /proc/<pid>/mountinfo - Information about mounts
|
||||
3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
|
||||
|
||||
+ 4 Configuring procfs
|
||||
+ 4.1 Mount options
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Preface
|
||||
@@ -1542,3 +1544,40 @@ a task to set its own or one of its thread siblings comm value. The comm value
|
||||
is limited in size compared to the cmdline value, so writing anything longer
|
||||
then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
|
||||
comm value.
|
||||
+
|
||||
+
|
||||
+------------------------------------------------------------------------------
|
||||
+Configuring procfs
|
||||
+------------------------------------------------------------------------------
|
||||
+
|
||||
+4.1 Mount options
|
||||
+---------------------
|
||||
+
|
||||
+The following mount options are supported:
|
||||
+
|
||||
+ hidepid= Set /proc/<pid>/ access mode.
|
||||
+ gid= Set the group authorized to learn processes information.
|
||||
+
|
||||
+hidepid=0 means classic mode - everybody may access all /proc/<pid>/ directories
|
||||
+(default).
|
||||
+
|
||||
+hidepid=1 means users may not access any /proc/<pid>/ directories but their
|
||||
+own. Sensitive files like cmdline, sched*, status are now protected against
|
||||
+other users. This makes it impossible to learn whether any user runs
|
||||
+specific program (given the program doesn't reveal itself by its behaviour).
|
||||
+As an additional bonus, as /proc/<pid>/cmdline is unaccessible for other users,
|
||||
+poorly written programs passing sensitive information via program arguments are
|
||||
+now protected against local eavesdroppers.
|
||||
+
|
||||
+hidepid=2 means hidepid=1 plus all /proc/<pid>/ will be fully invisible to other
|
||||
+users. It doesn't mean that it hides a fact whether a process with a specific
|
||||
+pid value exists (it can be learned by other means, e.g. by "kill -0 $PID"),
|
||||
+but it hides process' uid and gid, which may be learned by stat()'ing
|
||||
+/proc/<pid>/ otherwise. It greatly complicates an intruder's task of gathering
|
||||
+information about running processes, whether some daemon runs with elevated
|
||||
+privileges, whether other user runs some sensitive program, whether other users
|
||||
+run any program at all, etc.
|
||||
+
|
||||
+gid= defines a group authorized to learn processes information otherwise
|
||||
+prohibited by hidepid=. If you use some daemon like identd which needs to learn
|
||||
+information about processes information, just add identd to this group.
|
||||
diff --git a/fs/proc/base.c b/fs/proc/base.c
|
||||
index 4d755fe..8173dfd 100644
|
||||
--- a/fs/proc/base.c
|
||||
+++ b/fs/proc/base.c
|
||||
@@ -631,6 +631,50 @@ int proc_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * May current process learn task's sched/cmdline info (for hide_pid_min=1)
|
||||
+ * or euid/egid (for hide_pid_min=2)?
|
||||
+ */
|
||||
+static bool has_pid_permissions(struct pid_namespace *pid,
|
||||
+ struct task_struct *task,
|
||||
+ int hide_pid_min)
|
||||
+{
|
||||
+ if (pid->hide_pid < hide_pid_min)
|
||||
+ return true;
|
||||
+ if (in_group_p(pid->pid_gid))
|
||||
+ return true;
|
||||
+ return ptrace_may_access(task, PTRACE_MODE_READ);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int proc_pid_permission(struct inode *inode, int mask)
|
||||
+{
|
||||
+ struct pid_namespace *pid = inode->i_sb->s_fs_info;
|
||||
+ struct task_struct *task;
|
||||
+ bool has_perms;
|
||||
+
|
||||
+ task = get_proc_task(inode);
|
||||
+ has_perms = has_pid_permissions(pid, task, 1);
|
||||
+ put_task_struct(task);
|
||||
+
|
||||
+ if (!has_perms) {
|
||||
+ if (pid->hide_pid == 2) {
|
||||
+ /*
|
||||
+ * Let's make getdents(), stat(), and open()
|
||||
+ * consistent with each other. If a process
|
||||
+ * may not stat() a file, it shouldn't be seen
|
||||
+ * in procfs at all.
|
||||
+ */
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
+
|
||||
+ return -EPERM;
|
||||
+ }
|
||||
+ return generic_permission(inode, mask);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
static const struct inode_operations proc_def_inode_operations = {
|
||||
.setattr = proc_setattr,
|
||||
};
|
||||
@@ -1615,6 +1659,7 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
||||
struct inode *inode = dentry->d_inode;
|
||||
struct task_struct *task;
|
||||
const struct cred *cred;
|
||||
+ struct pid_namespace *pid = dentry->d_sb->s_fs_info;
|
||||
|
||||
generic_fillattr(inode, stat);
|
||||
|
||||
@@ -1623,6 +1668,14 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
||||
stat->gid = 0;
|
||||
task = pid_task(proc_pid(inode), PIDTYPE_PID);
|
||||
if (task) {
|
||||
+ if (!has_pid_permissions(pid, task, 2)) {
|
||||
+ rcu_read_unlock();
|
||||
+ /*
|
||||
+ * This doesn't prevent learning whether PID exists,
|
||||
+ * it only makes getattr() consistent with readdir().
|
||||
+ */
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
|
||||
task_dumpable(task)) {
|
||||
cred = __task_cred(task);
|
||||
@@ -3119,6 +3172,7 @@ static const struct inode_operations proc_tgid_base_inode_operations = {
|
||||
.lookup = proc_tgid_base_lookup,
|
||||
.getattr = pid_getattr,
|
||||
.setattr = proc_setattr,
|
||||
+ .permission = proc_pid_permission,
|
||||
};
|
||||
|
||||
static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
|
||||
@@ -3322,6 +3376,12 @@ static int proc_pid_fill_cache(struct file *filp, void *dirent, filldir_t filldi
|
||||
proc_pid_instantiate, iter.task, NULL);
|
||||
}
|
||||
|
||||
+static int fake_filldir(void *buf, const char *name, int namelen,
|
||||
+ loff_t offset, u64 ino, unsigned d_type)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* for the /proc/ directory itself, after non-process stuff has been done */
|
||||
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
||||
{
|
||||
@@ -3329,6 +3389,7 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
||||
struct task_struct *reaper;
|
||||
struct tgid_iter iter;
|
||||
struct pid_namespace *ns;
|
||||
+ filldir_t __filldir;
|
||||
|
||||
if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET)
|
||||
goto out_no_task;
|
||||
@@ -3350,8 +3411,13 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
||||
for (iter = next_tgid(ns, iter);
|
||||
iter.task;
|
||||
iter.tgid += 1, iter = next_tgid(ns, iter)) {
|
||||
+ if (has_pid_permissions(ns, iter.task, 2))
|
||||
+ __filldir = filldir;
|
||||
+ else
|
||||
+ __filldir = fake_filldir;
|
||||
+
|
||||
filp->f_pos = iter.tgid + TGID_OFFSET;
|
||||
- if (proc_pid_fill_cache(filp, dirent, filldir, iter) < 0) {
|
||||
+ if (proc_pid_fill_cache(filp, dirent, __filldir, iter) < 0) {
|
||||
put_task_struct(iter.task);
|
||||
goto out;
|
||||
}
|
||||
@@ -3686,6 +3752,7 @@ static const struct inode_operations proc_task_inode_operations = {
|
||||
.lookup = proc_task_lookup,
|
||||
.getattr = proc_task_getattr,
|
||||
.setattr = proc_setattr,
|
||||
+ .permission = proc_pid_permission,
|
||||
};
|
||||
|
||||
static const struct file_operations proc_task_operations = {
|
||||
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
|
||||
index 27c762f..84fd323 100644
|
||||
--- a/fs/proc/inode.c
|
||||
+++ b/fs/proc/inode.c
|
||||
@@ -106,6 +106,14 @@ void __init proc_init_inodecache(void)
|
||||
|
||||
static int proc_show_options(struct seq_file *seq, struct vfsmount *vfs)
|
||||
{
|
||||
+ struct super_block *sb = vfs->mnt_sb;
|
||||
+ struct pid_namespace *pid = sb->s_fs_info;
|
||||
+
|
||||
+ if (pid->pid_gid)
|
||||
+ seq_printf(seq, ",gid=%lu", (unsigned long)pid->pid_gid);
|
||||
+ if (pid->hide_pid != 0)
|
||||
+ seq_printf(seq, ",hidepid=%u", pid->hide_pid);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/fs/proc/root.c b/fs/proc/root.c
|
||||
index 6a8ac1d..46a15d8 100644
|
||||
--- a/fs/proc/root.c
|
||||
+++ b/fs/proc/root.c
|
||||
@@ -38,10 +38,12 @@ static int proc_set_super(struct super_block *sb, void *data)
|
||||
}
|
||||
|
||||
enum {
|
||||
- Opt_err,
|
||||
+ Opt_gid, Opt_hidepid, Opt_err,
|
||||
};
|
||||
|
||||
static const match_table_t tokens = {
|
||||
+ {Opt_hidepid, "hidepid=%u"},
|
||||
+ {Opt_gid, "gid=%u"},
|
||||
{Opt_err, NULL},
|
||||
};
|
||||
|
||||
@@ -49,8 +51,7 @@ static int proc_parse_options(char *options, struct pid_namespace *pid)
|
||||
{
|
||||
char *p;
|
||||
substring_t args[MAX_OPT_ARGS];
|
||||
-
|
||||
- pr_debug("proc: options = %s\n", options);
|
||||
+ int option;
|
||||
|
||||
if (!options)
|
||||
return 1;
|
||||
@@ -63,6 +64,20 @@ static int proc_parse_options(char *options, struct pid_namespace *pid)
|
||||
args[0].to = args[0].from = 0;
|
||||
token = match_token(p, tokens, args);
|
||||
switch (token) {
|
||||
+ case Opt_gid:
|
||||
+ if (match_int(&args[0], &option))
|
||||
+ return 0;
|
||||
+ pid->pid_gid = option;
|
||||
+ break;
|
||||
+ case Opt_hidepid:
|
||||
+ if (match_int(&args[0], &option))
|
||||
+ return 0;
|
||||
+ if (option < 0 || option > 2) {
|
||||
+ pr_err("proc: hidepid value must be between 0 and 2.\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ pid->hide_pid = option;
|
||||
+ break;
|
||||
default:
|
||||
pr_err("proc: unrecognized mount option \"%s\" "
|
||||
"or missing value\n", p);
|
||||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
|
||||
index 38d1032..e7cf666 100644
|
||||
--- a/include/linux/pid_namespace.h
|
||||
+++ b/include/linux/pid_namespace.h
|
||||
@@ -30,6 +30,8 @@ struct pid_namespace {
|
||||
#ifdef CONFIG_BSD_PROCESS_ACCT
|
||||
struct bsd_acct_struct *bacct;
|
||||
#endif
|
||||
+ gid_t pid_gid;
|
||||
+ int hide_pid;
|
||||
};
|
||||
|
||||
extern struct pid_namespace init_pid_ns;
|
||||
--
|
||||
1.7.7.5
|
||||
|
@ -1,173 +0,0 @@
|
||||
From 97412950b10e64f347aec4a9b759395c2465adf6 Mon Sep 17 00:00:00 2001
|
||||
From: Vasiliy Kulikov <segooon@gmail.com>
|
||||
Date: Tue, 10 Jan 2012 15:11:27 -0800
|
||||
Subject: [PATCH] procfs: parse mount options
|
||||
|
||||
Add support for procfs mount options. Actual mount options are coming in
|
||||
the next patches.
|
||||
|
||||
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
|
||||
Cc: Alexey Dobriyan <adobriyan@gmail.com>
|
||||
Cc: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Cc: Randy Dunlap <rdunlap@xenotime.net>
|
||||
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
||||
Cc: Greg KH <greg@kroah.com>
|
||||
Cc: Theodore Tso <tytso@MIT.EDU>
|
||||
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
|
||||
Cc: James Morris <jmorris@namei.org>
|
||||
Cc: Oleg Nesterov <oleg@redhat.com>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
---
|
||||
fs/proc/inode.c | 10 +++++++++
|
||||
fs/proc/internal.h | 1 +
|
||||
fs/proc/root.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
3 files changed, 64 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
|
||||
index 51a1766..27c762f 100644
|
||||
--- a/fs/proc/inode.c
|
||||
+++ b/fs/proc/inode.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/kernel.h>
|
||||
+#include <linux/pid_namespace.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/stat.h>
|
||||
@@ -17,7 +18,9 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sysctl.h>
|
||||
+#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
+#include <linux/mount.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -101,12 +104,19 @@ void __init proc_init_inodecache(void)
|
||||
init_once);
|
||||
}
|
||||
|
||||
+static int proc_show_options(struct seq_file *seq, struct vfsmount *vfs)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const struct super_operations proc_sops = {
|
||||
.alloc_inode = proc_alloc_inode,
|
||||
.destroy_inode = proc_destroy_inode,
|
||||
.drop_inode = generic_delete_inode,
|
||||
.evict_inode = proc_evict_inode,
|
||||
.statfs = simple_statfs,
|
||||
+ .remount_fs = proc_remount,
|
||||
+ .show_options = proc_show_options,
|
||||
};
|
||||
|
||||
static void __pde_users_dec(struct proc_dir_entry *pde)
|
||||
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
|
||||
index 7838e5c..2925775 100644
|
||||
--- a/fs/proc/internal.h
|
||||
+++ b/fs/proc/internal.h
|
||||
@@ -117,6 +117,7 @@ void pde_put(struct proc_dir_entry *pde);
|
||||
|
||||
int proc_fill_super(struct super_block *);
|
||||
struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
|
||||
+int proc_remount(struct super_block *sb, int *flags, char *data);
|
||||
|
||||
/*
|
||||
* These are generic /proc routines that use the internal
|
||||
diff --git a/fs/proc/root.c b/fs/proc/root.c
|
||||
index 03102d9..6a8ac1d 100644
|
||||
--- a/fs/proc/root.c
|
||||
+++ b/fs/proc/root.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/pid_namespace.h>
|
||||
+#include <linux/parser.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@@ -36,6 +37,48 @@ static int proc_set_super(struct super_block *sb, void *data)
|
||||
return err;
|
||||
}
|
||||
|
||||
+enum {
|
||||
+ Opt_err,
|
||||
+};
|
||||
+
|
||||
+static const match_table_t tokens = {
|
||||
+ {Opt_err, NULL},
|
||||
+};
|
||||
+
|
||||
+static int proc_parse_options(char *options, struct pid_namespace *pid)
|
||||
+{
|
||||
+ char *p;
|
||||
+ substring_t args[MAX_OPT_ARGS];
|
||||
+
|
||||
+ pr_debug("proc: options = %s\n", options);
|
||||
+
|
||||
+ if (!options)
|
||||
+ return 1;
|
||||
+
|
||||
+ while ((p = strsep(&options, ",")) != NULL) {
|
||||
+ int token;
|
||||
+ if (!*p)
|
||||
+ continue;
|
||||
+
|
||||
+ args[0].to = args[0].from = 0;
|
||||
+ token = match_token(p, tokens, args);
|
||||
+ switch (token) {
|
||||
+ default:
|
||||
+ pr_err("proc: unrecognized mount option \"%s\" "
|
||||
+ "or missing value\n", p);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int proc_remount(struct super_block *sb, int *flags, char *data)
|
||||
+{
|
||||
+ struct pid_namespace *pid = sb->s_fs_info;
|
||||
+ return !proc_parse_options(data, pid);
|
||||
+}
|
||||
+
|
||||
static struct dentry *proc_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
@@ -43,11 +86,15 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
|
||||
struct super_block *sb;
|
||||
struct pid_namespace *ns;
|
||||
struct proc_inode *ei;
|
||||
+ char *options;
|
||||
|
||||
- if (flags & MS_KERNMOUNT)
|
||||
+ if (flags & MS_KERNMOUNT) {
|
||||
ns = (struct pid_namespace *)data;
|
||||
- else
|
||||
+ options = NULL;
|
||||
+ } else {
|
||||
ns = current->nsproxy->pid_ns;
|
||||
+ options = data;
|
||||
+ }
|
||||
|
||||
sb = sget(fs_type, proc_test_super, proc_set_super, ns);
|
||||
if (IS_ERR(sb))
|
||||
@@ -55,6 +102,10 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
|
||||
|
||||
if (!sb->s_root) {
|
||||
sb->s_flags = flags;
|
||||
+ if (!proc_parse_options(options, ns)) {
|
||||
+ deactivate_locked_super(sb);
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
+ }
|
||||
err = proc_fill_super(sb);
|
||||
if (err) {
|
||||
deactivate_locked_super(sb);
|
||||
--
|
||||
1.7.7.5
|
||||
|
@ -1,76 +0,0 @@
|
||||
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
|
||||
index 3ae4128..e17c6d2 100644
|
||||
--- a/arch/x86/platform/efi/efi.c
|
||||
+++ b/arch/x86/platform/efi/efi.c
|
||||
@@ -89,50 +89,26 @@ early_param("add_efi_memmap", setup_add_efi_memmap);
|
||||
|
||||
static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
|
||||
{
|
||||
- unsigned long flags;
|
||||
- efi_status_t status;
|
||||
-
|
||||
- spin_lock_irqsave(&rtc_lock, flags);
|
||||
- status = efi_call_virt2(get_time, tm, tc);
|
||||
- spin_unlock_irqrestore(&rtc_lock, flags);
|
||||
- return status;
|
||||
+ return efi_call_virt2(get_time, tm, tc);
|
||||
}
|
||||
|
||||
static efi_status_t virt_efi_set_time(efi_time_t *tm)
|
||||
{
|
||||
- unsigned long flags;
|
||||
- efi_status_t status;
|
||||
-
|
||||
- spin_lock_irqsave(&rtc_lock, flags);
|
||||
- status = efi_call_virt1(set_time, tm);
|
||||
- spin_unlock_irqrestore(&rtc_lock, flags);
|
||||
- return status;
|
||||
+ return efi_call_virt1(set_time, tm);
|
||||
}
|
||||
|
||||
static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled,
|
||||
efi_bool_t *pending,
|
||||
efi_time_t *tm)
|
||||
{
|
||||
- unsigned long flags;
|
||||
- efi_status_t status;
|
||||
-
|
||||
- spin_lock_irqsave(&rtc_lock, flags);
|
||||
- status = efi_call_virt3(get_wakeup_time,
|
||||
- enabled, pending, tm);
|
||||
- spin_unlock_irqrestore(&rtc_lock, flags);
|
||||
- return status;
|
||||
+ return efi_call_virt3(get_wakeup_time,
|
||||
+ enabled, pending, tm);
|
||||
}
|
||||
|
||||
static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
|
||||
{
|
||||
- unsigned long flags;
|
||||
- efi_status_t status;
|
||||
-
|
||||
- spin_lock_irqsave(&rtc_lock, flags);
|
||||
- status = efi_call_virt2(set_wakeup_time,
|
||||
- enabled, tm);
|
||||
- spin_unlock_irqrestore(&rtc_lock, flags);
|
||||
- return status;
|
||||
+ return efi_call_virt2(set_wakeup_time,
|
||||
+ enabled, tm);
|
||||
}
|
||||
|
||||
static efi_status_t virt_efi_get_variable(efi_char16_t *name,
|
||||
@@ -232,14 +208,11 @@ static efi_status_t __init phys_efi_set_virtual_address_map(
|
||||
static efi_status_t __init phys_efi_get_time(efi_time_t *tm,
|
||||
efi_time_cap_t *tc)
|
||||
{
|
||||
- unsigned long flags;
|
||||
efi_status_t status;
|
||||
|
||||
- spin_lock_irqsave(&rtc_lock, flags);
|
||||
efi_call_phys_prelog();
|
||||
status = efi_call_phys2(efi_phys.get_time, tm, tc);
|
||||
efi_call_phys_epilog();
|
||||
- spin_unlock_irqrestore(&rtc_lock, flags);
|
||||
return status;
|
||||
}
|
||||
|
136
rt2x00_fix_MCU_request_failures.patch
Normal file
136
rt2x00_fix_MCU_request_failures.patch
Normal file
@ -0,0 +1,136 @@
|
||||
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
|
||||
index 2571a2f..822f9e5 100644
|
||||
--- a/drivers/net/wireless/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/rt2x00/rt2800.h
|
||||
@@ -1627,6 +1627,7 @@ struct mac_iveiv_entry {
|
||||
|
||||
/*
|
||||
* H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
|
||||
+ * CMD_TOKEN: Command id, 0xff disable status reporting
|
||||
*/
|
||||
#define H2M_MAILBOX_CSR 0x7010
|
||||
#define H2M_MAILBOX_CSR_ARG0 FIELD32(0x000000ff)
|
||||
@@ -1636,6 +1637,8 @@ struct mac_iveiv_entry {
|
||||
|
||||
/*
|
||||
* H2M_MAILBOX_CID:
|
||||
+ * Free slots contain 0xff. MCU will store command's token to lowest free slot.
|
||||
+ * If all slots are occupied status will be dropped.
|
||||
*/
|
||||
#define H2M_MAILBOX_CID 0x7014
|
||||
#define H2M_MAILBOX_CID_CMD0 FIELD32(0x000000ff)
|
||||
@@ -1645,6 +1648,7 @@ struct mac_iveiv_entry {
|
||||
|
||||
/*
|
||||
* H2M_MAILBOX_STATUS:
|
||||
+ * Command status will be saved to same slot as command id.
|
||||
*/
|
||||
#define H2M_MAILBOX_STATUS 0x701c
|
||||
|
||||
@@ -2259,6 +2263,12 @@ struct mac_iveiv_entry {
|
||||
|
||||
/*
|
||||
* MCU mailbox commands.
|
||||
+ * MCU_SLEEP - go to power-save mode.
|
||||
+ * arg1: 1: save as much power as possible, 0: save less power
|
||||
+ * status: 1: success, 2: already asleep,
|
||||
+ * 3: maybe MAC is busy so can't finish this task
|
||||
+ * MCU_RADIO_OFF
|
||||
+ * arg0: 0: do power-saving, NOT turn off radio
|
||||
*/
|
||||
#define MCU_SLEEP 0x30
|
||||
#define MCU_WAKEUP 0x31
|
||||
@@ -2279,7 +2289,9 @@ struct mac_iveiv_entry {
|
||||
/*
|
||||
* MCU mailbox tokens
|
||||
*/
|
||||
-#define TOKEN_WAKUP 3
|
||||
+#define TOKEN_SLEEP 1
|
||||
+#define TOKEN_RADIO_OFF 2
|
||||
+#define TOKEN_WAKEUP 3
|
||||
|
||||
/*
|
||||
* DMA descriptor defines.
|
||||
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
|
||||
index dc88bae..9ac3017 100644
|
||||
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
|
||||
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
|
||||
@@ -517,23 +517,6 @@ static void rt2800pci_disable_radio(struct rt2x00_dev *rt2x00dev)
|
||||
}
|
||||
}
|
||||
|
||||
-static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
|
||||
- enum dev_state state)
|
||||
-{
|
||||
- if (state == STATE_AWAKE) {
|
||||
- rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0x02);
|
||||
- rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP);
|
||||
- } else if (state == STATE_SLEEP) {
|
||||
- rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS,
|
||||
- 0xffffffff);
|
||||
- rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID,
|
||||
- 0xffffffff);
|
||||
- rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0x01, 0xff, 0x01);
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
|
||||
enum dev_state state)
|
||||
{
|
||||
@@ -541,14 +524,20 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
|
||||
|
||||
switch (state) {
|
||||
case STATE_RADIO_ON:
|
||||
- /*
|
||||
- * Before the radio can be enabled, the device first has
|
||||
- * to be woken up. After that it needs a bit of time
|
||||
- * to be fully awake and then the radio can be enabled.
|
||||
- */
|
||||
- rt2800pci_set_state(rt2x00dev, STATE_AWAKE);
|
||||
- msleep(1);
|
||||
+ /* Initialise all registers and send MCU_BOOT_SIGNAL. */
|
||||
retval = rt2800pci_enable_radio(rt2x00dev);
|
||||
+
|
||||
+ /* After resume MCU_BOOT_SIGNAL will trash those. */
|
||||
+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
|
||||
+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
|
||||
+
|
||||
+ /* Finish initialization procedure. */
|
||||
+ rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF,
|
||||
+ 0xff, 0x02);
|
||||
+ rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
|
||||
+
|
||||
+ rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP, 0, 0);
|
||||
+ rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
|
||||
break;
|
||||
case STATE_RADIO_OFF:
|
||||
/*
|
||||
@@ -556,7 +545,7 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
|
||||
* be put to sleep for powersaving.
|
||||
*/
|
||||
rt2800pci_disable_radio(rt2x00dev);
|
||||
- rt2800pci_set_state(rt2x00dev, STATE_SLEEP);
|
||||
+ rt2800pci_set_device_state(rt2x00dev, STATE_SLEEP);
|
||||
break;
|
||||
case STATE_RADIO_IRQ_ON:
|
||||
case STATE_RADIO_IRQ_OFF:
|
||||
@@ -565,8 +554,16 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
|
||||
case STATE_DEEP_SLEEP:
|
||||
case STATE_SLEEP:
|
||||
case STATE_STANDBY:
|
||||
+ /* PCIe devices won't report status after SLEEP request. */
|
||||
+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
|
||||
+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
|
||||
+ rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP,
|
||||
+ 0xff, 0x01);
|
||||
+ break;
|
||||
case STATE_AWAKE:
|
||||
- retval = rt2800pci_set_state(rt2x00dev, state);
|
||||
+ rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP,
|
||||
+ 0, 0x02);
|
||||
+ rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
|
||||
break;
|
||||
default:
|
||||
retval = -ENOTSUPP;
|
@ -1,163 +0,0 @@
|
||||
A recent LKML thread (http://lkml.indiana.edu/hypermail/linux/kernel/1112.3/00965.html)
|
||||
discusses warnings that occur during a suspend/resume cycle. The driver
|
||||
attempts to read the firmware file before userspace is ready, leading to the
|
||||
following warning:
|
||||
|
||||
WARNING: at drivers/base/firmware_class.c:537 _request_firmware+0x3f6/0x420()
|
||||
|
||||
For rtl8192cu, the problem is fixed by storing the firmware in a global buffer
|
||||
rather than one allocated per device. The usage count is increased when
|
||||
suspending and decreased when resuming. This way, the firmware is retained
|
||||
through a suspend/resume cycle, and does not have to be reread.
|
||||
|
||||
This patch should fix the bug reported in
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=771002.
|
||||
|
||||
Note: This patch also touches rtl8192ce as the "firmware" loaded message
|
||||
is now printed in the wrong place.
|
||||
Note: This patch also touches rtl8192ce as the "firmware" loaded message
|
||||
is now printed in the wrong place.
|
||||
|
||||
Reported-by: Mohammed Arafa <bugzilla@xxxxxxxxxxxx>
|
||||
Reported-by: Dave Jones <davej@xxxxxxxxxx>
|
||||
Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
|
||||
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
|
||||
Cc: Stable <stable@xxxxxxxxxxxxxxx>
|
||||
|
||||
---
|
||||
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 1 -
|
||||
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
|
||||
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 58 +++++++++++++++++----
|
||||
3 files changed, 49 insertions(+), 11 deletions(-)
|
||||
|
||||
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 2012-01-13 13:07:58.830625006 -0500
|
||||
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 2012-01-13 13:08:06.825439927 -0500
|
||||
@@ -227,7 +227,6 @@ int rtl92c_download_fw(struct ieee80211_
|
||||
u32 fwsize;
|
||||
enum version_8192c version = rtlhal->version;
|
||||
|
||||
- pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name);
|
||||
if (!rtlhal->pfirmware)
|
||||
return 1;
|
||||
|
||||
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
|
||||
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
|
||||
@@ -186,6 +186,7 @@ int rtl92c_init_sw_vars(struct ieee80211
|
||||
memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
|
||||
rtlpriv->rtlhal.fwsize = firmware->size;
|
||||
release_firmware(firmware);
|
||||
+ pr_info("rtl8192ce: Loaded firmware file %s\n", rtlpriv->cfg->fw_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
|
||||
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "hw.h"
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/atomic.h>
|
||||
+#include <linux/types.h>
|
||||
|
||||
MODULE_AUTHOR("Georgia <georgia@realtek.com>");
|
||||
MODULE_AUTHOR("Ziv Huang <ziv_huang@realtek.com>");
|
||||
@@ -51,6 +53,10 @@ MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n USB wireless");
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");
|
||||
|
||||
+static char *rtl8192cu_firmware; /* pointer to firmware */
|
||||
+static int firmware_size;
|
||||
+static atomic_t usage_count;
|
||||
+
|
||||
static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
@@ -62,12 +68,21 @@ static int rtl92cu_init_sw_vars(struct i
|
||||
rtlpriv->dm.disable_framebursting = false;
|
||||
rtlpriv->dm.thermalvalue = 0;
|
||||
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
|
||||
- rtlpriv->rtlhal.pfirmware = vmalloc(0x4000);
|
||||
- if (!rtlpriv->rtlhal.pfirmware) {
|
||||
+
|
||||
+ if (rtl8192cu_firmware) {
|
||||
+ /* firmware already loaded - true for suspend/resume
|
||||
+ * and multiple instances of the device */
|
||||
+ rtlpriv->rtlhal.pfirmware = rtl8192cu_firmware;
|
||||
+ rtlpriv->rtlhal.fwsize = firmware_size;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ rtl8192cu_firmware = vzalloc(0x4000);
|
||||
+ if (!rtl8192cu_firmware) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
("Can't alloc buffer for fw.\n"));
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
/* request fw */
|
||||
err = request_firmware(&firmware, rtlpriv->cfg->fw_name,
|
||||
rtlpriv->io.dev);
|
||||
@@ -82,9 +97,14 @@ static int rtl92cu_init_sw_vars(struct i
|
||||
release_firmware(firmware);
|
||||
return 1;
|
||||
}
|
||||
- memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
|
||||
+ pr_info("rtl8192cu: Loaded firmware from file %s\n",
|
||||
+ rtlpriv->cfg->fw_name);
|
||||
+ memcpy(rtl8192cu_firmware, firmware->data, firmware->size);
|
||||
+ firmware_size = firmware->size;
|
||||
rtlpriv->rtlhal.fwsize = firmware->size;
|
||||
+ rtlpriv->rtlhal.pfirmware = rtl8192cu_firmware;
|
||||
release_firmware(firmware);
|
||||
+ atomic_inc(&usage_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -93,12 +113,30 @@ static void rtl92cu_deinit_sw_vars(struc
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
- if (rtlpriv->rtlhal.pfirmware) {
|
||||
- vfree(rtlpriv->rtlhal.pfirmware);
|
||||
+ atomic_dec(&usage_count);
|
||||
+ if (!atomic_read(&usage_count) && rtlpriv->rtlhal.pfirmware) {
|
||||
+ vfree(rtl8192cu_firmware);
|
||||
+ rtl8192cu_firmware = NULL;
|
||||
rtlpriv->rtlhal.pfirmware = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_PM_SLEEP
|
||||
+static int rtl8192cu_usb_suspend(struct usb_interface *pusb_intf,
|
||||
+ pm_message_t message)
|
||||
+{
|
||||
+ /* Increase usage_count to Save loaded fw across suspend/resume */
|
||||
+ atomic_inc(&usage_count);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int rtl8192cu_usb_resume(struct usb_interface *pusb_intf)
|
||||
+{
|
||||
+ atomic_dec(&usage_count); /* after resume, decrease usage count */
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static struct rtl_hal_ops rtl8192cu_hal_ops = {
|
||||
.init_sw_vars = rtl92cu_init_sw_vars,
|
||||
.deinit_sw_vars = rtl92cu_deinit_sw_vars,
|
||||
@@ -374,11 +412,10 @@ static struct usb_driver rtl8192cu_drive
|
||||
.disconnect = rtl_usb_disconnect,
|
||||
.id_table = rtl8192c_usb_ids,
|
||||
|
||||
-#ifdef CONFIG_PM
|
||||
- /* .suspend = rtl_usb_suspend, */
|
||||
- /* .resume = rtl_usb_resume, */
|
||||
- /* .reset_resume = rtl8192c_resume, */
|
||||
-#endif /* CONFIG_PM */
|
||||
+#ifdef CONFIG_PM_SLEEP
|
||||
+ .suspend = rtl8192cu_usb_suspend,
|
||||
+ .resume = rtl8192cu_usb_resume,
|
||||
+#endif /* CONFIG_PM_SLEEP */
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
.supports_autosuspend = 1,
|
||||
#endif
|
@ -1,22 +0,0 @@
|
||||
--- a/drivers/scsi/sd.c
|
||||
+++ a/drivers/scsi/sd.c
|
||||
@@ -2362,13 +2362,18 @@ static int sd_try_extended_inquiry(struct scsi_device *sdp)
|
||||
static int sd_revalidate_disk(struct gendisk *disk)
|
||||
{
|
||||
struct scsi_disk *sdkp = scsi_disk(disk);
|
||||
- struct scsi_device *sdp = sdkp->device;
|
||||
+ struct scsi_device *sdp;
|
||||
unsigned char *buffer;
|
||||
unsigned flush = 0;
|
||||
|
||||
SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp,
|
||||
"sd_revalidate_disk\n"));
|
||||
|
||||
+ if (!sdkp)
|
||||
+ goto out;
|
||||
+
|
||||
+ sdp = sdkp->device;
|
||||
+
|
||||
/*
|
||||
* If the device is offline, don't try and read capacity or any
|
||||
* of the other niceties.
|
16
silence-timekeeping-spew.patch
Normal file
16
silence-timekeeping-spew.patch
Normal file
@ -0,0 +1,16 @@
|
||||
--- linux-3.3.0-4.fc17.noarch/kernel/time/timekeeping.c~ 2012-03-30 14:18:15.591162207 -0400
|
||||
+++ linux-3.3.0-4.fc17.noarch/kernel/time/timekeeping.c 2012-03-30 14:18:38.959121171 -0400
|
||||
@@ -854,13 +854,6 @@ static void timekeeping_adjust(s64 offse
|
||||
} else /* No adjustment needed */
|
||||
return;
|
||||
|
||||
- WARN_ONCE(timekeeper.clock->maxadj &&
|
||||
- (timekeeper.mult + adj > timekeeper.clock->mult +
|
||||
- timekeeper.clock->maxadj),
|
||||
- "Adjusting %s more then 11%% (%ld vs %ld)\n",
|
||||
- timekeeper.clock->name, (long)timekeeper.mult + adj,
|
||||
- (long)timekeeper.clock->mult +
|
||||
- timekeeper.clock->maxadj);
|
||||
/*
|
||||
* So the following can be confusing.
|
||||
*
|
4
sources
4
sources
@ -1,3 +1 @@
|
||||
364066fa18767ec0ae5f4e4abcf9dc51 linux-3.2.tar.xz
|
||||
ee0ce13f2cb7f03a8cda0910fd0fa050 patch-3.2.12.xz
|
||||
687632bb0ba65439198ac60f2c02a8f2 patch-3.2.13.xz
|
||||
7133f5a2086a7d7ef97abac610c094f5 linux-3.3.tar.xz
|
||||
|
@ -1,239 +0,0 @@
|
||||
From: Neil Horman <nhorman@tuxdriver.com>
|
||||
Date: Thu, 6 Oct 2011 18:08:18 +0000 (-0400)
|
||||
Subject: PCI/sysfs: add per pci device msi[x] irq listing (v5)
|
||||
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjbarnes%2Fpci.git;a=commitdiff_plain;h=933aa5c1f69aa650f59ba783307fc7ed7cc5fafa
|
||||
|
||||
PCI/sysfs: add per pci device msi[x] irq listing (v5)
|
||||
|
||||
This patch adds a per-pci-device subdirectory in sysfs called:
|
||||
/sys/bus/pci/devices/<device>/msi_irqs
|
||||
|
||||
This sub-directory exports the set of msi vectors allocated by a given
|
||||
pci device, by creating a numbered sub-directory for each vector beneath
|
||||
msi_irqs. For each vector various attributes can be exported.
|
||||
Currently the only attribute is called mode, which tracks the
|
||||
operational mode of that vector (msi vs. msix)
|
||||
|
||||
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
|
||||
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
|
||||
---
|
||||
|
||||
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
|
||||
index 349ecf2..34f5110 100644
|
||||
--- a/Documentation/ABI/testing/sysfs-bus-pci
|
||||
+++ b/Documentation/ABI/testing/sysfs-bus-pci
|
||||
@@ -66,6 +66,24 @@ Description:
|
||||
re-discover previously removed devices.
|
||||
Depends on CONFIG_HOTPLUG.
|
||||
|
||||
+What: /sys/bus/pci/devices/.../msi_irqs/
|
||||
+Date: September, 2011
|
||||
+Contact: Neil Horman <nhorman@tuxdriver.com>
|
||||
+Description:
|
||||
+ The /sys/devices/.../msi_irqs directory contains a variable set
|
||||
+ of sub-directories, with each sub-directory being named after a
|
||||
+ corresponding msi irq vector allocated to that device. Each
|
||||
+ numbered sub-directory N contains attributes of that irq.
|
||||
+ Note that this directory is not created for device drivers which
|
||||
+ do not support msi irqs
|
||||
+
|
||||
+What: /sys/bus/pci/devices/.../msi_irqs/<N>/mode
|
||||
+Date: September 2011
|
||||
+Contact: Neil Horman <nhorman@tuxdriver.com>
|
||||
+Description:
|
||||
+ This attribute indicates the mode that the irq vector named by
|
||||
+ the parent directory is in (msi vs. msix)
|
||||
+
|
||||
What: /sys/bus/pci/devices/.../remove
|
||||
Date: January 2009
|
||||
Contact: Linux PCI developers <linux-pci@vger.kernel.org>
|
||||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
|
||||
index 2f10328..73613e2 100644
|
||||
--- a/drivers/pci/msi.c
|
||||
+++ b/drivers/pci/msi.c
|
||||
@@ -322,6 +322,8 @@ static void free_msi_irqs(struct pci_dev *dev)
|
||||
if (list_is_last(&entry->list, &dev->msi_list))
|
||||
iounmap(entry->mask_base);
|
||||
}
|
||||
+ kobject_del(&entry->kobj);
|
||||
+ kobject_put(&entry->kobj);
|
||||
list_del(&entry->list);
|
||||
kfree(entry);
|
||||
}
|
||||
@@ -402,6 +404,98 @@ void pci_restore_msi_state(struct pci_dev *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pci_restore_msi_state);
|
||||
|
||||
+
|
||||
+#define to_msi_attr(obj) container_of(obj, struct msi_attribute, attr)
|
||||
+#define to_msi_desc(obj) container_of(obj, struct msi_desc, kobj)
|
||||
+
|
||||
+struct msi_attribute {
|
||||
+ struct attribute attr;
|
||||
+ ssize_t (*show)(struct msi_desc *entry, struct msi_attribute *attr,
|
||||
+ char *buf);
|
||||
+ ssize_t (*store)(struct msi_desc *entry, struct msi_attribute *attr,
|
||||
+ const char *buf, size_t count);
|
||||
+};
|
||||
+
|
||||
+static ssize_t show_msi_mode(struct msi_desc *entry, struct msi_attribute *atr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ return sprintf(buf, "%s\n", entry->msi_attrib.is_msix ? "msix" : "msi");
|
||||
+}
|
||||
+
|
||||
+static ssize_t msi_irq_attr_show(struct kobject *kobj,
|
||||
+ struct attribute *attr, char *buf)
|
||||
+{
|
||||
+ struct msi_attribute *attribute = to_msi_attr(attr);
|
||||
+ struct msi_desc *entry = to_msi_desc(kobj);
|
||||
+
|
||||
+ if (!attribute->show)
|
||||
+ return -EIO;
|
||||
+
|
||||
+ return attribute->show(entry, attribute, buf);
|
||||
+}
|
||||
+
|
||||
+static const struct sysfs_ops msi_irq_sysfs_ops = {
|
||||
+ .show = msi_irq_attr_show,
|
||||
+};
|
||||
+
|
||||
+static struct msi_attribute mode_attribute =
|
||||
+ __ATTR(mode, S_IRUGO, show_msi_mode, NULL);
|
||||
+
|
||||
+
|
||||
+struct attribute *msi_irq_default_attrs[] = {
|
||||
+ &mode_attribute.attr,
|
||||
+ NULL
|
||||
+};
|
||||
+
|
||||
+void msi_kobj_release(struct kobject *kobj)
|
||||
+{
|
||||
+ struct msi_desc *entry = to_msi_desc(kobj);
|
||||
+
|
||||
+ pci_dev_put(entry->dev);
|
||||
+}
|
||||
+
|
||||
+static struct kobj_type msi_irq_ktype = {
|
||||
+ .release = msi_kobj_release,
|
||||
+ .sysfs_ops = &msi_irq_sysfs_ops,
|
||||
+ .default_attrs = msi_irq_default_attrs,
|
||||
+};
|
||||
+
|
||||
+static int populate_msi_sysfs(struct pci_dev *pdev)
|
||||
+{
|
||||
+ struct msi_desc *entry;
|
||||
+ struct kobject *kobj;
|
||||
+ int ret;
|
||||
+ int count = 0;
|
||||
+
|
||||
+ pdev->msi_kset = kset_create_and_add("msi_irqs", NULL, &pdev->dev.kobj);
|
||||
+ if (!pdev->msi_kset)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ list_for_each_entry(entry, &pdev->msi_list, list) {
|
||||
+ kobj = &entry->kobj;
|
||||
+ kobj->kset = pdev->msi_kset;
|
||||
+ pci_dev_get(pdev);
|
||||
+ ret = kobject_init_and_add(kobj, &msi_irq_ktype, NULL,
|
||||
+ "%u", entry->irq);
|
||||
+ if (ret)
|
||||
+ goto out_unroll;
|
||||
+
|
||||
+ count++;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+out_unroll:
|
||||
+ list_for_each_entry(entry, &pdev->msi_list, list) {
|
||||
+ if (!count)
|
||||
+ break;
|
||||
+ kobject_del(&entry->kobj);
|
||||
+ kobject_put(&entry->kobj);
|
||||
+ count--;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* msi_capability_init - configure device's MSI capability structure
|
||||
* @dev: pointer to the pci_dev data structure of MSI device function
|
||||
@@ -453,6 +547,13 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ ret = populate_msi_sysfs(dev);
|
||||
+ if (ret) {
|
||||
+ msi_mask_irq(entry, mask, ~mask);
|
||||
+ free_msi_irqs(dev);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
/* Set MSI enabled bits */
|
||||
pci_intx_for_msi(dev, 0);
|
||||
msi_set_enable(dev, pos, 1);
|
||||
@@ -573,6 +674,12 @@ static int msix_capability_init(struct pci_dev *dev,
|
||||
|
||||
msix_program_entries(dev, entries);
|
||||
|
||||
+ ret = populate_msi_sysfs(dev);
|
||||
+ if (ret) {
|
||||
+ ret = 0;
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
/* Set MSI-X enabled bits and unmask the function */
|
||||
pci_intx_for_msi(dev, 0);
|
||||
dev->msix_enabled = 1;
|
||||
@@ -731,6 +838,8 @@ void pci_disable_msi(struct pci_dev *dev)
|
||||
|
||||
pci_msi_shutdown(dev);
|
||||
free_msi_irqs(dev);
|
||||
+ kset_unregister(dev->msi_kset);
|
||||
+ dev->msi_kset = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(pci_disable_msi);
|
||||
|
||||
@@ -829,6 +938,8 @@ void pci_disable_msix(struct pci_dev *dev)
|
||||
|
||||
pci_msix_shutdown(dev);
|
||||
free_msi_irqs(dev);
|
||||
+ kset_unregister(dev->msi_kset);
|
||||
+ dev->msi_kset = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(pci_disable_msix);
|
||||
|
||||
diff --git a/include/linux/msi.h b/include/linux/msi.h
|
||||
index 05acced..ce93a34 100644
|
||||
--- a/include/linux/msi.h
|
||||
+++ b/include/linux/msi.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef LINUX_MSI_H
|
||||
#define LINUX_MSI_H
|
||||
|
||||
+#include <linux/kobject.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
struct msi_msg {
|
||||
@@ -44,6 +45,8 @@ struct msi_desc {
|
||||
|
||||
/* Last set MSI message */
|
||||
struct msi_msg msg;
|
||||
+
|
||||
+ struct kobject kobj;
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/include/linux/pci.h b/include/linux/pci.h
|
||||
index 7cda65b..84225c7 100644
|
||||
--- a/include/linux/pci.h
|
||||
+++ b/include/linux/pci.h
|
||||
@@ -336,6 +336,7 @@ struct pci_dev {
|
||||
struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
struct list_head msi_list;
|
||||
+ struct kset *msi_kset;
|
||||
#endif
|
||||
struct pci_vpd *vpd;
|
||||
#ifdef CONFIG_PCI_ATS
|
4300
utrace.patch
4300
utrace.patch
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user