ia64: Rename 'ip' to 'addr' in 'struct fdesc'

There are three architectures with function descriptors, try to
have common names for the address they contain in order to
refactor some functions into generic functions later.

powerpc has 'entry'
ia64 has 'ip'
parisc has 'addr'

Vote for 'addr' and update 'struct fdesc' accordingly.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/65b73ac614e4c002c5819d40b42f6f426d2ee52b.1644928018.git.christophe.leroy@csgroup.eu
This commit is contained in:
Christophe Leroy 2022-02-15 13:41:01 +01:00 committed by Michael Ellerman
parent 2fd986377d
commit 41a88b4547
3 changed files with 5 additions and 5 deletions

View File

@ -226,7 +226,7 @@ struct got_entry {
* Layout of the Function Descriptor * Layout of the Function Descriptor
*/ */
struct fdesc { struct fdesc {
uint64_t ip; uint64_t addr;
uint64_t gp; uint64_t gp;
}; };

View File

@ -35,7 +35,7 @@ static inline void *dereference_function_descriptor(void *ptr)
struct fdesc *desc = ptr; struct fdesc *desc = ptr;
void *p; void *p;
if (!get_kernel_nofault(p, (void *)&desc->ip)) if (!get_kernel_nofault(p, (void *)&desc->addr))
ptr = p; ptr = p;
return ptr; return ptr;
} }

View File

@ -602,15 +602,15 @@ get_fdesc (struct module *mod, uint64_t value, int *okp)
return value; return value;
/* Look for existing function descriptor. */ /* Look for existing function descriptor. */
while (fdesc->ip) { while (fdesc->addr) {
if (fdesc->ip == value) if (fdesc->addr == value)
return (uint64_t)fdesc; return (uint64_t)fdesc;
if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size) if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
BUG(); BUG();
} }
/* Create new one */ /* Create new one */
fdesc->ip = value; fdesc->addr = value;
fdesc->gp = mod->arch.gp; fdesc->gp = mod->arch.gp;
return (uint64_t) fdesc; return (uint64_t) fdesc;
} }