Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5c0f220e
Commit
5c0f220e
authored
Feb 02, 2023
by
Kees Cook
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-linus/hardening' into for-next/hardening
parents
5a6b64ad
be0d8f48
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
6 deletions
+27
-6
drivers/firmware/google/coreboot_table.c
drivers/firmware/google/coreboot_table.c
+7
-2
drivers/firmware/google/coreboot_table.h
drivers/firmware/google/coreboot_table.h
+1
-0
drivers/md/bcache/bcache_ondisk.h
drivers/md/bcache/bcache_ondisk.h
+2
-1
drivers/md/bcache/journal.c
drivers/md/bcache/journal.c
+2
-1
init/Makefile
init/Makefile
+1
-0
lib/Kconfig.debug
lib/Kconfig.debug
+9
-0
lib/memcpy_kunit.c
lib/memcpy_kunit.c
+2
-0
scripts/Makefile.vmlinux
scripts/Makefile.vmlinux
+1
-0
scripts/gcc-plugins/gcc-common.h
scripts/gcc-plugins/gcc-common.h
+2
-2
No files found.
drivers/firmware/google/coreboot_table.c
View file @
5c0f220e
...
@@ -93,14 +93,19 @@ static int coreboot_table_populate(struct device *dev, void *ptr)
...
@@ -93,14 +93,19 @@ static int coreboot_table_populate(struct device *dev, void *ptr)
for
(
i
=
0
;
i
<
header
->
table_entries
;
i
++
)
{
for
(
i
=
0
;
i
<
header
->
table_entries
;
i
++
)
{
entry
=
ptr_entry
;
entry
=
ptr_entry
;
device
=
kzalloc
(
sizeof
(
struct
device
)
+
entry
->
size
,
GFP_KERNEL
);
if
(
entry
->
size
<
sizeof
(
*
entry
))
{
dev_warn
(
dev
,
"coreboot table entry too small!
\n
"
);
return
-
EINVAL
;
}
device
=
kzalloc
(
sizeof
(
device
->
dev
)
+
entry
->
size
,
GFP_KERNEL
);
if
(
!
device
)
if
(
!
device
)
return
-
ENOMEM
;
return
-
ENOMEM
;
device
->
dev
.
parent
=
dev
;
device
->
dev
.
parent
=
dev
;
device
->
dev
.
bus
=
&
coreboot_bus_type
;
device
->
dev
.
bus
=
&
coreboot_bus_type
;
device
->
dev
.
release
=
coreboot_device_release
;
device
->
dev
.
release
=
coreboot_device_release
;
memcpy
(
&
device
->
entry
,
ptr_entry
,
entry
->
size
);
memcpy
(
device
->
raw
,
ptr_entry
,
entry
->
size
);
switch
(
device
->
entry
.
tag
)
{
switch
(
device
->
entry
.
tag
)
{
case
LB_TAG_CBMEM_ENTRY
:
case
LB_TAG_CBMEM_ENTRY
:
...
...
drivers/firmware/google/coreboot_table.h
View file @
5c0f220e
...
@@ -79,6 +79,7 @@ struct coreboot_device {
...
@@ -79,6 +79,7 @@ struct coreboot_device {
struct
lb_cbmem_ref
cbmem_ref
;
struct
lb_cbmem_ref
cbmem_ref
;
struct
lb_cbmem_entry
cbmem_entry
;
struct
lb_cbmem_entry
cbmem_entry
;
struct
lb_framebuffer
framebuffer
;
struct
lb_framebuffer
framebuffer
;
DECLARE_FLEX_ARRAY
(
u8
,
raw
);
};
};
};
};
...
...
drivers/md/bcache/bcache_ondisk.h
View file @
5c0f220e
...
@@ -106,7 +106,8 @@ static inline unsigned long bkey_bytes(const struct bkey *k)
...
@@ -106,7 +106,8 @@ static inline unsigned long bkey_bytes(const struct bkey *k)
return
bkey_u64s
(
k
)
*
sizeof
(
__u64
);
return
bkey_u64s
(
k
)
*
sizeof
(
__u64
);
}
}
#define bkey_copy(_dest, _src) memcpy(_dest, _src, bkey_bytes(_src))
#define bkey_copy(_dest, _src) unsafe_memcpy(_dest, _src, bkey_bytes(_src), \
/* bkey is always padded */
)
static
inline
void
bkey_copy_key
(
struct
bkey
*
dest
,
const
struct
bkey
*
src
)
static
inline
void
bkey_copy_key
(
struct
bkey
*
dest
,
const
struct
bkey
*
src
)
{
{
...
...
drivers/md/bcache/journal.c
View file @
5c0f220e
...
@@ -149,7 +149,8 @@ reread: left = ca->sb.bucket_size - offset;
...
@@ -149,7 +149,8 @@ reread: left = ca->sb.bucket_size - offset;
bytes
,
GFP_KERNEL
);
bytes
,
GFP_KERNEL
);
if
(
!
i
)
if
(
!
i
)
return
-
ENOMEM
;
return
-
ENOMEM
;
memcpy
(
&
i
->
j
,
j
,
bytes
);
unsafe_memcpy
(
&
i
->
j
,
j
,
bytes
,
/* "bytes" was calculated by set_bytes() above */
);
/* Add to the location after 'where' points to */
/* Add to the location after 'where' points to */
list_add
(
&
i
->
list
,
where
);
list_add
(
&
i
->
list
,
where
);
ret
=
1
;
ret
=
1
;
...
...
init/Makefile
View file @
5c0f220e
...
@@ -59,3 +59,4 @@ include/generated/utsversion.h: FORCE
...
@@ -59,3 +59,4 @@ include/generated/utsversion.h: FORCE
$(obj)/version-timestamp.o
:
include/generated/utsversion.h
$(obj)/version-timestamp.o
:
include/generated/utsversion.h
CFLAGS_version-timestamp.o
:=
-include
include/generated/utsversion.h
CFLAGS_version-timestamp.o
:=
-include
include/generated/utsversion.h
KASAN_SANITIZE_version-timestamp.o
:=
n
lib/Kconfig.debug
View file @
5c0f220e
...
@@ -2566,6 +2566,15 @@ config MEMCPY_KUNIT_TEST
...
@@ -2566,6 +2566,15 @@ config MEMCPY_KUNIT_TEST
If unsure, say N.
If unsure, say N.
config MEMCPY_SLOW_KUNIT_TEST
bool "Include exhaustive memcpy tests"
depends on MEMCPY_KUNIT_TEST
default y
help
Some memcpy tests are quite exhaustive in checking for overlaps
and bit ranges. These can be very slow, so they are split out
as a separate config, in case they need to be disabled.
config IS_SIGNED_TYPE_KUNIT_TEST
config IS_SIGNED_TYPE_KUNIT_TEST
tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS
tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS
depends on KUNIT
depends on KUNIT
...
...
lib/memcpy_kunit.c
View file @
5c0f220e
...
@@ -309,6 +309,8 @@ static void set_random_nonzero(struct kunit *test, u8 *byte)
...
@@ -309,6 +309,8 @@ static void set_random_nonzero(struct kunit *test, u8 *byte)
static
void
init_large
(
struct
kunit
*
test
)
static
void
init_large
(
struct
kunit
*
test
)
{
{
if
(
!
IS_ENABLED
(
CONFIG_MEMCPY_SLOW_KUNIT_TEST
))
kunit_skip
(
test
,
"Slow test skipped. Enable with CONFIG_MEMCPY_SLOW_KUNIT_TEST=y"
);
/* Get many bit patterns. */
/* Get many bit patterns. */
get_random_bytes
(
large_src
,
ARRAY_SIZE
(
large_src
));
get_random_bytes
(
large_src
,
ARRAY_SIZE
(
large_src
));
...
...
scripts/Makefile.vmlinux
View file @
5c0f220e
...
@@ -18,6 +18,7 @@ quiet_cmd_cc_o_c = CC $@
...
@@ -18,6 +18,7 @@ quiet_cmd_cc_o_c = CC $@
$(
call
if_changed_dep,cc_o_c
)
$(
call
if_changed_dep,cc_o_c
)
ifdef
CONFIG_MODULES
ifdef
CONFIG_MODULES
KASAN_SANITIZE_.vmlinux.export.o
:=
n
targets
+=
.vmlinux.export.o
targets
+=
.vmlinux.export.o
vmlinux
:
.vmlinux.export.o
vmlinux
:
.vmlinux.export.o
endif
endif
...
...
scripts/gcc-plugins/gcc-common.h
View file @
5c0f220e
...
@@ -71,7 +71,9 @@
...
@@ -71,7 +71,9 @@
#include "varasm.h"
#include "varasm.h"
#include "stor-layout.h"
#include "stor-layout.h"
#include "internal-fn.h"
#include "internal-fn.h"
#include "gimple.h"
#include "gimple-expr.h"
#include "gimple-expr.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimple-fold.h"
#include "context.h"
#include "context.h"
#include "tree-ssa-alias.h"
#include "tree-ssa-alias.h"
...
@@ -85,10 +87,8 @@
...
@@ -85,10 +87,8 @@
#include "tree-eh.h"
#include "tree-eh.h"
#include "stmt.h"
#include "stmt.h"
#include "gimplify.h"
#include "gimplify.h"
#include "gimple.h"
#include "tree-phinodes.h"
#include "tree-phinodes.h"
#include "tree-cfg.h"
#include "tree-cfg.h"
#include "gimple-iterator.h"
#include "gimple-ssa.h"
#include "gimple-ssa.h"
#include "ssa-iterators.h"
#include "ssa-iterators.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment