Skip to content

Commit f4fb100

Browse files
committed
Merge tag 's390-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Vasily Gorbik: - Fix missing array_index_nospec() call in diag310 memory topology code to prevent speculative execution with a user controlled array index - Fix get_align_mask() return type to match vm_unmapped_area_info align_mask, avoiding possible truncation for future larger masks - Remove empty zcrypt CEX2 files left over after CEX2 and CEX3 driver removal - Add build salt to the vDSO so it gets a unique build id, similar to the kernel and modules * tag 's390-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: Add build salt to the vDSO s390/zcrypt: Remove the empty file s390/mm: Fix type mismatch in get_align_mask(). s390/diag: Add missing array_index_nospec() call to memtop_get_page_count()
2 parents 2f9eb0c + 7d5c2f6 commit f4fb100

7 files changed

Lines changed: 8 additions & 4 deletions

File tree

arch/s390/kernel/diag/diag310.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,18 @@ static int memtop_get_stride_len(unsigned long *res)
190190
static int memtop_get_page_count(unsigned long *res, unsigned long level)
191191
{
192192
static unsigned long memtop_pages[DIAG310_LEVELMAX];
193-
unsigned long pages;
193+
unsigned long pages, idx;
194194
int rc;
195195

196196
if (level > DIAG310_LEVELMAX || level < DIAG310_LEVELMIN)
197197
return -EINVAL;
198-
pages = READ_ONCE(memtop_pages[level - 1]);
198+
idx = array_index_nospec(level - 1, ARRAY_SIZE(memtop_pages));
199+
pages = READ_ONCE(memtop_pages[idx]);
199200
if (!pages) {
200201
rc = diag310_get_memtop_size(&pages, level);
201202
if (rc)
202203
return rc;
203-
WRITE_ONCE(memtop_pages[level - 1], pages);
204+
WRITE_ONCE(memtop_pages[idx], pages);
204205
}
205206
*res = pages;
206207
return 0;

arch/s390/kernel/vdso/note.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
* Here we can supply some information useful to userland.
55
*/
66

7+
#include <linux/build-salt.h>
78
#include <linux/uts.h>
89
#include <linux/version.h>
910
#include <linux/elfnote.h>
1011

1112
ELFNOTE_START(Linux, 0, "a")
1213
.long LINUX_VERSION_CODE
1314
ELFNOTE_END
15+
16+
BUILD_SALT

arch/s390/mm/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static inline unsigned long mmap_base(unsigned long rnd,
6464
return PAGE_ALIGN(STACK_TOP - gap - rnd);
6565
}
6666

67-
static int get_align_mask(struct file *filp, unsigned long flags)
67+
static unsigned long get_align_mask(struct file *filp, unsigned long flags)
6868
{
6969
if (filp && is_file_hugepages(filp))
7070
return huge_page_mask_align(filp);

drivers/s390/crypto/zcrypt_cex2a.c

Whitespace-only changes.

drivers/s390/crypto/zcrypt_cex2a.h

Whitespace-only changes.

drivers/s390/crypto/zcrypt_cex2c.c

Whitespace-only changes.

drivers/s390/crypto/zcrypt_cex2c.h

Whitespace-only changes.

0 commit comments

Comments
 (0)