Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2016-02-25 at 11:04 +1100, Balbir Singh wrote:
>
> On 25/02/16 01:28, Michael Ellerman wrote:
> > -bool is_module_trampoline(u32 *p)
> > +int module_trampoline_target(struct module *mod, unsigned long addr,
> > +			     unsigned long *target)
> >  {
> > -	unsigned int i;
> > -	u32 insns[ARRAY_SIZE(ppc64_stub_insns)];
> > -
> > -	BUILD_BUG_ON(sizeof(ppc64_stub_insns) != sizeof(ppc64_stub_mask));
> > +	struct ppc64_stub_entry *stub;
> > +	func_desc_t funcdata;
> > +	u32 magic;
> >
> > -	if (probe_kernel_read(insns, p, sizeof(insns)))
> > +	if (!within_module_core(addr, mod)) {
> > +		pr_err("%s: stub %lx not in module %s\n", __func__, addr, mod->name);
> >  		return -EFAULT;

> -EFAULT or -EINVAL?

I think we want EFAULT. Otherwise ftrace_bug() will try and print the actual
instruction, which would then fault. (though I haven't confirmed that by
testing)

> I wonder if we can recover from a bad trampoline address.

We can't recover at the moment. Do you mean is there some way we could recover?

cheers

--
To unsubscribe from this list: send the line "unsubscribe live-patching" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux