Skip to content

Commit bb1d73f

Browse files
committed
Merge tag 's390-7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Alexander Gordeev: - Reject zero-length writes from userspace that corrupt Debug Facility buffers - Replace one s390 PCI maintainer - Remove SCLP_OFB Kconfig option and enable the guarded code unconditionally - Replace incorrect use of phys_to_folio() to virt_to_folio() in do_secure_storage_access() * tag 's390-7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/mm: Fix phys_to_folio() usage in do_secure_storage_access() s390/sclp: Remove SCLP_OFB Kconfig option MAINTAINERS: Replace one of the maintainers for s390/pci s390/debug: Reject zero-length input in debug_input_flush_fn() s390/debug: Reject zero-length input before trimming a newline
2 parents 227c3d5 + b95e0e7 commit bb1d73f

5 files changed

Lines changed: 10 additions & 16 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23555,7 +23555,7 @@ F: drivers/s390/net/
2355523555

2355623556
S390 PCI SUBSYSTEM
2355723557
M: Niklas Schnelle <schnelle@linux.ibm.com>
23558-
M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
23558+
M: Gerd Bayer <gbayer@linux.ibm.com>
2355923559
L: linux-s390@vger.kernel.org
2356023560
S: Supported
2356123561
F: Documentation/arch/s390/pci.rst

arch/s390/kernel/debug.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,9 @@ static inline char *debug_get_user_string(const char __user *user_buf,
14141414
{
14151415
char *buffer;
14161416

1417+
if (!user_len)
1418+
return ERR_PTR(-EINVAL);
1419+
14171420
buffer = memdup_user_nul(user_buf, user_len);
14181421
if (IS_ERR(buffer))
14191422
return buffer;
@@ -1584,6 +1587,11 @@ static int debug_input_flush_fn(debug_info_t *id, struct debug_view *view,
15841587
char input_buf[1];
15851588
int rc = user_len;
15861589

1590+
if (!user_len) {
1591+
rc = -EINVAL;
1592+
goto out;
1593+
}
1594+
15871595
if (user_len > 0x10000)
15881596
user_len = 0x10000;
15891597
if (*offset != 0) {

arch/s390/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ void do_secure_storage_access(struct pt_regs *regs)
438438
panic("Unexpected PGM 0x3d with TEID bit 61=0");
439439
}
440440
if (is_kernel_fault(regs)) {
441-
folio = phys_to_folio(addr);
441+
folio = virt_to_folio((void *)addr);
442442
if (unlikely(!folio_try_get(folio)))
443443
return;
444444
rc = uv_convert_from_secure(folio_to_phys(folio));

drivers/s390/char/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,6 @@ config HMC_DRV
8585
transfer cache size from its default value 0.5MB to N bytes. If N
8686
is zero, then no caching is performed.
8787

88-
config SCLP_OFB
89-
def_bool n
90-
prompt "Support for Open-for-Business SCLP Event"
91-
depends on S390
92-
help
93-
This option enables the Open-for-Business interface to the s390
94-
Service Element.
95-
9688
config S390_UV_UAPI
9789
def_tristate m
9890
prompt "Ultravisor userspace API"

drivers/s390/char/sclp_config.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,11 @@ static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
8080

8181
static struct sclp_register sclp_conf_register =
8282
{
83-
#ifdef CONFIG_SCLP_OFB
8483
.send_mask = EVTYP_CONFMGMDATA_MASK,
85-
#endif
8684
.receive_mask = EVTYP_CONFMGMDATA_MASK,
8785
.receiver_fn = sclp_conf_receiver_fn,
8886
};
8987

90-
#ifdef CONFIG_SCLP_OFB
9188
static int sclp_ofb_send_req(char *ev_data, size_t len)
9289
{
9390
static DEFINE_MUTEX(send_mutex);
@@ -143,11 +140,9 @@ static const struct bin_attribute ofb_bin_attr = {
143140
},
144141
.write = sysfs_ofb_data_write,
145142
};
146-
#endif
147143

148144
static int __init sclp_ofb_setup(void)
149145
{
150-
#ifdef CONFIG_SCLP_OFB
151146
struct kset *ofb_kset;
152147
int rc;
153148

@@ -159,7 +154,6 @@ static int __init sclp_ofb_setup(void)
159154
kset_unregister(ofb_kset);
160155
return rc;
161156
}
162-
#endif
163157
return 0;
164158
}
165159

0 commit comments

Comments
 (0)