A bugfix introduce a link failure in configurations without CONFIG_MODULES:
In file included from drivers/media/usb/dvb-usb/pctv452e.c:20:0:
drivers/media/usb/dvb-usb/pctv452e.c: In function 'pctv452e_frontend_attach':
drivers/media/dvb-frontends/stb0899_drv.h:151:36: error: weak declaration of 'stb0899_attach' being applied to a already existing, static definition
The problem is that the !IS_REACHABLE() declaration of stb0899_attach()
is a 'static inline' definition that clashes with the weak definition.
I further observed that the bugfix was only done for one of the five users
of stb0899_attach(), the other four still have the problem. This reverts
the bugfix and instead addresses the problem by not dropping the reference
count when calling '->detach()', instead we call this function directly
in dvb_frontend_put() before dropping the kref on the front-end.
I first submitted this in early 2018, and after some discussion it
was apparently discarded. While there is a long-term plan in place,
that plan is obviously not nearing completion yet, and the current
kernel is still broken unless this patch is applied.
Cc: Max Kellermann <max.kellermann(a)gmail.com>
Cc: Wolfgang Rohdewald <wolfgang(a)rohdewald.de>
Cc: stable(a)vger.kernel.org
Fixes: f686c14364ad ("[media] stb0899: move code to "detach" callback")
Fixes: 6cdeaed3b142 ("media: dvb_usb_pctv452e: module refcount changes were unbalanced")
Link: https://patchwork.kernel.org/patch/10140175/
Link: https://patchwork.linuxtv.org/patch/54831/
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
---
resending again, after nobody commented on the resending in March.
---
drivers/media/dvb-core/dvb_frontend.c | 4 +++-
drivers/media/usb/dvb-usb/pctv452e.c | 8 --------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index cc31c2bf0483..202f0ba5819c 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -152,6 +152,9 @@ static void dvb_frontend_free(struct kref *ref)
static void dvb_frontend_put(struct dvb_frontend *fe)
{
+ /* call detach before dropping the reference count */
+ if (fe->ops.detach)
+ fe->ops.detach(fe);
/*
* Check if the frontend was registered, as otherwise
* kref was not initialized yet.
@@ -3040,7 +3043,6 @@ void dvb_frontend_detach(struct dvb_frontend *fe)
dvb_frontend_invoke_release(fe, fe->ops.release_sec);
dvb_frontend_invoke_release(fe, fe->ops.tuner_ops.release);
dvb_frontend_invoke_release(fe, fe->ops.analog_ops.release);
- dvb_frontend_invoke_release(fe, fe->ops.detach);
dvb_frontend_put(fe);
}
EXPORT_SYMBOL(dvb_frontend_detach);
diff --git a/drivers/media/usb/dvb-usb/pctv452e.c b/drivers/media/usb/dvb-usb/pctv452e.c
index d6b36e4f33d2..441d878fc22c 100644
--- a/drivers/media/usb/dvb-usb/pctv452e.c
+++ b/drivers/media/usb/dvb-usb/pctv452e.c
@@ -909,14 +909,6 @@ static int pctv452e_frontend_attach(struct dvb_usb_adapter *a)
&a->dev->i2c_adap);
if (!a->fe_adap[0].fe)
return -ENODEV;
-
- /*
- * dvb_frontend will call dvb_detach for both stb0899_detach
- * and stb0899_release but we only do dvb_attach(stb0899_attach).
- * Increment the module refcount instead.
- */
- symbol_get(stb0899_attach);
-
if ((dvb_attach(lnbp22_attach, a->fe_adap[0].fe,
&a->dev->i2c_adap)) == NULL)
err("Cannot attach lnbp22\n");
--
2.20.0
I'm announcing the release of the 4.19.53 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Andrey Ryabinin (1):
x86/kasan: Fix boot with 5-level paging and KASAN
Baoquan He (1):
x86/mm/KASLR: Compute the size of the vmemmap section properly
Baruch Siach (1):
rtc: pcf8523: don't return invalid date when battery is low
Benjamin Tissoires (1):
HID: multitouch: handle faulty Elo touch device
Bernd Eckstein (1):
usbnet: ipheth: fix racing condition
Borislav Petkov (2):
RAS/CEC: Fix binary search function
x86/microcode, cpuhotplug: Add a microcode loader CPU hotplug callback
Chris Packham (1):
USB: serial: pl2303: add Allied Telesis VT-Kit3
Christian Borntraeger (1):
KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION
Christoph Hellwig (4):
nvme: fix srcu locking on error return in nvme_get_ns_from_disk
nvme: remove the ifdef around nvme_nvm_ioctl
nvme: merge nvme_ns_ioctl into nvme_ioctl
nvme: release namespace SRCU protection before performing controller ioctls
Colin Ian King (1):
scsi: bnx2fc: fix incorrect cast to u64 on shift operation
Coly Li (2):
bcache: fix stack corruption by PRECEDING_KEY()
bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached
Cong Wang (1):
RAS/CEC: Convert the timer callback to a workqueue
Daniele Palmas (1):
USB: serial: option: add Telit 0x1260 and 0x1261 compositions
Dave Airlie (1):
drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3)
Douglas Anderson (1):
usb: dwc2: host: Fix wMaxPacketSize handling (fix webcam regression)
Eric W. Biederman (1):
signal/ptrace: Don't leak unitialized kernel memory with PTRACE_PEEK_SIGINFO
Greg Kroah-Hartman (1):
Linux 4.19.53
Hangbin Liu (1):
selftests: fib_rule_tests: fix local IPv4 address typo
Hans de Goede (2):
libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk
platform/x86: pmc_atom: Add Lex 3I380D industrial PC to critclk_systems DMI table
Hui Wang (1):
Revert "ALSA: hda/realtek - Improve the headset mic for Acer Aspire laptops"
James Morse (1):
KVM: arm/arm64: Move cc/it checks under hyp's Makefile to avoid instrumentation
James Smart (2):
scsi: lpfc: correct rcu unlock issue in lpfc_nvme_info_show
scsi: lpfc: add check for loss of ndlp when sending RRQ
Jani Nikula (2):
drm/edid: abstract override/firmware EDID retrieval
drm: add fallback override/firmware EDID modes workaround
Jann Horn (1):
ptrace: restore smp_rmb() in __ptrace_may_access()
Jason Gerecke (5):
HID: wacom: Don't set tool type until we're in range
HID: wacom: Don't report anything prior to the tool entering range
HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact
HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth
HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary
Jörgen Storvist (1):
USB: serial: option: add support for Simcom SIM7500/SIM7600 RNDIS mode
Kai-Heng Feng (1):
USB: usb-storage: Add new ID to ums-realtek
Kailang Yang (1):
ALSA: hda/realtek - Update headset mode for ALC256
Kees Cook (1):
selftests/timers: Add missing fflush(stdout) calls
Marco Zatta (1):
USB: Fix chipmunk-like voice when using Logitech C270 for recording audio.
Mark Rutland (1):
arm64/mm: Inhibit huge-vmap with ptdump
Martin Schiller (1):
usb: dwc2: Fix DMA cache alignment issues
Minchan Kim (1):
mm/vmscan.c: fix trying to reclaim unevictable LRU page
Murray McAllister (2):
drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read
drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()
Paolo Bonzini (2):
KVM: x86/pmu: mask the result of rdpmc according to the width of the counters
KVM: x86/pmu: do not mask the value that is written to fixed PMUs
Peter Zijlstra (1):
x86/uaccess, kcov: Disable stack protector
Prarit Bhargava (1):
x86/resctrl: Prevent NULL pointer dereference when local MBM is disabled
Qian Cai (1):
libnvdimm: Fix compilation warnings with W=1
Randall Huang (1):
f2fs: fix to avoid accessing xattr across the boundary
Robin Murphy (1):
iommu/arm-smmu: Avoid constant zero in TLBI writes
Russell King (1):
i2c: acorn: fix i2c warning
S.j. Wang (2):
ASoC: cs42xx8: Add regcache mask dirty
ASoC: fsl_asrc: Fix the issue about unsupported rate
Shakeel Butt (1):
mm/list_lru.c: fix memory leak in __memcg_init_list_lru_node
Stefan Raspl (1):
tools/kvm_stat: fix fields filter for child events
Steffen Dirkwinkel (1):
platform/x86: pmc_atom: Add several Beckhoff Automation boards to critclk_systems DMI table
Takashi Iwai (3):
ALSA: seq: Protect in-kernel ioctl calls with mutex
ALSA: seq: Fix race of get-subscription call vs port-delete ioctls
Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex"
Takashi Sakamoto (2):
ALSA: oxfw: allow PCM capture for Stanton SCS.1m
ALSA: firewire-motu: fix destruction of data for isochronous resources
Tejun Heo (1):
cgroup: Use css_tryget() instead of css_tryget_online() in task_get_css()
Thomas Backlund (1):
nouveau: Fix build with CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT disabled
Thomas Gleixner (1):
timekeeping: Repair ktime_get_coarse*() granularity
Tom Zanussi (1):
tracing: Prevent hist_field_var_ref() from accessing NULL tracing_map_elts
Vasily Gorbik (1):
s390/kasan: fix strncpy_from_user kasan checks
Ville Syrjälä (1):
drm/i915/sdvo: Implement proper HDMI audio support for SDVO
Wengang Wang (1):
fs/ocfs2: fix race in ocfs2_dentry_attach_lock()
Young Xiao (1):
Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var
YueHaibing (2):
scsi: qedi: remove memset/memcpy to nfunc and use func instead
scsi: qedi: remove set but not used variables 'cdev' and 'udev'
Yufen Yu (1):
nvme: fix memory leak for power latency tolerance
From: Arnaldo Carvalho de Melo <acme(a)redhat.com>
commit 4a2233b194c77ae1ea8304cb7c00b551de4313f0 upstream.
A recent fix for 'perf trace' introduced a bug where
machine__exit(trace->host) could be called while trace->host was still
NULL, so make this more robust by guarding against NULL, just like
free() does.
The problem happens, for instance, when !root users try to run 'perf
trace':
[acme@jouet linux]$ trace
Error: No permissions to read /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit)
Hint: Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
perf: Segmentation fault
Obtained 7 stack frames.
[0x4f1b2e]
/lib64/libc.so.6(+0x3671f) [0x7f43a1dd971f]
[0x4f3fec]
[0x47468b]
[0x42a2db]
/lib64/libc.so.6(__libc_start_main+0xe9) [0x7f43a1dc3509]
[0x42a6c9]
Segmentation fault (core dumped)
[acme@jouet linux]$
Cc: Adrian Hunter <adrian.hunter(a)intel.com>
Cc: Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
Cc: Andrei Vagin <avagin(a)openvz.org>
Cc: David Ahern <dsahern(a)gmail.com>
Cc: Jiri Olsa <jolsa(a)kernel.org>
Cc: Namhyung Kim <namhyung(a)kernel.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Vasily Averin <vvs(a)virtuozzo.com>
Cc: Wang Nan <wangnan0(a)huawei.com>
Fixes: 33974a414ce2 ("perf trace: Call machine__exit() at exit")
Signed-off-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
Signed-off-by: Tommi Rantala <tommi.t.rantala(a)nokia.com>
---
tools/perf/util/machine.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 968fd0454e6b..d246080cd85e 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -156,6 +156,9 @@ void machine__delete_threads(struct machine *machine)
void machine__exit(struct machine *machine)
{
+ if (machine == NULL)
+ return;
+
machine__destroy_kernel_maps(machine);
map_groups__exit(&machine->kmaps);
dsos__exit(&machine->dsos);
--
2.20.1