mirror of https://github.com/torvalds/linux.git
hardening updates for v6.19-rc1
- string: Add missing kernel-doc return descriptions (Kriish Sharma) - Update some mis-typed allocations - Enable GCC diagnostic context for value-tracking warnings -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRSPkdeREjth1dHnSE2KwveOeQkuwUCaS9E5QAKCRA2KwveOeQk u5lYAQDEXFBD3+X+k9LNuPS/FLpz5sEI0SOI4lD8xDEjhtmygAD+LVV8yRf6ajPA 5O2f4hbKnP5+4XHwSiG+CV7QpAgHHwo= =6GEw -----END PGP SIGNATURE----- Merge tag 'hardening-v6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening updates from Kees Cook: - string: Add missing kernel-doc return descriptions (Kriish Sharma) - Update some mis-typed allocations These correct some accidentally wrong types used in allocations (that didn't affect the resulting size) that never got picked up from the batch I sent a few months ago. - Enable GCC diagnostic context for value-tracking warnings This results in better GCC diagnostics for the value range tracking, so we can get better visibility into where those values are coming from when we get out-of-bounds warnings at compile time. * tag 'hardening-v6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: kbuild: Enable GCC diagnostic context for value-tracking warnings string: Add missing kernel-doc return descriptions media: iris: Cast iris_hfi_gen2_get_instance() allocation type drm/plane: Remove const qualifier from plane->modifiers allocation type comedi: Adjust range_table_list allocation type
This commit is contained in:
commit
ed1b409137
3
Makefile
3
Makefile
|
|
@ -940,6 +940,9 @@ KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
|
||||||
# for the randomize_kstack_offset feature. Disable it for all compilers.
|
# for the randomize_kstack_offset feature. Disable it for all compilers.
|
||||||
KBUILD_CFLAGS += $(call cc-option, -fno-stack-clash-protection)
|
KBUILD_CFLAGS += $(call cc-option, -fno-stack-clash-protection)
|
||||||
|
|
||||||
|
# Get details on warnings generated due to GCC value tracking.
|
||||||
|
KBUILD_CFLAGS += $(call cc-option, -fdiagnostics-show-context=2)
|
||||||
|
|
||||||
# Clear used registers at func exit (to reduce data lifetime and ROP gadgets).
|
# Clear used registers at func exit (to reduce data lifetime and ROP gadgets).
|
||||||
ifdef CONFIG_ZERO_CALL_USED_REGS
|
ifdef CONFIG_ZERO_CALL_USED_REGS
|
||||||
KBUILD_CFLAGS += -fzero-call-used-regs=used-gpr
|
KBUILD_CFLAGS += -fzero-call-used-regs=used-gpr
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
|
||||||
const struct comedi_lrange **range_table_list;
|
const struct comedi_lrange **range_table_list;
|
||||||
|
|
||||||
range_table_list = kmalloc_array(32,
|
range_table_list = kmalloc_array(32,
|
||||||
sizeof(struct comedi_lrange *),
|
sizeof(*range_table_list),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!range_table_list)
|
if (!range_table_list)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ static int __drm_universal_plane_init(struct drm_device *dev,
|
||||||
|
|
||||||
plane->modifier_count = format_modifier_count;
|
plane->modifier_count = format_modifier_count;
|
||||||
plane->modifiers = kmalloc_array(format_modifier_count,
|
plane->modifiers = kmalloc_array(format_modifier_count,
|
||||||
sizeof(format_modifiers[0]),
|
sizeof(*plane->modifiers),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
||||||
if (format_modifier_count && !plane->modifiers) {
|
if (format_modifier_count && !plane->modifiers) {
|
||||||
|
|
|
||||||
|
|
@ -1212,5 +1212,5 @@ void iris_hfi_gen2_command_ops_init(struct iris_core *core)
|
||||||
|
|
||||||
struct iris_inst *iris_hfi_gen2_get_instance(void)
|
struct iris_inst *iris_hfi_gen2_get_instance(void)
|
||||||
{
|
{
|
||||||
return kzalloc(sizeof(struct iris_inst_hfi_gen2), GFP_KERNEL);
|
return (struct iris_inst *)kzalloc(sizeof(struct iris_inst_hfi_gen2), GFP_KERNEL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,10 @@ static inline void memzero_explicit(void *s, size_t count)
|
||||||
* kbasename - return the last part of a pathname.
|
* kbasename - return the last part of a pathname.
|
||||||
*
|
*
|
||||||
* @path: path to extract the filename from.
|
* @path: path to extract the filename from.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* Pointer to the filename portion inside @path. If no '/' exists,
|
||||||
|
* returns @path unchanged.
|
||||||
*/
|
*/
|
||||||
static inline const char *kbasename(const char *path)
|
static inline const char *kbasename(const char *path)
|
||||||
{
|
{
|
||||||
|
|
@ -556,6 +560,9 @@ static __always_inline size_t str_has_prefix(const char *str, const char *prefix
|
||||||
* strstarts - does @str start with @prefix?
|
* strstarts - does @str start with @prefix?
|
||||||
* @str: string to examine
|
* @str: string to examine
|
||||||
* @prefix: prefix to look for.
|
* @prefix: prefix to look for.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* True if @str begins with @prefix. False in all other cases.
|
||||||
*/
|
*/
|
||||||
static inline bool strstarts(const char *str, const char *prefix)
|
static inline bool strstarts(const char *str, const char *prefix)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue