[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 1/9] livepatch: Clear .bss when payload is reverted
>>> On 14.08.16 at 23:52, <konrad.wilk@xxxxxxxxxx> wrote: > @@ -374,7 +376,18 @@ static int move_payload(struct payload *payload, struct > livepatch_elf *elf) > elf->name, elf->sec[i].name, elf->sec[i].load_addr); > } > else > - memset(elf->sec[i].load_addr, 0, elf->sec[i].sec->sh_size); > + { > + /* We expect only one BSS. */ > + if ( payload->bss ) > + { > + rc = -EINVAL; -EOPNOTSUPP according to e.g. the only- one-symbol-table code. > + goto out; > + } > + payload->bss = elf->sec[i].load_addr; > + payload->bss_size = elf->sec[i].sec->sh_size; > + > + memset(payload->bss, 0, payload->bss_size); > + } > } > } > > @@ -1034,6 +1047,9 @@ static int revert_payload(struct payload *data) > list_del_rcu(&data->applied_list); > unregister_virtual_region(&data->region); > > + /* And clear the BSS for subsequent operation. */ > + memset(data->bss, 0, data->bss_size); Instead of doing it in two places, how about moving this into apply_payload()? Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |