Skip to content

Commit 5cf81d7

Browse files
committed
Merge tag 'hardening-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - yama: document function parameter (Christian Göttsche) - mm/util: Swap kmemdup_array() arguments (Jean-Philippe Brucker) - kunit/overflow: Adjust for __counted_by with DEFINE_RAW_FLEX() - MAINTAINERS: Update entries for Kees Cook * tag 'hardening-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: MAINTAINERS: Update entries for Kees Cook kunit/overflow: Adjust for __counted_by with DEFINE_RAW_FLEX() yama: document function parameter mm/util: Swap kmemdup_array() arguments
2 parents 6226e74 + 1ab1a42 commit 5cf81d7

File tree

7 files changed

+38
-23
lines changed

7 files changed

+38
-23
lines changed

MAINTAINERS

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5295,7 +5295,7 @@ F: drivers/infiniband/hw/usnic/
52955295

52965296
CLANG CONTROL FLOW INTEGRITY SUPPORT
52975297
M: Sami Tolvanen <[email protected]>
5298-
M: Kees Cook <keescook@chromium.org>
5298+
M: Kees Cook <kees@kernel.org>
52995299
R: Nathan Chancellor <[email protected]>
53005300
53015301
S: Supported
@@ -8211,7 +8211,7 @@ F: rust/kernel/net/phy.rs
82118211

82128212
EXEC & BINFMT API, ELF
82138213
R: Eric Biederman <[email protected]>
8214-
R: Kees Cook <keescook@chromium.org>
8214+
R: Kees Cook <kees@kernel.org>
82158215
82168216
S: Supported
82178217
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
@@ -8612,7 +8612,7 @@ S: Maintained
86128612
F: drivers/net/ethernet/nvidia/*
86138613

86148614
FORTIFY_SOURCE
8615-
M: Kees Cook <keescook@chromium.org>
8615+
M: Kees Cook <kees@kernel.org>
86168616
86178617
S: Supported
86188618
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -9102,7 +9102,7 @@ F: include/linux/mfd/gsc.h
91029102
F: include/linux/platform_data/gsc_hwmon.h
91039103

91049104
GCC PLUGINS
9105-
M: Kees Cook <keescook@chromium.org>
9105+
M: Kees Cook <kees@kernel.org>
91069106
91079107
S: Maintained
91089108
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -9236,7 +9236,7 @@ S: Maintained
92369236
F: drivers/input/touchscreen/resistive-adc-touch.c
92379237

92389238
GENERIC STRING LIBRARY
9239-
M: Kees Cook <keescook@chromium.org>
9239+
M: Kees Cook <kees@kernel.org>
92409240
R: Andy Shevchenko <[email protected]>
92419241
92429242
S: Supported
@@ -11950,7 +11950,7 @@ F: scripts/package/
1195011950
F: usr/
1195111951

1195211952
KERNEL HARDENING (not covered by other areas)
11953-
M: Kees Cook <keescook@chromium.org>
11953+
M: Kees Cook <kees@kernel.org>
1195411954
R: Gustavo A. R. Silva <[email protected]>
1195511955
1195611956
S: Supported
@@ -12478,7 +12478,7 @@ F: drivers/scsi/53c700*
1247812478

1247912479
LEAKING_ADDRESSES
1248012480
M: Tycho Andersen <[email protected]>
12481-
R: Kees Cook <keescook@chromium.org>
12481+
R: Kees Cook <kees@kernel.org>
1248212482
1248312483
S: Maintained
1248412484
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@ -12774,7 +12774,7 @@ F: arch/powerpc/platforms/8xx/
1277412774
F: arch/powerpc/platforms/83xx/
1277512775

1277612776
LINUX KERNEL DUMP TEST MODULE (LKDTM)
12777-
M: Kees Cook <keescook@chromium.org>
12777+
M: Kees Cook <kees@kernel.org>
1277812778
S: Maintained
1277912779
F: drivers/misc/lkdtm/*
1278012780
F: tools/testing/selftests/lkdtm/*
@@ -12904,7 +12904,7 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/
1290412904
F: drivers/media/usb/dvb-usb-v2/lmedm04*
1290512905

1290612906
LOADPIN SECURITY MODULE
12907-
M: Kees Cook <keescook@chromium.org>
12907+
M: Kees Cook <kees@kernel.org>
1290812908
S: Supported
1290912909
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
1291012910
F: Documentation/admin-guide/LSM/LoadPin.rst
@@ -17996,7 +17996,7 @@ F: tools/testing/selftests/proc/
1799617996

1799717997
PROC SYSCTL
1799817998
M: Luis Chamberlain <[email protected]>
17999-
M: Kees Cook <keescook@chromium.org>
17999+
M: Kees Cook <kees@kernel.org>
1800018000
M: Joel Granados <[email protected]>
1800118001
1800218002
@@ -18052,7 +18052,7 @@ F: Documentation/devicetree/bindings/net/pse-pd/
1805218052
F: drivers/net/pse-pd/
1805318053

1805418054
PSTORE FILESYSTEM
18055-
M: Kees Cook <keescook@chromium.org>
18055+
M: Kees Cook <kees@kernel.org>
1805618056
R: Tony Luck <[email protected]>
1805718057
R: Guilherme G. Piccoli <[email protected]>
1805818058
@@ -20058,7 +20058,7 @@ F: drivers/media/cec/platform/seco/seco-cec.c
2005820058
F: drivers/media/cec/platform/seco/seco-cec.h
2005920059

2006020060
SECURE COMPUTING
20061-
M: Kees Cook <keescook@chromium.org>
20061+
M: Kees Cook <kees@kernel.org>
2006220062
R: Andy Lutomirski <[email protected]>
2006320063
R: Will Drewry <[email protected]>
2006420064
S: Supported
@@ -22972,7 +22972,7 @@ F: drivers/block/ublk_drv.c
2297222972
F: include/uapi/linux/ublk_cmd.h
2297322973

2297422974
UBSAN
22975-
M: Kees Cook <keescook@chromium.org>
22975+
M: Kees Cook <kees@kernel.org>
2297622976
R: Marco Elver <[email protected]>
2297722977
R: Andrey Konovalov <[email protected]>
2297822978
R: Andrey Ryabinin <[email protected]>
@@ -24810,7 +24810,7 @@ F: drivers/net/hamradio/yam*
2481024810
F: include/linux/yam.h
2481124811

2481224812
YAMA SECURITY MODULE
24813-
M: Kees Cook <keescook@chromium.org>
24813+
M: Kees Cook <kees@kernel.org>
2481424814
S: Supported
2481524815
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
2481624816
F: Documentation/admin-guide/LSM/Yama.rst

drivers/soc/tegra/fuse/fuse-tegra.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ static void tegra_fuse_print_sku_info(struct tegra_sku_info *tegra_sku_info)
127127

128128
static int tegra_fuse_add_lookups(struct tegra_fuse *fuse)
129129
{
130-
fuse->lookups = kmemdup_array(fuse->soc->lookups, sizeof(*fuse->lookups),
131-
fuse->soc->num_lookups, GFP_KERNEL);
130+
fuse->lookups = kmemdup_array(fuse->soc->lookups, fuse->soc->num_lookups,
131+
sizeof(*fuse->lookups), GFP_KERNEL);
132132
if (!fuse->lookups)
133133
return -ENOMEM;
134134

include/linux/string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ extern void *kmemdup_noprof(const void *src, size_t len, gfp_t gfp) __realloc_si
289289

290290
extern void *kvmemdup(const void *src, size_t len, gfp_t gfp) __realloc_size(2);
291291
extern char *kmemdup_nul(const char *s, size_t len, gfp_t gfp);
292-
extern void *kmemdup_array(const void *src, size_t element_size, size_t count, gfp_t gfp)
292+
extern void *kmemdup_array(const void *src, size_t count, size_t element_size, gfp_t gfp)
293293
__realloc_size(2, 3);
294294

295295
/* lib/argv_split.c */

lib/fortify_kunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static const char * const test_strs[] = {
374374
for (i = 0; i < ARRAY_SIZE(test_strs); i++) { \
375375
len = strlen(test_strs[i]); \
376376
KUNIT_EXPECT_EQ(test, __builtin_constant_p(len), 0); \
377-
checker(len, kmemdup_array(test_strs[i], len, 1, gfp), \
377+
checker(len, kmemdup_array(test_strs[i], 1, len, gfp), \
378378
kfree(p)); \
379379
checker(len, kmemdup(test_strs[i], len, gfp), \
380380
kfree(p)); \

lib/overflow_kunit.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,14 +1178,28 @@ struct foo {
11781178
s16 array[] __counted_by(counter);
11791179
};
11801180

1181+
struct bar {
1182+
int a;
1183+
u32 counter;
1184+
s16 array[];
1185+
};
1186+
11811187
static void DEFINE_FLEX_test(struct kunit *test)
11821188
{
1183-
DEFINE_RAW_FLEX(struct foo, two, array, 2);
1189+
/* Using _RAW_ on a __counted_by struct will initialize "counter" to zero */
1190+
DEFINE_RAW_FLEX(struct foo, two_but_zero, array, 2);
1191+
#if __has_attribute(__counted_by__)
1192+
int expected_raw_size = sizeof(struct foo);
1193+
#else
1194+
int expected_raw_size = sizeof(struct foo) + 2 * sizeof(s16);
1195+
#endif
1196+
/* Without annotation, it will always be on-stack size. */
1197+
DEFINE_RAW_FLEX(struct bar, two, array, 2);
11841198
DEFINE_FLEX(struct foo, eight, array, counter, 8);
11851199
DEFINE_FLEX(struct foo, empty, array, counter, 0);
11861200

1187-
KUNIT_EXPECT_EQ(test, __struct_size(two),
1188-
sizeof(struct foo) + sizeof(s16) + sizeof(s16));
1201+
KUNIT_EXPECT_EQ(test, __struct_size(two_but_zero), expected_raw_size);
1202+
KUNIT_EXPECT_EQ(test, __struct_size(two), sizeof(struct bar) + 2 * sizeof(s16));
11891203
KUNIT_EXPECT_EQ(test, __struct_size(eight), 24);
11901204
KUNIT_EXPECT_EQ(test, __struct_size(empty), sizeof(struct foo));
11911205
}

mm/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ EXPORT_SYMBOL(kmemdup_noprof);
139139
* kmemdup_array - duplicate a given array.
140140
*
141141
* @src: array to duplicate.
142-
* @element_size: size of each element of array.
143142
* @count: number of elements to duplicate from array.
143+
* @element_size: size of each element of array.
144144
* @gfp: GFP mask to use.
145145
*
146146
* Return: duplicated array of @src or %NULL in case of error,
147147
* result is physically contiguous. Use kfree() to free.
148148
*/
149-
void *kmemdup_array(const void *src, size_t element_size, size_t count, gfp_t gfp)
149+
void *kmemdup_array(const void *src, size_t count, size_t element_size, gfp_t gfp)
150150
{
151151
return kmemdup(src, size_mul(element_size, count), gfp);
152152
}

security/yama/yama_lsm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void report_access(const char *access, struct task_struct *target,
111111

112112
/**
113113
* yama_relation_cleanup - remove invalid entries from the relation list
114+
* @work: unused
114115
*
115116
*/
116117
static void yama_relation_cleanup(struct work_struct *work)

0 commit comments

Comments
 (0)