On x86-64, for 32-bit PC-relacive branches, we can generate PLT32 relocation, instead of PC32 relocation. and R_X86_64_PLT32 can be treated the same as R_X86_64_PC32 since linux kernel doesn't use PLT.
commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as R_X86_64_PC32") been fixed for the module loading, but not fixed for livepatch relocation, which will fail to load livepatch with the error message as follow:
relocation failed for symbol <symbol name> at <symbol address>
This issue only effacted the kernel version from 4.0 to 4.6, becauce the function klp_write_module_reloc is introduced by:
commit b700e7f03df5 ("livepatch: kernel: add support for live patching") and deleted by: commit 425595a7fc20
("livepatch: reuse module loader code to write relocations")
Signed-off-by: chenzefeng <chenzefeng2(a)huawei.com>
---
arch/x86/kernel/livepatch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c index d1d35cc..579f8f8 100644
--- a/arch/x86/kernel/livepatch.c
+++ b/arch/x86/kernel/livepatch.c
@@ -58,6 +58,7 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
val = (s32)value;
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
val = (u32)(value - loc);
break;
default:
--
1.8.5.6
Hi,
I am sorry this email was sent by accident. Please ignore this email.
Best Regards
-----邮件原件-----
发件人: chenzefeng (A)
发送时间: 2019年2月19日 14:38
收件人: 'Petr Mladek' <pmladek(a)suse.com>; chengjian (D) <cj.chengjian(a)huawei.com>
抄送: 'stable(a)vger.kernel.org' <stable(a)vger.kernel.org>; Jiri Kosina <jikos(a)kernel.org>; hjl.tools(a)gmail.com; jpoimboe(a)redhat.com; sjenning(a)redhat.com; vojtech(a)suse.com; tglx(a)linutronix.de; mingo(a)redhat.com; hpa(a)zytor.com; gregkh(a)linuxfoundation.org; x86(a)kernel.org; live-patching(a)vger.kernel.org; linux-kernel(a)vger.kernel.org; Xiexiuqi <xiexiuqi(a)huawei.com>
主题: Re:[PATCH] x86: livepatch: Treat R_X86_64_PLT32 as R_X86_64_PC32
On Mon 2019-02-18 17:22, Petr wrote:
> On Mon 2019-02-18 13:29:11, chengjian (D) wrote:
> > Hi,Jiri
> >
> >
> > This patch should be merged into 4.4 stable,
> >
> > which still use klp_write_module_reloc.
> >
> >
> > https://elixir.bootlin.com/linux/v4.4.174/source/arch/x86/kernel/livep
> > atch.c
> >
> >
> > ZeFeng may have sent a stable(4.4-y) patch to the wrong mail-list(mainline).
>
> ZeFeng or Chengjian, please, send the patch once again with stable(a)vger.kernel.org in CC and explanation that it is needed only for 4.4 and why.
>
> This thread is already too long and messed to be proceed by stable people effectively.
>
> Best Regards,
> Petr
On x86-64, for 32-bit PC-relacive branches, we can generate PLT32 relocation, instead of PC32 relocation. and R_X86_64_PLT32 can be treated the same as R_X86_64_PC32 since linux kernel doesn't use PLT.
commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as R_X86_64_PC32") been fixed for the module loading, but not fixed for livepatch relocation, which will fail to load livepatch with the error message as follow:
relocation failed for symbol <symbol name> at <symbol address>
This issue only effacted the kernel version from 4.0 to 4.6, becauce the function klp_write_module_reloc is introduced by:
commit b700e7f03df5 ("livepatch: kernel: add support for live patching") and deleted by: commit 425595a7fc20
("livepatch: reuse module loader code to write relocations")
Signed-off-by: chenzefeng <chenzefeng2(a)huawei.com>
---
arch/x86/kernel/livepatch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c index d1d35cc..579f8f8 100644
--- a/arch/x86/kernel/livepatch.c
+++ b/arch/x86/kernel/livepatch.c
@@ -58,6 +58,7 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
val = (s32)value;
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
val = (u32)(value - loc);
break;
default:
--
1.8.5.6
On Mon 2019-02-18 17:22, Petr wrote:
> On Mon 2019-02-18 13:29:11, chengjian (D) wrote:
> > Hi,Jiri
> >
> >
> > This patch should be merged into 4.4 stable,
> >
> > which still use klp_write_module_reloc.
> >
> >
> > https://elixir.bootlin.com/linux/v4.4.174/source/arch/x86/kernel/livep
> > atch.c
> >
> >
> > ZeFeng may have sent a stable(4.4-y) patch to the wrong mail-list(mainline).
>
> ZeFeng or Chengjian, please, send the patch once again with stable(a)vger.kernel.org in CC and explanation that it is needed only for 4.4 and why.
>
> This thread is already too long and messed to be proceed by stable people effectively.
>
> Best Regards,
> Petr
On x86-64, for 32-bit PC-relacive branches, we can generate PLT32 relocation, instead of PC32 relocation. and R_X86_64_PLT32 can be treated the same as R_X86_64_PC32 since linux kernel doesn't use PLT.
commit b21ebf2fb4cd ("x86: Treat R_X86_64_PLT32 as R_X86_64_PC32") been fixed for the module loading, but not fixed for livepatch relocation, which will fail to load livepatch with the error message as follow:
relocation failed for symbol <symbol name> at <symbol address>
This issue only effacted the kernel version from 4.0 to 4.6, becauce the function klp_write_module_reloc is introduced by:
commit b700e7f03df5 ("livepatch: kernel: add support for live patching") and deleted by: commit 425595a7fc20
("livepatch: reuse module loader code to write relocations")
Signed-off-by: chenzefeng <chenzefeng2(a)huawei.com>
---
arch/x86/kernel/livepatch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c index d1d35cc..579f8f8 100644
--- a/arch/x86/kernel/livepatch.c
+++ b/arch/x86/kernel/livepatch.c
@@ -58,6 +58,7 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
val = (s32)value;
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
val = (u32)(value - loc);
break;
default:
--
1.8.5.6
Hi,
[This is an automated email]
This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: .+
The bot has tested the following trees: v4.20.10, v4.19.23, v4.14.101, v4.9.158, v4.4.174, v3.18.134.
v4.20.10: Build OK!
v4.19.23: Build OK!
v4.14.101: Failed to apply! Possible dependencies:
27204aaa9dc6 ("tcp: uniform the set up of sockets after successful connection")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
64ac5f5977df ("tipc: refactor function filter_rcv()")
75da2163dbb6 ("tipc: introduce communication groups")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a3f8683bf7d5 ("->poll() methods should return __poll_t")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
a80ae5306a73 ("tipc: improve destination linked list")
ade994f4f6c8 ("net: annotate ->poll() instances")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
v4.9.158: Failed to apply! Possible dependencies:
13d3b1ebe287 ("bpf: Support for setting initial receive window")
27204aaa9dc6 ("tcp: uniform the set up of sockets after successful connection")
3007098494be ("cgroup: add support for eBPF programs")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
40304b2a1567 ("bpf: BPF support for sock_ops")
526735ddc0ae ("net: fix AF_SMC related typo")
610236587600 ("bpf: Add new cgroup attach type to enable sock modifications")
8550f328f45d ("bpf: Support for per connection SYN/SYN-ACK RTOs")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
9872a4bde31b ("bpf: Add TCP connection BPF callbacks")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a3f8683bf7d5 ("->poll() methods should return __poll_t")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
ac7138746e14 ("smc: establish new socket family")
ade994f4f6c8 ("net: annotate ->poll() instances")
b2cd12574aa3 ("bpf: Refactor cgroups code in prep for new type")
cb5da847af44 ("tipc: set kern=0 in sk_alloc() during tipc_accept()")
cdfbabfb2f0c ("net: Work around lockdep limitation in sockets that use sockets")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
v4.4.174: Failed to apply! Possible dependencies:
35da60941e44 ("pstore/ram: add Device Tree bindings")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
4420cfd3f51c ("staging: lustre: format properly all comment blocks for LNet core")
44a7185c2ae6 ("of/platform: Add common method to populate default bus")
4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
529182e204db ("ramoops: use DT reserved-memory bindings")
53692b1de419 ("sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC")
5fd88337d209 ("staging: lustre: fix all conditional comparison to zero in LNet layer")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards")
v3.18.134: Failed to apply! Possible dependencies:
35da60941e44 ("pstore/ram: add Device Tree bindings")
3830d0771ef6 ("soc: qcom: Introduce QMI helpers")
43443ad692cf ("of/platform: add function to populate default bus")
44a7185c2ae6 ("of/platform: Add common method to populate default bus")
4b638df4c9d5 ("soc: qcom: Add Shared Memory Manager driver")
529182e204db ("ramoops: use DT reserved-memory bindings")
7ce75bb2c05e ("ARM: qcom: Add Subsystem Power Manager (SPM) driver")
7d0c8beea6b8 ("soc: qcom: Reorder SMEM/SMD configs")
8c9814b97002 ("net: convert unix_address.refcnt from atomic_t to refcount_t")
936f14cf4e67 ("soc: qcom: Driver for the Qualcomm RPM over SMD")
9b2c45d479d0 ("net: make getname() functions return length rather than use int* parameter")
9b8a11e82615 ("soc: qcom: Introduce QMI encoder/decoder")
a50ff19d0658 ("of/platform: Generalize /reserved-memory handling")
d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
f2ab3298fb49 ("soc: qcom: Add Shared Memory Driver")
fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards")
How should we proceed with this patch?
--
Thanks,
Sasha
On Mon, Feb 18, 2019 at 3:14 PM Sasha Levin <sashal(a)kernel.org> wrote:
>
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v4.20.8, v4.19.21, v4.14.99, v4.9.156, v4.4.174, v3.18.134.
>
> v4.20.8: Build OK!
> v4.19.21: Failed to apply! Possible dependencies:
> 01d5d7fa8376 ("PCI: Add macro for Switchtec quirk declarations")
>
> v4.14.99: Failed to apply! Possible dependencies:
> 01d5d7fa8376 ("PCI: Add macro for Switchtec quirk declarations")
> 06dc4ee54e30 ("PCI: Disable MSI for Freescale Layerscape PCIe RC mode")
> 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> 8948ca1a12c9 ("vga_switcheroo: Deduplicate power state tracking")
> ad281ecf1c7d ("PCI: Add DMA alias quirk for Microsemi Switchtec NTB")
>
> v4.9.156: Failed to apply! Possible dependencies:
> 01d5d7fa8376 ("PCI: Add macro for Switchtec quirk declarations")
> 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> 3e13676862f9 ("thunderbolt: Add support for DMA configuration based mailbox")
> 46cd4b75cd0e ("efi: Add device path parser")
> 58c5475aba67 ("x86/efi: Retrieve and assign Apple device properties")
> 630b3aff8a51 ("treewide: Consolidate Apple DMI checks")
> 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
> 8948ca1a12c9 ("vga_switcheroo: Deduplicate power state tracking")
> 9d3cce0b6136 ("thunderbolt: Introduce thunderbolt bus and connection manager")
> ac6c44de503e ("thunderbolt: Expose get_route() to other files")
> ad281ecf1c7d ("PCI: Add DMA alias quirk for Microsemi Switchtec NTB")
> bfe778ac4982 ("thunderbolt: Convert switch to a device")
> c9cc3aaa0281 ("thunderbolt: Use Device ROM retrieved from EFI")
> da2da04b8d44 ("thunderbolt: Rework capability handling")
> f67cf491175a ("thunderbolt: Add support for Internal Connection Manager (ICM)")
> fa6d513aefe4 ("drivers:gpu: vga :vga_switcheroo.c : Fixed some coding style issues")
>
> v4.4.174: Failed to apply! Possible dependencies:
> 01d5d7fa8376 ("PCI: Add macro for Switchtec quirk declarations")
> 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> 14d2000182ed ("drm/radeon: Defer probe if gmux is present but its driver isn't")
> 156d7d4120e1 ("vga_switcheroo: Add handler flags infrastructure")
> 3a848662c751 ("vga_switcheroo: Prettify documentation")
> 412c8f7de011 ("drm/radeon: Return -EPROBE_DEFER when amdkfd not loaded")
> 704ab614ec12 ("drm/i915: Defer probe if gmux is present but its driver isn't")
> 8948ca1a12c9 ("vga_switcheroo: Deduplicate power state tracking")
> 989561de9b51 ("PM / Domains: add setter for dev.pm_domain")
> 98b3a3402eb6 ("drm/nouveau: Defer probe if gmux is present but its driver isn't")
> a345918d6ee6 ("vga_switcheroo: Support deferred probing of audio clients")
> ad281ecf1c7d ("PCI: Add DMA alias quirk for Microsemi Switchtec NTB")
> b00e5334ab1b ("vga_switcheroo: Add helper for deferred probing")
> b5f88dd1d6ef ("Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()"")
> c1e1655bb892 ("apple-gmux: Assign apple_gmux_data before registering")
> c68f4528a2e9 ("drm/amdkfd: Track when module's init is complete")
> fa6d513aefe4 ("drivers:gpu: vga :vga_switcheroo.c : Fixed some coding style issues")
>
> v3.18.134: Failed to apply! Possible dependencies:
> 01d5d7fa8376 ("PCI: Add macro for Switchtec quirk declarations")
> 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> 083dba02947d ("drm/nouveau/device: recognise GM204")
> 2f4a58e852d1 ("drm/nouveau/subdev: always upcast through nouveau_subdev()/nouveau_engine()")
> 4766ec53945f ("drm/nouveau/bios: add parsing of BIT M(v2) +0x03 table")
> 50e216d6e7c3 ("drm/nouveau/bios: add parsing of pmu image tables")
> 5444204036b2 ("drm/nouveau: switch to new-style timer macros")
> 7bb6d4428d3d ("drm/nouveau: move the (far too many...) different s/r paths to the same place")
> 8d5e3af15c79 ("drm/nouveau/device: Add support for GK208B, resolves bug 86935")
> 8d85e06b5e04 ("drm/nouveau/bios: add pci data structure parsing")
> 989aa5b76ad2 ("drm/nouveau/nvif: namespace of nvkm accessors (no binary change)")
> a01ca78c8f11 ("drm/nouveau/nvif: simplify and tidy library interfaces")
> ad281ecf1c7d ("PCI: Add DMA alias quirk for Microsemi Switchtec NTB")
> ad4a36263535 ("drm/nouveau/bios: split out shadow methods")
> b71a1344ec20 ("drm/nouveau/bios: add NPDE parsing")
> ba6e34e61271 ("drm/gm204/devinit: initial implementation")
> be83cd4ef9a2 ("drm/nouveau: finalise nvkm namespace switch (no binary change)")
> c39f472e9f14 ("drm/nouveau: remove symlinks, move core/ to nvkm/ (no code changes)")
> cb8bb9cedb60 ("drm/nouveau/tmr: cosmetic changes")
> d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
> f3867f439fd6 ("drm/nouveau/clk: rename from clock (no binary change)")
> f8a8546194d7 ("drm/nouveau/clk: allow non-blocking for nouveau_clock_astate()")
>
>
> How should we proceed with this patch?
Is there any way we can turn off this automated checking for a while?
At this stage, where we're just trying to discuss the issue, these
emails just clutter things up.
Hi,
[This is an automated email]
This commit has been processed because it contains a "Fixes:" tag,
fixing commit: a7d42ddb3099 nfs: add mirroring support to pgio layer.
The bot has tested the following trees: v4.20.10, v4.19.23, v4.14.101, v4.9.158, v4.4.174.
v4.20.10: Build OK!
v4.19.23: Build OK!
v4.14.101: Build OK!
v4.9.158: Build OK!
v4.4.174: Failed to apply! Possible dependencies:
c18b96a1b862 ("nfs: clean up rest of reqs when failing to add one")
d600ad1f2bdb ("NFS41: pop some layoutget errors to application")
How should we proceed with this patch?
--
Thanks,
Sasha
This is an automatic generated email to let you know that the following patch were queued:
Subject: media: sun6i: Fix CSI regmap's max_register
Author: Chen-Yu Tsai <wens(a)csie.org>
Date: Sun Feb 3 11:03:56 2019 -0500
max_register is currently set to 0x1000. This is beyond the mapped
address range of the hardware, so attempts to dump the regmap from
debugfs would trigger a kernel exception.
Furthermore, the useful registers only occupy a small section at the
beginning of the full range. Change the value to 0x9c, the last known
register on the V3s and H3.
On the A31, the register range is extended to support additional
capture channels. Since this is not yet supported, ignore it for now.
Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Chen-Yu Tsai <wens(a)csie.org>
Acked-by: Maxime Ripard <maxime.ripard(a)bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung(a)kernel.org>
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index 5ecdfbf9f6ae..457131c7f74a 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -803,7 +803,7 @@ static const struct regmap_config sun6i_csi_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
- .max_register = 0x1000,
+ .max_register = 0x9c,
};
static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev,