Revision 14d6d86c210aea1a83c19a8f6391ecabcbefed94 authored by Alexei Starovoitov on 19 November 2020, 18:45:55 UTC, committed by Alexei Starovoitov on 19 November 2020, 19:58:15 UTC
Daniel Xu says: ==================== 6ae08ae3dea2 ("bpf: Add probe_read_{user, kernel} and probe_read_{user, kernel}_str helpers") introduced a subtle bug where bpf_probe_read_user_str() would potentially copy a few extra bytes after the NUL terminator. This issue is particularly nefarious when strings are used as map keys, as seemingly identical strings can occupy multiple entries in a map. This patchset fixes the issue and introduces a selftest to prevent future regressions. v6 -> v7: * Add comments v5 -> v6: * zero-pad up to sizeof(unsigned long) after NUL v4 -> v5: * don't read potentially uninitialized memory v3 -> v4: * directly pass userspace pointer to prog * test more strings of different length v2 -> v3: * set pid filter before attaching prog in selftest * use long instead of int as bpf_probe_read_user_str() retval * style changes v1 -> v2: * add Fixes: tag * add selftest ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
File | Mode | Size |
---|---|---|
adi | ||
amd | ||
atmel | ||
au1x | ||
bcm | ||
cirrus | ||
codecs | ||
dwc | ||
fsl | ||
generic | ||
hisilicon | ||
img | ||
intel | ||
jz4740 | ||
kirkwood | ||
mediatek | ||
meson | ||
mxs | ||
pxa | ||
qcom | ||
rockchip | ||
samsung | ||
sh | ||
sirf | ||
sof | ||
spear | ||
sprd | ||
sti | ||
stm | ||
sunxi | ||
tegra | ||
ti | ||
txx9 | ||
uniphier | ||
ux500 | ||
xilinx | ||
xtensa | ||
zte | ||
Kconfig | -rw-r--r-- | 2.2 KB |
Makefile | -rw-r--r-- | 1.8 KB |
soc-ac97.c | -rw-r--r-- | 10.6 KB |
soc-acpi.c | -rw-r--r-- | 2.5 KB |
soc-card.c | -rw-r--r-- | 4.8 KB |
soc-component.c | -rw-r--r-- | 23.4 KB |
soc-compress.c | -rw-r--r-- | 22.1 KB |
soc-core.c | -rw-r--r-- | 76.6 KB |
soc-dai.c | -rw-r--r-- | 17.9 KB |
soc-dapm.c | -rw-r--r-- | 121.6 KB |
soc-devres.c | -rw-r--r-- | 3.9 KB |
soc-generic-dmaengine-pcm.c | -rw-r--r-- | 13.6 KB |
soc-jack.c | -rw-r--r-- | 11.3 KB |
soc-link.c | -rw-r--r-- | 4.5 KB |
soc-ops.c | -rw-r--r-- | 25.0 KB |
soc-pcm.c | -rw-r--r-- | 78.9 KB |
soc-topology.c | -rw-r--r-- | 76.4 KB |
soc-utils.c | -rw-r--r-- | 4.3 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...