On Sun, Aug 28, 2022 at 08:33:17PM -0300, Martin Rodriguez Reboredo wrote:
> After the release of pahole 1.24 some people in the dwarves mailing list
> notified issues related to building the kernel with the BTF_DEBUG_INFO
> option toggled. They seem to be happenning due to the kernel and
> resolve_btfids interpreting btf types erroneously. In the dwarves list
> I've proposed a change to the scripts that I've written while testing
> the Rust kernel, it simply passes the --skip_encoding_btf_enum64 to
> pahole if it has version 1.24.
>
> v1 -> v2:
> - Switch to off by default and remove the config option.
> - Send it to stable instead.
hi,
we have change that needs to go to stable kernels but does not have the
equivalent fix in Linus tree
what would be the best way to submit it?
the issue is that new 'pahole' will generate BTF data that are not supported
by older kernels, so we need to add --skip_encoding_btf_enum64 option to
stable kernel's scripts/pahole-flags.sh to generate proper BTF data
we got complains that after upgrading to latest pahole the stable kernel
compilation fails
thanks,
jirka
>
> Signed-off-by: Martin Rodriguez Reboredo <yakoyoku(a)gmail.com>
> ---
> scripts/pahole-flags.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
> index 0d99ef17e4a5..0a48fd86bc68 100755
> --- a/scripts/pahole-flags.sh
> +++ b/scripts/pahole-flags.sh
> @@ -19,5 +19,8 @@ fi
> if [ "${pahole_ver}" -ge "122" ]; then
> extra_paholeopt="${extra_paholeopt} -j"
> fi
> +if [ "${pahole_ver}" -ge "124" ]; then
> + extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_enum64"
> +fi
>
> echo ${extra_paholeopt}
> --
> 2.37.2
>
This patch series was originally posted by Anssi Hannula [1].
In v2 I rebased and updated some of the patches [2].
Changes in v4:
- Add Tested-by: Anssi Hannula to
[PATCH v4 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
- Update commit message in
[PATCH v4 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
Changes in v3:
- Rebase on top of commit
1d5eeda23f36 ("can: kvaser_usb: advertise timestamping capabilities and add ioctl support")
- Add Tested-by: Anssi Hannula
- Add stable(a)vger.kernel.org to CC.
- Add my S-o-b to all patches
- Fix regression introduced in
[PATCH v2 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device,
found by Anssi Hannula [3]
[1]
https://lore.kernel.org/linux-can/20220516134748.3724796-1-anssi.hannula@bi…
[2]
https://lore.kernel.org/linux-can/20220708115709.232815-1-extja@kvaser.com
[3]
https://lore.kernel.org/linux-can/b25bc059-d776-146d-0b3c-41aecf4bd9f8@bitw…
Anssi Hannula (10):
can: kvaser_usb_leaf: Fix overread with an invalid command
can: kvaser_usb: Fix use of uninitialized completion
can: kvaser_usb: Fix possible completions during init_completion
can: kvaser_usb_leaf: Set Warning state even without bus errors
can: kvaser_usb_leaf: Fix TX queue out of sync after restart
can: kvaser_usb_leaf: Fix CAN state after restart
can: kvaser_usb_leaf: Fix improved state not being reported
can: kvaser_usb_leaf: Fix wrong CAN state after stopping
can: kvaser_usb_leaf: Ignore stale bus-off after start
can: kvaser_usb_leaf: Fix bogus restart events
Jimmy Assarsson (5):
can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event
to {leaf,usbcan}_cmd_can_error_event
can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
can: kvaser_usb: Add struct kvaser_usb_busparams
can: kvaser_usb: Compare requested bittiming parameters with actual
parameters in do_set_{,data}_bittiming
drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 32 +-
.../net/can/usb/kvaser_usb/kvaser_usb_core.c | 118 +++-
.../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 166 ++++--
.../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 543 ++++++++++++++++--
4 files changed, 764 insertions(+), 95 deletions(-)
--
2.37.3
This patch series was originally posted by Anssi Hannula [1].
In v2 I rebased and updated some of the patches [2].
Changes in v3:
- Rebase on top of commit
1d5eeda23f36 ("can: kvaser_usb: advertise timestamping capabilities and add ioctl support")
- Add Tested-by: Anssi Hannula
- Add stable(a)vger.kernel.org to CC.
- Add my S-o-b to all patches
- Fix regression introduced in
[PATCH v2 04/15] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device,
found by Anssi Hannula [3]
[1]
https://lore.kernel.org/linux-can/20220516134748.3724796-1-anssi.hannula@bi…
[2]
https://lore.kernel.org/linux-can/20220708115709.232815-1-extja@kvaser.com
[3]
https://lore.kernel.org/linux-can/b25bc059-d776-146d-0b3c-41aecf4bd9f8@bitw…
Anssi Hannula (10):
can: kvaser_usb_leaf: Fix overread with an invalid command
can: kvaser_usb: Fix use of uninitialized completion
can: kvaser_usb: Fix possible completions during init_completion
can: kvaser_usb_leaf: Set Warning state even without bus errors
can: kvaser_usb_leaf: Fix TX queue out of sync after restart
can: kvaser_usb_leaf: Fix CAN state after restart
can: kvaser_usb_leaf: Fix improved state not being reported
can: kvaser_usb_leaf: Fix wrong CAN state after stopping
can: kvaser_usb_leaf: Ignore stale bus-off after start
can: kvaser_usb_leaf: Fix bogus restart events
Jimmy Assarsson (5):
can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event
to {leaf,usbcan}_cmd_can_error_event
can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
can: kvaser_usb: Add struct kvaser_usb_busparams
can: kvaser_usb: Compare requested bittiming parameters with actual
parameters in do_set_{,data}_bittiming
drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 32 +-
.../net/can/usb/kvaser_usb/kvaser_usb_core.c | 118 +++-
.../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 166 ++++--
.../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 543 ++++++++++++++++--
4 files changed, 764 insertions(+), 95 deletions(-)
--
2.37.3
--
Irgendwann letzte Woche wurde Ihnen eine Mail mit der Erwartung von gesendet
Ich habe eine Antwortmail von Ihnen erhalten, aber zu meiner
Überraschung haben Sie sich nie die Mühe gemacht, zu antworten.
Bitte antworten Sie für weitere Erklärungen.
Hochachtungsvoll,
Keen J. Richardson.
This is the start of the stable review cycle for the 4.14.292 release.
There are 42 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun, 04 Sep 2022 12:13:47 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.292-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.292-rc1
Yang Yingliang <yangyingliang(a)huawei.com>
net: neigh: don't call kfree_skb() under spin_lock_irqsave()
Kuniyuki Iwashima <kuniyu(a)amazon.com>
kprobes: don't call disarm_kprobe() for disabled kprobes
Geert Uytterhoeven <geert(a)linux-m68k.org>
netfilter: conntrack: NF_CONNTRACK_PROCFS should no longer default to y
Juergen Gross <jgross(a)suse.com>
s390/hypfs: avoid error message under KVM
Denis V. Lunev <den(a)openvz.org>
neigh: fix possible DoS due to net iface start/stop loop
Jann Horn <jannh(a)google.com>
mm/rmap: Fix anon_vma->degree ambiguity leading to double-reuse
Yang Jihong <yangjihong1(a)huawei.com>
ftrace: Fix NULL pointer dereference in is_ftrace_trampoline when ftrace is dead
Letu Ren <fantasquex(a)gmail.com>
fbdev: fb_pm2fb: Avoid potential divide by zero error
Karthik Alapati <mail(a)karthek.com>
HID: hidraw: fix memory leak in hidraw_release()
Dongliang Mu <mudongliangabcd(a)gmail.com>
media: pvrusb2: fix memory leak in pvr_probe
Luiz Augusto von Dentz <luiz.von.dentz(a)intel.com>
Bluetooth: L2CAP: Fix build errors in some archs
Jing Leng <jleng(a)ambarella.com>
kbuild: Fix include path in scripts/Makefile.modpost
Pawan Gupta <pawan.kumar.gupta(a)linux.intel.com>
x86/bugs: Add "unknown" reporting for MMIO Stale Data
Gayatri Kammela <gayatri.kammela(a)intel.com>
x86/cpu: Add Tiger Lake to Intel family
Gerald Schaefer <gerald.schaefer(a)linux.ibm.com>
s390/mm: do not trigger write fault when vma does not allow VM_WRITE
Hsin-Yi Wang <hsinyi(a)chromium.org>
arm64: map FDT as RW for early_init_dt_scan()
Jann Horn <jannh(a)google.com>
mm: Force TLB flush for PFNMAP mappings before unlink_file_vma()
Guoqing Jiang <guoqing.jiang(a)linux.dev>
md: call __md_stop_writes in md_stop
David Hildenbrand <david(a)redhat.com>
mm/hugetlb: fix hugetlb not supporting softdirty tracking
Quanyang Wang <quanyang.wang(a)windriver.com>
asm-generic: sections: refactor memory_intersects
Siddh Raman Pant <code(a)siddh.me>
loop: Check for overflow while configuring loop
Goldwyn Rodrigues <rgoldwyn(a)suse.de>
btrfs: check if root is readonly while setting security xattr
Jacob Keller <jacob.e.keller(a)intel.com>
ixgbe: stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around sysctl_somaxconn.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around netdev_budget_usecs.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around netdev_budget.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around sysctl_net_busy_read.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around sysctl_net_busy_poll.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix a data-race around sysctl_tstamp_allow_data.
Kuniyuki Iwashima <kuniyu(a)amazon.com>
ratelimit: Fix data-races in ___ratelimit().
Kuniyuki Iwashima <kuniyu(a)amazon.com>
net: Fix data-races around weight_p and dev_weight_[rt]x_bias.
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_payload: do not truncate csum_offset and csum_type
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_payload: report ERANGE for too long offset and length
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: reject blobs that don't provide all entry points
Maciej Żenczykowski <maze(a)google.com>
net: ipvtap - add __init/__exit annotations to module init/exit funcs
Jonathan Toppins <jtoppins(a)redhat.com>
bonding: 802.3ad: fix no transmission of LACPDUs
Bernard Pidoux <f6bvp(a)free.fr>
rose: check NULL rose_loopback_neigh->loopback
Herbert Xu <herbert(a)gondor.apana.org.au>
af_key: Do not call xfrm_probe_algs in parallel
Xin Xiong <xiongx18(a)fudan.edu.cn>
xfrm: fix refcount leak in __xfrm_policy_check()
Basavaraj Natikar <Basavaraj.Natikar(a)amd.com>
pinctrl: amd: Don't save/restore interrupt status and wake status bits
Helge Deller <deller(a)gmx.de>
parisc: Fix exception handler for fldw and fstw instructions
Gaosheng Cui <cuigaosheng1(a)huawei.com>
audit: fix potential double free on error path from fsnotify_add_inode_mark
-------------
Diffstat:
.../hw-vuln/processor_mmio_stale_data.rst | 14 +++++
Makefile | 4 +-
arch/arm64/include/asm/mmu.h | 2 +-
arch/arm64/kernel/kaslr.c | 5 +-
arch/arm64/kernel/setup.c | 9 +++-
arch/arm64/mm/mmu.c | 15 +-----
arch/parisc/kernel/unaligned.c | 2 +-
arch/s390/hypfs/hypfs_diag.c | 2 +-
arch/s390/hypfs/inode.c | 2 +-
arch/s390/mm/fault.c | 4 +-
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/intel-family.h | 3 ++
arch/x86/kernel/cpu/bugs.c | 14 ++++-
arch/x86/kernel/cpu/common.c | 34 +++++++++----
drivers/block/loop.c | 5 ++
drivers/hid/hidraw.c | 3 ++
drivers/md/md.c | 1 +
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 1 +
drivers/net/bonding/bond_3ad.c | 38 ++++++--------
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 59 +++++++++++++++++-----
drivers/net/ipvlan/ipvtap.c | 4 +-
drivers/pinctrl/pinctrl-amd.c | 11 +++-
drivers/video/fbdev/pm2fb.c | 5 ++
fs/btrfs/xattr.c | 3 ++
include/asm-generic/sections.h | 7 ++-
include/linux/netfilter_bridge/ebtables.h | 4 --
include/linux/rmap.h | 7 ++-
include/net/busy_poll.h | 2 +-
kernel/audit_fsnotify.c | 1 +
kernel/kprobes.c | 10 ++--
kernel/trace/ftrace.c | 10 ++++
lib/ratelimit.c | 12 +++--
mm/mmap.c | 20 +++++++-
mm/rmap.c | 31 +++++++-----
net/bluetooth/l2cap_core.c | 10 ++--
net/bridge/netfilter/ebtable_broute.c | 8 ---
net/bridge/netfilter/ebtable_filter.c | 8 ---
net/bridge/netfilter/ebtable_nat.c | 8 ---
net/bridge/netfilter/ebtables.c | 8 +--
net/core/dev.c | 6 +--
net/core/neighbour.c | 27 +++++++---
net/core/skbuff.c | 2 +-
net/core/sock.c | 2 +-
net/core/sysctl_net_core.c | 15 +++---
net/key/af_key.c | 3 ++
net/netfilter/Kconfig | 1 -
net/netfilter/nft_payload.c | 29 ++++++++---
net/rose/rose_loopback.c | 3 +-
net/sched/sch_generic.c | 2 +-
net/socket.c | 2 +-
net/xfrm/xfrm_policy.c | 1 +
scripts/Makefile.modpost | 3 +-
52 files changed, 306 insertions(+), 177 deletions(-)
commit 770c79fb65506fc7c16459855c3839429f46cb32 upstream
Identifying and removing the stale device from the fs_uuids list is done
by btrfs_free_stale_devices(). btrfs_free_stale_devices() in turn
depends on device_path_matched() to check if the device appears in more
than one btrfs_device structure.
The matching of the device happens by its path, the device path. However,
when device mapper is in use, the dm device paths are nothing but a link
to the actual block device, which leads to the device_path_matched()
failing to match.
Fix this by matching the dev_t as provided by lookup_bdev() instead of
plain string compare of the device paths.
CC: stable(a)vger.kernel.org #5.10
Reported-by: Josef Bacik <josef(a)toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain(a)oracle.com>
Signed-off-by: David Sterba <dsterba(a)suse.com>
---
fs/btrfs/volumes.c | 44 +++++++++++++++++++++++++++++++++++++-------
1 file changed, 37 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2fdf178aa76f..d4d89e0738ff 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -540,15 +540,47 @@ btrfs_get_bdev_and_sb(const char *device_path, fmode_t flags, void *holder,
return ret;
}
-static bool device_path_matched(const char *path, struct btrfs_device *device)
+/*
+ * Check if the device in the path matches the device in the given struct device.
+ *
+ * Returns:
+ * true If it is the same device.
+ * false If it is not the same device or on error.
+ */
+static bool device_matched(const struct btrfs_device *device, const char *path)
{
- int found;
+ char *device_name;
+ struct block_device *bdev_old;
+ struct block_device *bdev_new;
+
+ /*
+ * If we are looking for a device with the matching dev_t, then skip
+ * device without a name (a missing device).
+ */
+ if (!device->name)
+ return false;
+
+ device_name = kzalloc(BTRFS_PATH_NAME_MAX, GFP_KERNEL);
+ if (!device_name)
+ return false;
rcu_read_lock();
- found = strcmp(rcu_str_deref(device->name), path);
+ scnprintf(device_name, BTRFS_PATH_NAME_MAX, "%s", rcu_str_deref(device->name));
rcu_read_unlock();
- return found == 0;
+ bdev_old = lookup_bdev(device_name);
+ kfree(device_name);
+ if (IS_ERR(bdev_old))
+ return false;
+
+ bdev_new = lookup_bdev(path);
+ if (IS_ERR(bdev_new))
+ return false;
+
+ if (bdev_old == bdev_new)
+ return true;
+
+ return false;
}
/*
@@ -581,9 +613,7 @@ static int btrfs_free_stale_devices(const char *path,
&fs_devices->devices, dev_list) {
if (skip_device && skip_device == device)
continue;
- if (path && !device->name)
- continue;
- if (path && !device_path_matched(path, device))
+ if (path && !device_matched(device, path))
continue;
if (fs_devices->opened) {
/* for an already deleted device return 0 */
--
2.33.1