On 10/12/2023 12:05 PM, Dan Carpenter wrote:
> On Thu, Oct 12, 2023 at 10:45:03AM +0530, Vasant Hegde wrote:
>>
>>
>> On 10/12/2023 10:20 AM, Lukas Bulwahn wrote:
>>> Commit 5a0b11a180a9 ("iommu/amd: Remove iommu_v2 module") removes the
>>> config AMD_IOMMU_V2.
>>>
>>> Remove the reference to th
On Thu, Oct 12, 2023 at 10:45:03AM +0530, Vasant Hegde wrote:
>
>
> On 10/12/2023 10:20 AM, Lukas Bulwahn wrote:
> > Commit 5a0b11a180a9 ("iommu/amd: Remove iommu_v2 module") removes the
> > config AMD_IOMMU_V2.
> >
> > Remove the reference to this config in the x86 architecture-specific
> > har
On 10/12/2023 10:20 AM, Lukas Bulwahn wrote:
> Commit 5a0b11a180a9 ("iommu/amd: Remove iommu_v2 module") removes the
> config AMD_IOMMU_V2.
>
> Remove the reference to this config in the x86 architecture-specific
> hardening config fragment as well.
>
> Signed-off-by: Lukas Bulwahn
> ---
> Jo
Commit 5a0b11a180a9 ("iommu/amd: Remove iommu_v2 module") removes the
config AMD_IOMMU_V2.
Remove the reference to this config in the x86 architecture-specific
hardening config fragment as well.
Signed-off-by: Lukas Bulwahn
---
Joerg, please pick this patch on top of the commit above. Thanks.
In order to gain the bounds-checking coverage that __counted_by provides
to flexible-array members at run-time via CONFIG_UBSAN_BOUNDS (for array
indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions),
we must make sure that the counter member, in this particular case `num`,
is up
`struct clk_hw_onecell_data` is a flexible structure, which means that
it contains flexible-array member at the bottom, in this case array
`hws`:
include/linux/clk-provider.h:
1380 struct clk_hw_onecell_data {
1381 unsigned int num;
1382 struct clk_hw *hws[] __counted_by(num);
1383
This small series aims to fix an undefined behavior bug in
`struct visconti_pll_provider` and add bounds-checking
coverage at run-time for flexible-array member `hws`
in `struct clk_hw_onecell_data` when accessed throught
`struct visconti_pll_provider`.
Gustavo A. R. Silva (2):
clk: visconti: Fi
Fixes: ba7e258425ac ("clk: socfpga: Convert to s10/agilex/n5x to use clk_hw")
Cc: sta...@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva
Nice find!
:D
Reviewed-by: Kees Cook
Thanks!
--
Gustavo
Hence, we need to move the assignments to `clk_data->clk_data.num` after
allocations for `struct stratix10_clock_data` and before accessing the
flexible array `clk_data->clk_data.hws`. And, as assignments for both
`clk_data->clk_data.num` and `clk_data->base` are originally adjacent to
each o
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Mon, 09 Oct 2023 17:45:33 + you wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> bfa_ioc
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Mon, 09 Oct 2023 18:24:20 + you wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> ethtool
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Tue, 10 Oct 2023 21:24:42 + you wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We expe
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Mon, 09 Oct 2023 18:29:19 + you wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> ethtool
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Tue, 10 Oct 2023 21:38:11 + you wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We can
On Wed, Oct 11, 2023 at 09:48:39PM +, Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We expect res->name to be NUL-terminated based on its usage with format
>
On Wed, Oct 11, 2023 at 10:20:10PM +, Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> This patch eliminates three uses of strncpy():
>
> Firstly, `dest` is ex
On Wed, Oct 11, 2023 at 09:53:44PM +, Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> NUL-padding is not needed due to `ident` being memset'd to 0 just before
@ int ionic_identify(struct ionic *ionic)
> > memset(ident, 0, sizeof(*ident));
> >
> > ident->drv.os_type = cpu_to_le32(IONIC_OS_TYPE_LINUX);
> > - strncpy(ident->drv.driver_ver_str, UTS_RELEASE,
> > - sizeof(ident->drv.driver_
uf)[*offset];
- strncpy(dest, source_str, size);
- dest[size - 1] = '\0';
+ strscpy(dest, source_str, size);
*offset += size;
}
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
change-id:
20231011-strncpy-drivers-net-ethernet-qlogic-qed-qed_debug-c-211d594201e4
Best regards,
--
Justin Stitt
ommit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
change-id:
20231011-strncpy-drivers-net-ethernet-pensando-ionic-ionic_main-c-709f8f1ea312
Best regards,
--
Justin Stitt
driver_ver_str, UTS_RELEASE,
+ sizeof(ident->drv.driver_ver_str));
mutex_lock(&ionic->dev_cmd_lock);
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
change-id:
20231011-strncpy-drivers-net-ethernet-pensando-ionic-ionic_main-c-709f8f1ea312
Best regards,
--
Justin Stitt
;
- strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
+ strscpy(res->name, name, sizeof(res->name));
dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
NFP_RESOURCE_TBL_BASE,
---
base-commit: cbf3a2cb156a
On Wed, Oct 11, 2023 at 09:37:18PM +, Justin Stitt wrote:
> strncpy() is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> ethtool_sprintf() is designed specifically for get_strings() usage.
> Let
On Wed, Oct 11, 2023 at 03:35:26PM -0600, Gustavo A. R. Silva wrote:
> In order to gain the bounds-checking coverage that __counted_by provides
> to flexible-array members at run-time via CONFIG_UBSAN_BOUNDS (for array
> indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions),
> we
On Wed, Oct 11, 2023 at 03:34:03PM -0600, Gustavo A. R. Silva wrote:
> `struct clk_hw_onecell_data` is a flexible structure, which means that
> it contains flexible-array member at the bottom, in this case array
> `hws`:
>
> include/linux/clk-provider.h:
> 1380 struct clk_hw_onecell_data {
> 1381
>stats_layout[idx]);
}
static void sparx5_get_sset_data(struct net_device *ndev,
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
change-id:
20231011-strncpy-drivers-net-ethernet-microchip-sparx5-sparx5_ethtool-c-793896db6cf4
Best regards,
--
Justin Stitt
In order to gain the bounds-checking coverage that __counted_by provides
to flexible-array members at run-time via CONFIG_UBSAN_BOUNDS (for array
indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions),
we must make sure that the counter member, in this case `num`, is updated
befor
`struct clk_hw_onecell_data` is a flexible structure, which means that
it contains flexible-array member at the bottom, in this case array
`hws`:
include/linux/clk-provider.h:
1380 struct clk_hw_onecell_data {
1381 unsigned int num;
1382 struct clk_hw *hws[] __counted_by(num);
1383
On Wed, Oct 11, 2023 at 09:29:57PM +, Justin Stitt wrote:
> In total, just assigning this version string takes:
> (1) strncpy()'s
> (5) strlen()'s
> (3) strncat()'s
> (1) snprintf()'s
> (4) max_t()'s
>
> Moreover, `strncpy` is deprecated [1] and `strncat` really shouldn't be
> used either [2].
This series aims to fix an undefined behavior bug in
`struct stratix10_clock_data` and add bounds-checking
coverage at run-time for flexible-array member `hws`
in `struct clk_hw_onecell_data` when accessed throught
`struct stratix10_clock_data`.
Gustavo A. R. Silva (2):
clk: socfpga: Fix undefin
On Wed, Oct 11, 2023 at 09:04:37PM +, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We expect `dst` to be NUL-terminated based on its use with format
> strin
ver_ver_sz, "Linux,%s,%u.%u.%u",
+KBUILD_MODNAME, LINUX_VERSION_MAJOR,
+LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL);
/*Send the command*/
MLX5_SET(set_driver_version_in, in, opcode,
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c0
trncpy(dst, DRV_NAME_FOR_FW, INIT_HCA_DRIVER_VERSION_SZ - 1);
+ strscpy(dst, DRV_NAME_FOR_FW, INIT_HCA_DRIVER_VERSION_SZ);
mlx4_dbg(dev, "Reporting Driver Version to FW: %s\n", dst);
}
---
base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2
ch
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz :
On Wed, 11 Oct 2023 09:31:44 -0700 you wrote:
> The code pattern of memcpy(dst, src, strlen(src)) is almost always
> wrong. In this case it is wrong because it leaves memory uninitialized
> if it is
The code pattern of memcpy(dst, src, strlen(src)) is almost always
wrong. In this case it is wrong because it leaves memory uninitialized
if it is less than sizeof(ni->name), and overflows ni->name when longer.
Normally strtomem_pad() could be used here, but since ni->name is a
trailing array in s
On Wed, 2023-10-11 at 18:36:11 +0300, Andy Shevchenko wrote:
> On Wed, Oct 11, 2023 at 2:17 PM Kartik wrote:
> >
> > Introduce function kmemdup_array(), that will copy `n` number of
> > elements from a given array `src` to `dst`.
> >
> > On success, kmemdup_array() returns 0 and copy the elements
On Wed, Oct 11, 2023 at 2:17 PM Kartik wrote:
>
> Introduce function kmemdup_array(), that will copy `n` number of
> elements from a given array `src` to `dst`.
>
> On success, kmemdup_array() returns 0 and copy the elements from `src`
> to newly allocated array `dst`, it also stores number of ele
On Fri, 22 Sep 2023 10:52:07 -0700, Kees Cook wrote:
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
> (for array indexi
On Mon, Oct 9, 2023 at 2:55 PM Gustavo A. R. Silva
wrote:
>
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
> array indexin
On Fri, 22 Sep 2023 10:50:50 -0700, Kees Cook wrote:
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
> (for array indexi
Add support for Tegra241 which use ACPI boot.
Signed-off-by: Kartik
---
v1 -> v2:
* Removed few entries from tegra241_fuse_soc which were
initilized as NULL or 0.
---
drivers/soc/tegra/Kconfig | 5 +
drivers/soc/tegra/fuse/fuse-tegra.c| 5 +
drivers/s
Add ACPI support for Tegra194 & Tegra243 SoC's. This requires
following modifications to the probe when ACPI boot is used:
- Initialize soc data.
- Add nvmem lookups.
- Register soc device.
- use devm_clk_get_optional() instead of devm_clk_get() to get
fuse->clk, as fuse clocks are not requi
Add helper function tegra_fuse_print_sku_info() to print Tegra SKU
information. So, it can be shared between tegra_fuse_init() and
ACPI probe which is to be introduced later.
Signed-off-by: Kartik
---
v1 -> v2:
* Renamed tegra_fuse_pr_sku_info() as
tegra_fuse_print_sku_info().
-
Add helper function tegra_fuse_add_lookups() to register Tegra fuse
nvmem lookups. So, this can be shared between tegra_fuse_init() and
ACPI probe, which is to be introduced later.
Use kmemdup_array to duplicate fuse->soc->lookups.
Signed-off-by: Kartik
---
v3 -> v4:
* Use kmemdup_array
In preparation to ACPI support in Tegra fuse driver add function
tegra_acpi_init_apbmisc() to initialize tegra-apbmisc driver.
Also, document the reason of calling tegra_init_apbmisc() at early init.
Note that function tegra_acpi_init_apbmisc() is not placed in the __init
section, because it will
To prepare for adding ACPI support to the tegra-apbmisc driver,
relocate the code responsible for mapping memory resources from
the function ‘tegra_init_apbmisc’ to the function
‘tegra_init_apbmisc_resources.’ This adjustment will allow the
code to be shared between ‘tegra_init_apbmisc’ and the upc
Currently, in tegra_fuse_probe() if clock/reset get fails, then the
driver prints an error if the error is not caused by -EPROBE_DEFER.
This can be improved by using dev_err_probe() instead.
So, return dev_err_probe() if clock/reset get fails.
Signed-off-by: Kartik
---
drivers/soc/tegra/fuse/fu
Introduce function kmemdup_array(), that will copy `n` number of
elements from a given array `src` to `dst`.
On success, kmemdup_array() returns 0 and copy the elements from `src`
to newly allocated array `dst`, it also stores number of elements
copied from `src` array to `dst_count` parameter. On
This series of patches add ACPI support for Tegra194 and Tegra234 in
Tegra fuse and apbmisc drivers. It also adds support for Tegra241
which uses ACPI boot.
Kartik (8):
mm/util: Introduce kmemdup_array() to duplicate an array
soc/tegra: fuse: Use dev_err_probe for probe failures
soc/tegra: f
"Gustavo A. R. Silva" wrote:
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
> array indexing) and CONFIG_FORTIFY_SOURCE (
"Gustavo A. R. Silva" wrote:
> Prepare for the coming implementation by GCC and Clang of the __counted_by
> attribute. Flexible array members annotated with __counted_by can have
> their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
> array indexing) and CONFIG_FORTIFY_SOURCE (
51 matches
Mail list logo