Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322244
b: refs/heads/master
c: d3cac35
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Aug 17, 2012
1 parent 8d6e201 commit 0328125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 143ec74eb10ac9a8c4357341a03b07ac4f04a761
refs/heads/master: d3cac35cd0a2a987f7559e1829fb0253cea33872
9 changes: 7 additions & 2 deletions trunk/arch/mips/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,15 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
{
unsigned long insnlo = *location;
Elf_Addr val, vallo;
struct mips_hi16 *l, *next;

/* Sign extend the addend we extract from the lo insn. */
vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;

if (mips_hi16_list != NULL) {
struct mips_hi16 *l;

l = mips_hi16_list;
while (l != NULL) {
struct mips_hi16 *next;
unsigned long insn;

/*
Expand Down Expand Up @@ -201,6 +200,12 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
return 0;

out_danger:
while (l) {
next = l->next;
kfree(l);
l = next;
}

pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name);

return -ENOEXEC;
Expand Down

0 comments on commit 0328125

Please sign in to comment.