Re: [RFC PATCH 1/5] dt-bindings: mediatek,dpi: Add mt8195 dpintf

2021-08-18 Thread Markus Schneider-Pargmann
Hi, On Wed, Aug 18, 2021 at 12:45:46PM +0800, CK Hu wrote: > Hi, Markus: > > On Mon, 2021-08-16 at 21:25 +0200, Markus Schneider-Pargmann wrote: > > DP_INTF is similar to the actual dpi. They differ in some points > > regarding registers and what needs to be set but the function blocks > >

Re: [RFC PATCH 2/5] drm/mediatek: dpi: Add dpintf support

2021-08-18 Thread Markus Schneider-Pargmann
Hi, On Tue, Aug 17, 2021 at 05:50:44PM +0800, CK Hu wrote: > Hi, Markus: > > On Mon, 2021-08-16 at 21:25 +0200, Markus Schneider-Pargmann wrote: > > dpintf is the displayport interface hardware unit. This unit is similar > > to dpi and can reuse most of the code. > > > > This patch adds support

Re: [PATCH v2 44/63] mac80211: Use memset_after() to clear tx status

2021-08-18 Thread Johannes Berg
On Tue, 2021-08-17 at 23:05 -0700, Kees Cook wrote: > > @@ -275,12 +275,11 @@ static void carl9170_tx_release(struct kref *ref) >   if (WARN_ON_ONCE(!ar)) >   return; >   > > > > - BUILD_BUG_ON( > - offsetof(struct ieee80211_tx_info, status.ack_signal) != 20); > - >

Re: [PATCH v2 49/63] btrfs: Use memset_startat() to clear end of struct

2021-08-18 Thread Nikolay Borisov
On 18.08.21 г. 9:05, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memset(), avoid intentionally writing across > neighboring fields. > > Use memset_startat() so memset() doesn't get confused about writing > beyond the

Re: [PATCH v8 21/34] mtd: rawnand: tegra: Add runtime PM and OPP support

2021-08-18 Thread Miquel Raynal
Hi Dmitry, Dmitry Osipenko wrote on Tue, 17 Aug 2021 04:27:41 +0300: > The NAND on Tegra belongs to the core power domain and we're going to > enable GENPD support for the core domain. Now NAND must be resumed using > runtime PM API in order to initialize the NAND power state. Add runtime PM >

Re: [PATCH 5.4.y 0/2] 5.4.y missing upstream commits 7beb691f and 51f644b4, causing: WARNING in vkms_vblank_simulate

2021-08-18 Thread George Kennedy
Hello Thomas, I sent this backport request to sta...@vger.kernel.org a while ago including the maintainers, but mistakenly did not CC you. Sorry about that. Can you please review this backport request for 5.4.y? Greg is waiting to hear from the maintainers before accepting the backport

Re: [PATCH v2 61/63] powerpc: Split memset() to avoid multi-field overflow

2021-08-18 Thread Christophe Leroy
Le 18/08/2021 à 08:05, Kees Cook a écrit : In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Instead of writing across a field boundary with memset(), move the call to just the

Re: [PATCH v8 01/34] opp: Add dev_pm_opp_sync() helper

2021-08-18 Thread Viresh Kumar
On 18-08-21, 09:22, Dmitry Osipenko wrote: > 18.08.2021 08:58, Viresh Kumar пишет: > > What about calling dev_pm_opp_set_rate(dev, clk_get_rate(dev)) here > > instead ? That will work, right ? The advantage is it works without > > any special routine to do so. > > It will work, but a dedicated

Re: [PATCH v2 59/63] can: flexcan: Use struct_group() to zero struct flexcan_regs regions

2021-08-18 Thread Marc Kleine-Budde
On 17.08.2021 23:05:29, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memset(), avoid intentionally writing across > neighboring fields. > > Add struct_group() to mark both regions of struct flexcan_regs that get >

[PATCH v2 32/63] fortify: Add compile-time FORTIFY_SOURCE tests

2021-08-18 Thread Kees Cook
While the run-time testing of FORTIFY_SOURCE is already present in LKDTM, there is no testing of the expected compile-time detections. In preparation for correctly supporting FORTIFY_SOURCE under Clang, adding additional FORTIFY_SOURCE defenses, and making sure FORTIFY_SOURCE doesn't silently

[PATCH v2 21/63] net/mlx5e: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct vlan_ethhdr around members h_dest and h_source, so they can be referenced

[PATCH v2 57/63] powerpc/signal32: Use struct_group() to zero spe regs

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add a struct_group() for the spe registers so that memset() can correctly reason about the size: In function 'fortify_memset_chk',

[PATCH v2 22/63] HID: cp2112: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct cp2112_string_report around members report, length, type, and string, so they can

[PATCH v2 45/63] ath11k: Use memset_startat() for clearing queue descriptors

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 33/63] lib: Introduce CONFIG_TEST_MEMCPY

2021-08-18 Thread Kees Cook
Before changing anything about memcpy(), memmove(), and memset(), add run-time tests to check basic behaviors for any regressions. Signed-off-by: Kees Cook --- lib/Kconfig.debug | 7 ++ lib/Makefile | 1 + lib/test_memcpy.c | 264 ++ 3 files

[PATCH v2 58/63] ethtool: stats: Use struct_group() to clear all stats at once

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct stats_reply_data that should be initialized, which can now be done in a single memset()

[PATCH v2 55/63] HID: roccat: Use struct_group() to zero kone_mouse_event

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct kone_mouse_event that should be initialized to zero. Cc: Stefan Achatz Cc: Jiri Kosina

[PATCH v2 52/63] cm4000_cs: Use struct_group() to zero struct cm4000_dev region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct cm4000_dev that should be initialized to zero. Cc: Harald Welte Cc: Arnd Bergmann Cc:

[PATCH v2 54/63] dm integrity: Use struct_group() to zero struct journal_sector

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct journal_sector that should be initialized to zero. Cc: Alasdair Kergon Cc: Mike Snitzer

[PATCH v2 49/63] btrfs: Use memset_startat() to clear end of struct

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

Re: [PATCH v8 01/34] opp: Add dev_pm_opp_sync() helper

2021-08-18 Thread Dmitry Osipenko
18.08.2021 08:58, Viresh Kumar пишет: > On 18-08-21, 08:21, Dmitry Osipenko wrote: >> Yes, GENPD will cache the perf state across suspend/resume and initially >> cached value is out of sync with h/w. >> >> Nothing else. But let me clarify it all again. > > Thanks for your explanation. > >>

[PATCH v2 50/63] tracing: Use memset_startat() to zero struct trace_iterator

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() to avoid confusing memset() about writing beyond the target struct member. Cc: Steven Rostedt Cc: Ingo Molnar

[PATCH v2 25/63] compiler_types.h: Remove __compiletime_object_size()

2021-08-18 Thread Kees Cook
Since all compilers support __builtin_object_size(), and there is only one user of __compiletime_object_size, remove it to avoid the needless indirection. This lets Clang reason about check_copy_size() correctly. Link: https://github.com/ClangBuiltLinux/linux/issues/1179 Suggested-by: Nick

[PATCH v2 26/63] lib/string: Move helper functions out of string.c

2021-08-18 Thread Kees Cook
The core functions of string.c are those that may be implemented by per-architecture functions, or overloaded by FORTIFY_SOURCE. As a result, it needs to be built with __NO_FORTIFY. Without this, macros will collide with function declarations. This was accidentally working due to -ffreestanding

[PATCH v2 20/63] drm/mga/mga_ioc32: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct drm32_mga_init around members chipset, sgram, maccess, fb_cpp, front_offset,

[PATCH v2 38/63] xfrm: Use memset_after() to clear padding

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Clear trailing padding bytes using the new helper so that memset() doesn't get confused about writing "past the end" of the last struct

[PATCH v2 43/63] net: qede: Use memset_startat() for counters

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 41/63] net: 802: Use memset_startat() to clear struct fields

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 15/63] intersil: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct hfa384x_tx_frame around members frame_control, duration_id, addr1, addr2, addr3,

[PATCH v2 56/63] RDMA/mlx5: Use struct_group() to zero struct mlx5_ib_mr

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct mlx5_ib_mr that should be initialized to zero. Cc: Leon Romanovsky Cc: Doug Ledford Cc:

[PATCH v2 17/63] bnx2x: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct nig_stats around members egress_mac_pkt0_lo, egress_mac_pkt0_hi,

[PATCH v2 51/63] drbd: Use struct_group() to zero algs

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add a struct_group() for the algs so that memset() can correctly reason about the size. Cc: Philipp Reisner Cc: Lars Ellenberg Cc:

[PATCH v2 16/63] cxgb4: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct fw_eth_tx_pkt_vm_wr around members ethmacdst, ethmacsrc, ethtype, and vlantci, so

[PATCH v2 27/63] fortify: Move remaining fortify helpers into fortify-string.h

2021-08-18 Thread Kees Cook
When commit a28a6e860c6c ("string.h: move fortified functions definitions in a dedicated header.") moved the fortify-specific code, some helpers were left behind. Moves the remaining fortify-specific helpers into fortify-string.h so they're together where they're used. This requires that any

[PATCH v2 18/63] drm/amd/pm: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in structs: struct atom_smc_dpm_info_v4_5 struct atom_smc_dpm_info_v4_6

[PATCH v2 44/63] mac80211: Use memset_after() to clear tx status

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_after() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 48/63] IB/mthca: Use memset_startat() for clearing mpt_entry

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 39/63] ipv6: Use memset_after() to zero rt6_info

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_after() to clear everything after the dst_entry member of struct rt6_info. Cc: "David S. Miller" Cc: Hideaki YOSHIFUJI

[PATCH v2 46/63] iw_cxgb4: Use memset_startat() for cpl_t5_pass_accept_rpl

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 40/63] netfilter: conntrack: Use memset_startat() to zero struct nf_conn

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() to avoid confusing memset() about writing beyond the target struct member. Cc: Pablo Neira Ayuso Cc: Jozsef

[PATCH v2 19/63] staging: wlan-ng: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct hfa384x_tx_frame around members frame_control, duration_id, address[1-4], and

[PATCH v2 53/63] KVM: x86: Use struct_group() to zero decode cache

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct x86_emulate_ctxt that should be initialized to zero. Cc: Paolo Bonzini Cc: Sean

[PATCH v2 61/63] powerpc: Split memset() to avoid multi-field overflow

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Instead of writing across a field boundary with memset(), move the call to just the array, and an explicit zeroing of the prior field.

[PATCH v2 35/63] fortify: Detect struct member overflows in memmove() at compile-time

2021-08-18 Thread Kees Cook
As done for memcpy(), also update memmove() to use the same tightened compile-time checks under CONFIG_FORTIFY_SOURCE. Signed-off-by: Kees Cook --- arch/x86/boot/compressed/misc.c | 3 ++- arch/x86/lib/memcpy_32.c | 1 + include/linux/fortify-string.h

[PATCH v2 08/63] bnxt_en: Use struct_group_attr() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() around members queue_id, min_bw, max_bw, tsa, pri_lvl, and bw_weight so they can be

[PATCH v2 01/63] ipw2x00: Avoid field-overflowing memcpy()

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. libipw_read_qos_param_element() copies a struct libipw_info_element into a struct

[PATCH v2 62/63] fortify: Detect struct member overflows in memset() at compile-time

2021-08-18 Thread Kees Cook
As done for memcpy(), also update memset() to use the same tightened compile-time bounds checking under CONFIG_FORTIFY_SOURCE. Signed-off-by: Kees Cook --- include/linux/fortify-string.h| 54 --- .../write_overflow_field-memset.c | 5 ++ 2 files

[PATCH v2 03/63] rpmsg: glink: Replace strncpy() with strscpy_pad()

2021-08-18 Thread Kees Cook
The use of strncpy() is considered deprecated for NUL-terminated strings[1]. Replace strncpy() with strscpy_pad() (as it seems this case expects the NUL padding to fill the allocation following the flexible array). This additionally silences a warning seen when building under -Warray-bounds:

[PATCH v2 02/63] net/mlx5e: Avoid field-overflowing memcpy()

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use flexible arrays instead of zero-element arrays (which look like they are always overflowing) and split the

[PATCH v2 14/63] cxgb3: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct rss_hdr around members imm_data and intr_gen, so they can be referenced together.

[PATCH v2 30/63] fortify: Prepare to improve strnlen() and strlen() warnings

2021-08-18 Thread Kees Cook
In order to have strlen() use fortified strnlen() internally, swap their positions in the source. Doing this as part of later changes makes review difficult, so reoroder it here; no code changes. Cc: Francis Laniel Signed-off-by: Kees Cook --- include/linux/fortify-string.h | 22

[PATCH v2 60/63] net/af_iucv: Use struct_group() to zero struct iucv_sock region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark the region of struct iucv_sock that gets initialized to zero. Avoid the future warning: In function

[PATCH v2 10/63] libertas: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct txpd around members tx_dest_addr_high and tx_dest_addr_low so they can be

[PATCH v2 07/63] skbuff: Switch structure bounds to struct_group()

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Replace the existing empty member position markers "headers_start" and "headers_end" with a struct_group().

[PATCH v2 04/63] pcmcia: ray_cs: Split memcpy() to avoid bounds check warning

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Split memcpy() for each address range to help memcpy() correctly reason about the bounds checking. Avoids the

[PATCH v2 63/63] fortify: Work around Clang inlining bugs

2021-08-18 Thread Kees Cook
To enable FORTIFY_SOURCE support for Clang, the kernel must work around a pair of bugs, related to Clang's inlining. Change all the fortified APIs into macros with different inline names to bypass Clang's broken inline-of-a-builtin detection: https://bugs.llvm.org/show_bug.cgi?id=50322 Lift all

[PATCH v2 00/63] Introduce strict memcpy() bounds checking

2021-08-18 Thread Kees Cook
Hi, This patch series (based on next-20210816) implements stricter (no struct member overflows) bounds checking for memcpy(), memmove(), and memset() under CONFIG_FORTIFY_SOURCE. To quote a later patch in the series: tl;dr: In order to eliminate a large class of common buffer overflow

[PATCH v2 34/63] fortify: Detect struct member overflows in memcpy() at compile-time

2021-08-18 Thread Kees Cook
memcpy() is dead; long live memcpy() tl;dr: In order to eliminate a large class of common buffer overflow flaws that continue to persist in the kernel, have memcpy() (under CONFIG_FORTIFY_SOURCE) perform bounds checking of the destination struct member when they have a known size. This would have

[PATCH v2 05/63] stddef: Introduce struct_group() helper macro

2021-08-18 Thread Kees Cook
Kernel code has a regular need to describe groups of members within a structure usually when they need to be copied or initialized separately from the rest of the surrounding structure. The generally accepted design pattern in C is to use a named sub-struct: struct foo {

[PATCH v2 42/63] net: dccp: Use memset_startat() for TP zeroing

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 36/63] scsi: ibmvscsi: Avoid multi-field memset() overflow by aiming at srp

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Instead of writing beyond the end of evt_struct->iu.srp.cmd, target the upper union (evt_struct->iu.srp) instead, as that's what is

[PATCH v2 31/63] fortify: Allow strlen() and strnlen() to pass compile-time known lengths

2021-08-18 Thread Kees Cook
Under CONFIG_FORTIFY_SOURCE, it is possible for the compiler to perform strlen() and strnlen() at compile-time when the string size is known. This is required to support compile-time overflow checking in strlcpy(). Signed-off-by: Kees Cook --- include/linux/fortify-string.h | 47

[PATCH v2 23/63] media: omap3isp: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Wrap the target region in struct_group(). This additionally fixes a theoretical misalignment of the copy (since

[PATCH v2 47/63] intel_th: msu: Use memset_startat() for clearing hw header

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting

[PATCH v2 28/63] fortify: Explicitly disable Clang support

2021-08-18 Thread Kees Cook
Clang has never correctly compiled the FORTIFY_SOURCE defenses due to a couple bugs: Eliding inlines with matching __builtin_* names https://bugs.llvm.org/show_bug.cgi?id=50322 Incorrect __builtin_constant_p() of some globals

[PATCH v2 59/63] can: flexcan: Use struct_group() to zero struct flexcan_regs regions

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark both regions of struct flexcan_regs that get initialized to zero. Avoid the future warnings: In function

[PATCH v2 12/63] thermal: intel: int340x_thermal: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), avoid intentionally writing across neighboring fields. Use struct_group() in struct art around members weight, and ac[0-9]_max, so they can be referenced together. This will allow memcpy()

[PATCH v2 11/63] libertas_tf: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field array bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct txpd around members tx_dest_addr_high and tx_dest_addr_low so they can be

[PATCH v2 09/63] mwl8k: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct mwl8k_cmd_set_key around members key_material, tkip_tx_mic_key, and

[PATCH v2 37/63] string.h: Introduce memset_after() for wiping trailing members/padding

2021-08-18 Thread Kees Cook
A common idiom in kernel code is to wipe the contents of a structure after a given member. This is especially useful in places where there is trailing padding. These open-coded cases are usually difficult to read and very sensitive to struct layout changes. Introduce a new helper, memset_after()

[PATCH v2 29/63] fortify: Fix dropped strcpy() compile-time write overflow check

2021-08-18 Thread Kees Cook
The implementation for intra-object overflow in str*-family functions accidentally dropped compile-time write overflow checking in strcpy(), leaving it entirely to run-time. Add back the intended check. Fixes: 6a39e62abbaf ("lib: string.h: detect intra-object overflow in fortified string

[PATCH v2 13/63] iommu/amd: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct ivhd_entry around members ext and hidh, so they can be referenced together. This

[PATCH v2 24/63] sata_fsl: Use struct_group() for memcpy() region

2021-08-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct command_desc around members acmd and fill, so they can be referenced together.

[PATCH v2 06/63] cxl/core: Replace unions with struct_group()

2021-08-18 Thread Kees Cook
Use the newly introduced struct_group_typed() macro to clean up the declaration of struct cxl_regs. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky Cc: linux-...@vger.kernel.org Suggested-by: Dan Williams Link:

Re: [PATCH v8 01/34] opp: Add dev_pm_opp_sync() helper

2021-08-18 Thread Viresh Kumar
On 18-08-21, 11:28, Viresh Kumar wrote: > On 18-08-21, 08:21, Dmitry Osipenko wrote: > > Yes, GENPD will cache the perf state across suspend/resume and initially > > cached value is out of sync with h/w. > > > > Nothing else. But let me clarify it all again. > > Thanks for your explanation. > >

<    1   2   3