stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>,
	kernel test robot <lkp@intel.com>,
	Richard Weinberger <richard@nod.at>,
	Sasha Levin <sashal@kernel.org>,
	anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
	masahiroy@kernel.org, linux-um@lists.infradead.org
Subject: [PATCH AUTOSEL 6.3 09/67] um: harddog: fix modular build
Date: Thu, 25 May 2023 14:30:46 -0400	[thread overview]
Message-ID: <20230525183144.1717540-9-sashal@kernel.org> (raw)
In-Reply-To: <20230525183144.1717540-1-sashal@kernel.org>

From: Johannes Berg <johannes.berg@intel.com>

[ Upstream commit 73a23d7710331a530e972903318528b75e5a5f58 ]

Since we no longer (want to) export any libc symbols the
_user portions of any drivers need to be built into image
rather than the module. I missed this for the watchdog.
Fix the watchdog accordingly.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/um/drivers/Makefile           | 4 +++-
 arch/um/drivers/harddog.h          | 9 +++++++++
 arch/um/drivers/harddog_kern.c     | 7 +------
 arch/um/drivers/harddog_user.c     | 1 +
 arch/um/drivers/harddog_user_exp.c | 9 +++++++++
 5 files changed, 23 insertions(+), 7 deletions(-)
 create mode 100644 arch/um/drivers/harddog.h
 create mode 100644 arch/um/drivers/harddog_user_exp.c

diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index dee6f66353b33..a461a950f0518 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -16,7 +16,8 @@ mconsole-objs := mconsole_kern.o mconsole_user.o
 hostaudio-objs := hostaudio_kern.o
 ubd-objs := ubd_kern.o ubd_user.o
 port-objs := port_kern.o port_user.o
-harddog-objs := harddog_kern.o harddog_user.o
+harddog-objs := harddog_kern.o
+harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
 rtc-objs := rtc_kern.o rtc_user.o
 
 LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
@@ -60,6 +61,7 @@ obj-$(CONFIG_PTY_CHAN) += pty.o
 obj-$(CONFIG_TTY_CHAN) += tty.o 
 obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
 obj-$(CONFIG_UML_WATCHDOG) += harddog.o
+obj-y += $(harddog-builtin-y) $(harddog-builtin-m)
 obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
 obj-$(CONFIG_UML_RANDOM) += random.o
 obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
diff --git a/arch/um/drivers/harddog.h b/arch/um/drivers/harddog.h
new file mode 100644
index 0000000000000..6d9ea60e7133e
--- /dev/null
+++ b/arch/um/drivers/harddog.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef UM_WATCHDOG_H
+#define UM_WATCHDOG_H
+
+int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
+void stop_watchdog(int in_fd, int out_fd);
+int ping_watchdog(int fd);
+
+#endif /* UM_WATCHDOG_H */
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index e6d4f43deba82..60d1c6cab8a95 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -47,6 +47,7 @@
 #include <linux/spinlock.h>
 #include <linux/uaccess.h>
 #include "mconsole.h"
+#include "harddog.h"
 
 MODULE_LICENSE("GPL");
 
@@ -60,8 +61,6 @@ static int harddog_out_fd = -1;
  *	Allow only one person to hold it open
  */
 
-extern int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
-
 static int harddog_open(struct inode *inode, struct file *file)
 {
 	int err = -EBUSY;
@@ -92,8 +91,6 @@ static int harddog_open(struct inode *inode, struct file *file)
 	return err;
 }
 
-extern void stop_watchdog(int in_fd, int out_fd);
-
 static int harddog_release(struct inode *inode, struct file *file)
 {
 	/*
@@ -112,8 +109,6 @@ static int harddog_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-extern int ping_watchdog(int fd);
-
 static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
 			     loff_t *ppos)
 {
diff --git a/arch/um/drivers/harddog_user.c b/arch/um/drivers/harddog_user.c
index 070468d22e394..9ed89304975ed 100644
--- a/arch/um/drivers/harddog_user.c
+++ b/arch/um/drivers/harddog_user.c
@@ -7,6 +7,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <os.h>
+#include "harddog.h"
 
 struct dog_data {
 	int stdin_fd;
diff --git a/arch/um/drivers/harddog_user_exp.c b/arch/um/drivers/harddog_user_exp.c
new file mode 100644
index 0000000000000..c74d4b815d143
--- /dev/null
+++ b/arch/um/drivers/harddog_user_exp.c
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/export.h>
+#include "harddog.h"
+
+#if IS_MODULE(CONFIG_UML_WATCHDOG)
+EXPORT_SYMBOL(start_watchdog);
+EXPORT_SYMBOL(stop_watchdog);
+EXPORT_SYMBOL(ping_watchdog);
+#endif
-- 
2.39.2


  parent reply	other threads:[~2023-05-25 18:33 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 18:30 [PATCH AUTOSEL 6.3 01/67] nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 02/67] nvme-pci: add quirk for missing secondary temperature thresholds Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 03/67] nvme-pci: clamp max_hw_sectors based on DMA optimized limitation Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 04/67] ASoC: amd: yc: Add DMI entry to support System76 Pangolin 12 Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 05/67] ASoC: dwc: limit the number of overrun messages Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 06/67] cpupower:Fix resource leaks in sysfs_get_enabled() Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 07/67] selftests/ftrace: Improve integration with kselftest runner Sasha Levin
2023-05-26 15:23   ` Mark Brown
2023-06-01  9:30     ` Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 08/67] ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function Sasha Levin
2023-05-25 18:30 ` Sasha Levin [this message]
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 10/67] xfrm: Check if_id in inbound policy/secpath match Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 11/67] ASoC: jz4740-i2s: Make I2S divider calculations more robust Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 12/67] ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 13/67] ALSA: hda/realtek: Add quirks for ASUS GU604V and GU603V Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 14/67] ASoC: ssm2602: Add workaround for playback distortions Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 15/67] media: dvb_demux: fix a bug for the continuity counter Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 16/67] media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer() Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 17/67] media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer() Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 18/67] media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer() Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 19/67] media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 20/67] media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer() Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 21/67] media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address Sasha Levin
2023-05-25 18:30 ` [PATCH AUTOSEL 6.3 22/67] media: netup_unidvb: fix irq init by register it at the end of probe Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 23/67] media: dvb_ca_en50221: fix a size write bug Sasha Levin
2023-06-16 19:21   ` Pavel Machek
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 24/67] media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 25/67] media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 26/67] media: dvb-core: Fix use-after-free on race condition at dvb_frontend Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 27/67] media: dvb-core: Fix use-after-free due on race condition at dvb_net Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 28/67] media: dvb-core: Fix use-after-free due to race at dvb_register_device() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 29/67] media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 30/67] media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221 Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 31/67] ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 32/67] ASoC: SOF: pcm: fix pm_runtime imbalance in error handling Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 33/67] ASoC: SOF: sof-client-probes: " Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 34/67] ASoC: SOF: pm: save io region state in case of errors in resume Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 35/67] tipc: add tipc_bearer_min_mtu to calculate min mtu Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 36/67] s390/pkey: zeroize key blobs Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 37/67] s390/topology: honour nr_cpu_ids when adding CPUs Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 38/67] s390/ipl: fix IPIB virtual vs physical address confusion Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 39/67] ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 40/67] wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 41/67] ARM: dts: stm32: add pin map for CAN controller on stm32f7 Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 42/67] ARM: dts: stm32: add CAN support on stm32f746 Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 43/67] arm64/mm: mark private VM_FAULT_X defines as vm_fault_t Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 44/67] arm64: vdso: Pass (void *) to virt_to_page() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 45/67] wifi: mac80211: simplify chanctx allocation Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 46/67] wifi: mac80211: consider reserved chanctx for mindef Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 47/67] wifi: mac80211: recalc chanctx mindef before assigning Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 48/67] wifi: iwlwifi: mvm: Add locking to the rate read flow Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 49/67] scsi: ufs: core: Fix MCQ tag calculation Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 50/67] scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 51/67] scsi: ufs: core: Fix MCQ nr_hw_queues Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 52/67] scsi: Revert "scsi: core: Do not increase scsi_device's iorequest_cnt if dispatch failed" Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 53/67] scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 54/67] wifi: b43: fix incorrect __packed annotation Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 55/67] net: wwan: t7xx: Ensure init is completed before system sleep Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 56/67] netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 57/67] nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 58/67] nvme: do not let the user delete a ctrl before a complete initialization Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 59/67] ALSA: oss: avoid missing-prototype warnings Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 60/67] drm/msm: Be more shouty if per-process pgtables aren't working Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 61/67] atm: hide unused procfs functions Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 62/67] mdio_bus: unhide mdio_bus_init prototype Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 63/67] ceph: silence smatch warning in reconnect_caps_cb() Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 64/67] drm/amdgpu: skip disabling fence driver src_irqs when device is unplugged Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 65/67] ublk: fix AB-BA lockdep warning Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 66/67] nvme-pci: Add quirk for Teamgroup MP33 SSD Sasha Levin
2023-05-25 18:31 ` [PATCH AUTOSEL 6.3 67/67] block: Deny writable memory mapping if block is read-only Sasha Levin
2023-05-25 19:02 ` [PATCH AUTOSEL 6.3 01/67] nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G Eric Biggers
2023-06-01  9:52   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230525183144.1717540-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).