This is the 5.10.108 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmI61q4ACgkQONu9yGCS aT7sPg/+IHk8dls5SX0C1/JPhQIQP6Ui0wVwjVz7B+0PgAc7TWuJSLJ5mMIO/ksN 2t05og0USEli2tzJSf+DFJrrg6tfsnNk+Y7v6NUj2dLIdiPzLvQZaBxpWLbNdfbn xD6RMRFK5Uz2Gab3La9VDcBETZzDbnOmytsiZPnCrT8ELmcXWMc1Gt4GbFQRlUDX J0XIjnFIwNZpt7TZxjIoxxnrGZ6McN8/ehMaOJA/n7/dAtCBs/5x/9+fJ25/WAuN BwxGOn5NP8V0HA8Vg/imOfTiopYohzCZNARzcBfJTURGX2fs3eYC/JJlmZ6vsv9J MmfAicCsrdSjDFn2vrBe5M4JmKsceOzUkr4VnmWeN88+kRnC1CKdppiEo7ucnk3M vVdrEThVAWEa+1Q8zx4tp0UJeoqk5c+WM9jxt55BTXtHzCsHgB0WKbANCKQ7ciO4 7GfWLaTDCXMea4H4LwtqoTmapQYzyfHe6KFKeIRcd7zbnmQJJzbMYC61zBQ9ecoQ VXZf4bzttMo4bZXW8d5CL6DFD8bZXjQl9giV76t5Vzw/XEWHFtcrrgrr8jtNZw0F sKS7d7aC5r3WRIOkxQkM3TgNjpA2cNQoLffjV0rDc5IHaMPb1phIh8UpA3Je7brH MK4ldSF93As8qNETvnj4wTSwiadS1icLIFvarSqeNUECpHviSOg= =TV2r -----END PGP SIGNATURE----- Merge 5.10.108 into android12-5.10-lts Changes in 5.10.108 crypto: qcom-rng - ensure buffer for generate is completely filled ocfs2: fix crash when initialize filecheck kobj fails mm: swap: get rid of livelock in swapin readahead efi: fix return value of __setup handlers vsock: each transport cycles only on its own sockets esp6: fix check on ipv6_skip_exthdr's return value net: phy: marvell: Fix invalid comparison in the resume and suspend functions net/packet: fix slab-out-of-bounds access in packet_recvmsg() atm: eni: Add check for dma_map_single hv_netvsc: Add check for kvmalloc_array drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check() drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() net: dsa: Add missing of_node_put() in dsa_port_parse_of net: phy: mscc: Add MODULE_FIRMWARE macros bnx2x: fix built-in kernel driver load failure net: bcmgenet: skip invalid partial checksums net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload arm64: fix clang warning about TRAMP_VALIAS usb: gadget: rndis: prevent integer overflow in rndis_set_response() usb: gadget: Fix use-after-free bug by not setting udc->dev.driver usb: usbtmc: Fix bug in pipe direction for control transfers scsi: mpt3sas: Page fault in reply q processing Input: aiptek - properly check endpoint type perf symbols: Fix symbol size calculation condition net: usb: Correct PHY handling of smsc95xx net: usb: Correct reset handling of smsc95xx smsc95xx: Ignore -ENODEV errors when device is unplugged esp: Fix possible buffer overflow in ESP transformation Revert "selftests/bpf: Add test for bpf_timer overwriting crash" Linux 5.10.108 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I618f4ec34bfcb8c11821276c5105c46d3aace78c
This commit is contained in:
commit
644c989f41
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 107
|
||||
SUBLEVEL = 108
|
||||
EXTRAVERSION =
|
||||
NAME = Dare mighty things
|
||||
|
||||
|
@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors {
|
||||
DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector);
|
||||
|
||||
#ifndef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||
#define TRAMP_VALIAS 0
|
||||
#define TRAMP_VALIAS 0ul
|
||||
#endif
|
||||
|
||||
static inline const char *
|
||||
arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot)
|
||||
{
|
||||
if (arm64_kernel_unmapped_at_el0())
|
||||
return (char *)TRAMP_VALIAS + SZ_2K * slot;
|
||||
return (char *)(TRAMP_VALIAS + SZ_2K * slot);
|
||||
|
||||
WARN_ON_ONCE(slot == EL1_VECTOR_KPTI);
|
||||
|
||||
|
@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
|
||||
skb_data3 = skb->data[3];
|
||||
paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
|
||||
return enq_next;
|
||||
ENI_PRV_PADDR(skb) = paddr;
|
||||
/* prepare DMA queue entries */
|
||||
j = 0;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/crypto.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
@ -43,16 +44,19 @@ static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
|
||||
{
|
||||
unsigned int currsize = 0;
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
/* read random data from hardware */
|
||||
do {
|
||||
val = readl_relaxed(rng->base + PRNG_STATUS);
|
||||
if (!(val & PRNG_STATUS_DATA_AVAIL))
|
||||
break;
|
||||
ret = readl_poll_timeout(rng->base + PRNG_STATUS, val,
|
||||
val & PRNG_STATUS_DATA_AVAIL,
|
||||
200, 10000);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
val = readl_relaxed(rng->base + PRNG_DATA_OUT);
|
||||
if (!val)
|
||||
break;
|
||||
return -EINVAL;
|
||||
|
||||
if ((max - currsize) >= WORD_SZ) {
|
||||
memcpy(data, &val, WORD_SZ);
|
||||
@ -61,11 +65,10 @@ static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
|
||||
} else {
|
||||
/* copy only remaining bytes */
|
||||
memcpy(data, &val, max - currsize);
|
||||
break;
|
||||
}
|
||||
} while (currsize < max);
|
||||
|
||||
return currsize;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qcom_rng_generate(struct crypto_rng *tfm,
|
||||
@ -87,7 +90,7 @@ static int qcom_rng_generate(struct crypto_rng *tfm,
|
||||
mutex_unlock(&rng->lock);
|
||||
clk_disable_unprepare(rng->clk);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int qcom_rng_seed(struct crypto_rng *tfm, const u8 *seed,
|
||||
|
@ -24,7 +24,7 @@ static bool dump_properties __initdata;
|
||||
static int __init dump_properties_enable(char *arg)
|
||||
{
|
||||
dump_properties = true;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("dump_apple_properties", dump_properties_enable);
|
||||
|
@ -209,7 +209,7 @@ static int __init efivar_ssdt_setup(char *str)
|
||||
memcpy(efivar_ssdt, str, strlen(str));
|
||||
else
|
||||
pr_warn("efivar_ssdt: name too long: %s\n", str);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
__setup("efivar_ssdt=", efivar_ssdt_setup);
|
||||
|
||||
|
@ -212,14 +212,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
|
||||
if (!imx_pd_format_supported(bus_fmt))
|
||||
return -EINVAL;
|
||||
|
||||
if (bus_flags &
|
||||
~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
|
||||
DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
|
||||
DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
|
||||
dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bridge_state->output_bus_cfg.flags = bus_flags;
|
||||
bridge_state->input_bus_cfg.flags = bus_flags;
|
||||
imx_crtc_state->bus_flags = bus_flags;
|
||||
|
@ -2132,7 +2132,7 @@ static const struct display_timing innolux_g070y2_l01_timing = {
|
||||
static const struct panel_desc innolux_g070y2_l01 = {
|
||||
.timings = &innolux_g070y2_l01_timing,
|
||||
.num_timings = 1,
|
||||
.bpc = 6,
|
||||
.bpc = 8,
|
||||
.size = {
|
||||
.width = 152,
|
||||
.height = 91,
|
||||
|
@ -1801,15 +1801,13 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
|
||||
input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
|
||||
|
||||
/* Verify that a device really has an endpoint */
|
||||
if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
|
||||
err = usb_find_common_endpoints(intf->cur_altsetting,
|
||||
NULL, NULL, &endpoint, NULL);
|
||||
if (err) {
|
||||
dev_err(&intf->dev,
|
||||
"interface has %d endpoints, but must have minimum 1\n",
|
||||
intf->cur_altsetting->desc.bNumEndpoints);
|
||||
err = -EINVAL;
|
||||
"interface has no int in endpoints, but must have minimum 1\n");
|
||||
goto fail3;
|
||||
}
|
||||
endpoint = &intf->cur_altsetting->endpoint[0].desc;
|
||||
|
||||
/* Go set up our URB, which is called when the tablet receives
|
||||
* input.
|
||||
|
@ -2534,6 +2534,4 @@ void bnx2x_register_phc(struct bnx2x *bp);
|
||||
* Meant for implicit re-load flows.
|
||||
*/
|
||||
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp);
|
||||
int bnx2x_init_firmware(struct bnx2x *bp);
|
||||
void bnx2x_release_firmware(struct bnx2x *bp);
|
||||
#endif /* bnx2x.h */
|
||||
|
@ -2363,24 +2363,30 @@ int bnx2x_compare_fw_ver(struct bnx2x *bp, u32 load_code, bool print_err)
|
||||
/* is another pf loaded on this engine? */
|
||||
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
|
||||
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
|
||||
/* build my FW version dword */
|
||||
u32 my_fw = (bp->fw_major) + (bp->fw_minor << 8) +
|
||||
(bp->fw_rev << 16) + (bp->fw_eng << 24);
|
||||
u8 loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng;
|
||||
u32 loaded_fw;
|
||||
|
||||
/* read loaded FW from chip */
|
||||
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
|
||||
loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
|
||||
|
||||
DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x\n",
|
||||
loaded_fw, my_fw);
|
||||
loaded_fw_major = loaded_fw & 0xff;
|
||||
loaded_fw_minor = (loaded_fw >> 8) & 0xff;
|
||||
loaded_fw_rev = (loaded_fw >> 16) & 0xff;
|
||||
loaded_fw_eng = (loaded_fw >> 24) & 0xff;
|
||||
|
||||
DP(BNX2X_MSG_SP, "loaded fw 0x%x major 0x%x minor 0x%x rev 0x%x eng 0x%x\n",
|
||||
loaded_fw, loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng);
|
||||
|
||||
/* abort nic load if version mismatch */
|
||||
if (my_fw != loaded_fw) {
|
||||
if (loaded_fw_major != BCM_5710_FW_MAJOR_VERSION ||
|
||||
loaded_fw_minor != BCM_5710_FW_MINOR_VERSION ||
|
||||
loaded_fw_eng != BCM_5710_FW_ENGINEERING_VERSION ||
|
||||
loaded_fw_rev < BCM_5710_FW_REVISION_VERSION_V15) {
|
||||
if (print_err)
|
||||
BNX2X_ERR("bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n",
|
||||
loaded_fw, my_fw);
|
||||
BNX2X_ERR("loaded FW incompatible. Aborting\n");
|
||||
else
|
||||
BNX2X_DEV_INFO("bnx2x with FW %x was already loaded which mismatches my %x FW, possibly due to MF UNDI\n",
|
||||
loaded_fw, my_fw);
|
||||
BNX2X_DEV_INFO("loaded FW incompatible, possibly due to MF UNDI\n");
|
||||
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
|
@ -12366,15 +12366,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)
|
||||
|
||||
bnx2x_read_fwinfo(bp);
|
||||
|
||||
if (IS_PF(bp)) {
|
||||
rc = bnx2x_init_firmware(bp);
|
||||
|
||||
if (rc) {
|
||||
bnx2x_free_mem_bp(bp);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
func = BP_FUNC(bp);
|
||||
|
||||
/* need to reset chip if undi was active */
|
||||
@ -12387,7 +12378,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)
|
||||
|
||||
rc = bnx2x_prev_unload(bp);
|
||||
if (rc) {
|
||||
bnx2x_release_firmware(bp);
|
||||
bnx2x_free_mem_bp(bp);
|
||||
return rc;
|
||||
}
|
||||
@ -13469,7 +13459,7 @@ do { \
|
||||
(u8 *)bp->arr, len); \
|
||||
} while (0)
|
||||
|
||||
int bnx2x_init_firmware(struct bnx2x *bp)
|
||||
static int bnx2x_init_firmware(struct bnx2x *bp)
|
||||
{
|
||||
const char *fw_file_name, *fw_file_name_v15;
|
||||
struct bnx2x_fw_file_hdr *fw_hdr;
|
||||
@ -13569,7 +13559,7 @@ int bnx2x_init_firmware(struct bnx2x *bp)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void bnx2x_release_firmware(struct bnx2x *bp)
|
||||
static void bnx2x_release_firmware(struct bnx2x *bp)
|
||||
{
|
||||
kfree(bp->init_ops_offsets);
|
||||
kfree(bp->init_ops);
|
||||
@ -14086,7 +14076,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
|
||||
return 0;
|
||||
|
||||
init_one_freemem:
|
||||
bnx2x_release_firmware(bp);
|
||||
bnx2x_free_mem_bp(bp);
|
||||
|
||||
init_one_exit:
|
||||
|
@ -2239,8 +2239,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
|
||||
dma_length_status = status->length_status;
|
||||
if (dev->features & NETIF_F_RXCSUM) {
|
||||
rx_csum = (__force __be16)(status->rx_csum & 0xffff);
|
||||
skb->csum = (__force __wsum)ntohs(rx_csum);
|
||||
skb->ip_summed = CHECKSUM_COMPLETE;
|
||||
if (rx_csum) {
|
||||
skb->csum = (__force __wsum)ntohs(rx_csum);
|
||||
skb->ip_summed = CHECKSUM_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
/* DMA flags and length are still valid no matter how
|
||||
|
@ -54,6 +54,12 @@ static int ocelot_chain_to_block(int chain, bool ingress)
|
||||
*/
|
||||
static int ocelot_chain_to_lookup(int chain)
|
||||
{
|
||||
/* Backwards compatibility with older, single-chain tc-flower
|
||||
* offload support in Ocelot
|
||||
*/
|
||||
if (chain == 0)
|
||||
return 0;
|
||||
|
||||
return (chain / VCAP_LOOKUP) % 10;
|
||||
}
|
||||
|
||||
@ -62,7 +68,15 @@ static int ocelot_chain_to_lookup(int chain)
|
||||
*/
|
||||
static int ocelot_chain_to_pag(int chain)
|
||||
{
|
||||
int lookup = ocelot_chain_to_lookup(chain);
|
||||
int lookup;
|
||||
|
||||
/* Backwards compatibility with older, single-chain tc-flower
|
||||
* offload support in Ocelot
|
||||
*/
|
||||
if (chain == 0)
|
||||
return 0;
|
||||
|
||||
lookup = ocelot_chain_to_lookup(chain);
|
||||
|
||||
/* calculate PAG value as chain index relative to the first PAG */
|
||||
return chain - VCAP_IS2_CHAIN(lookup, 0);
|
||||
|
@ -1562,6 +1562,9 @@ static void netvsc_get_ethtool_stats(struct net_device *dev,
|
||||
pcpu_sum = kvmalloc_array(num_possible_cpus(),
|
||||
sizeof(struct netvsc_ethtool_pcpu_stats),
|
||||
GFP_KERNEL);
|
||||
if (!pcpu_sum)
|
||||
return;
|
||||
|
||||
netvsc_get_pcpu_stats(dev, pcpu_sum);
|
||||
for_each_present_cpu(cpu) {
|
||||
struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu];
|
||||
|
@ -1536,8 +1536,8 @@ static int marvell_suspend(struct phy_device *phydev)
|
||||
int err;
|
||||
|
||||
/* Suspend the fiber mode first */
|
||||
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
|
||||
phydev->supported)) {
|
||||
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
|
||||
phydev->supported)) {
|
||||
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
|
||||
if (err < 0)
|
||||
goto error;
|
||||
@ -1571,8 +1571,8 @@ static int marvell_resume(struct phy_device *phydev)
|
||||
int err;
|
||||
|
||||
/* Resume the fiber mode first */
|
||||
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
|
||||
phydev->supported)) {
|
||||
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
|
||||
phydev->supported)) {
|
||||
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
|
||||
if (err < 0)
|
||||
goto error;
|
||||
|
@ -2584,3 +2584,6 @@ MODULE_DEVICE_TABLE(mdio, vsc85xx_tbl);
|
||||
MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver");
|
||||
MODULE_AUTHOR("Nagaraju Lakkaraju");
|
||||
MODULE_LICENSE("Dual MIT/GPL");
|
||||
|
||||
MODULE_FIRMWARE(MSCC_VSC8584_REVB_INT8051_FW);
|
||||
MODULE_FIRMWARE(MSCC_VSC8574_REVB_INT8051_FW);
|
||||
|
@ -84,9 +84,10 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
|
||||
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0, index, &buf, 4);
|
||||
if (unlikely(ret < 0)) {
|
||||
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
if (ret < 0) {
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -116,7 +117,7 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
|
||||
ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
|
||||
| USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0, index, &buf, 4);
|
||||
if (unlikely(ret < 0))
|
||||
if (ret < 0 && ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
|
||||
index, ret);
|
||||
|
||||
@ -159,6 +160,9 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev,
|
||||
do {
|
||||
ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
|
||||
if (ret < 0) {
|
||||
/* Ignore -ENODEV error during disconnect() */
|
||||
if (ret == -ENODEV)
|
||||
return 0;
|
||||
netdev_warn(dev->net, "Error reading MII_ACCESS\n");
|
||||
return ret;
|
||||
}
|
||||
@ -194,7 +198,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_);
|
||||
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -206,7 +211,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
|
||||
ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error reading MII_DATA\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error reading MII_DATA\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -214,6 +220,10 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx,
|
||||
|
||||
done:
|
||||
mutex_unlock(&dev->phy_mutex);
|
||||
|
||||
/* Ignore -ENODEV error during disconnect() */
|
||||
if (ret == -ENODEV)
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -235,7 +245,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id,
|
||||
val = regval;
|
||||
ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_DATA\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_DATA\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -243,7 +254,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id,
|
||||
addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_);
|
||||
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
if (ret != -ENODEV)
|
||||
netdev_warn(dev->net, "Error writing MII_ADDR\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -1049,6 +1061,14 @@ static const struct net_device_ops smsc95xx_netdev_ops = {
|
||||
.ndo_set_features = smsc95xx_set_features,
|
||||
};
|
||||
|
||||
static void smsc95xx_handle_link_change(struct net_device *net)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
|
||||
phy_print_status(net->phydev);
|
||||
usbnet_defer_kevent(dev, EVENT_LINK_CHANGE);
|
||||
}
|
||||
|
||||
static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
{
|
||||
struct smsc95xx_priv *pdata;
|
||||
@ -1153,6 +1173,17 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
dev->net->min_mtu = ETH_MIN_MTU;
|
||||
dev->net->max_mtu = ETH_DATA_LEN;
|
||||
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
|
||||
|
||||
ret = phy_connect_direct(dev->net, pdata->phydev,
|
||||
&smsc95xx_handle_link_change,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
if (ret) {
|
||||
netdev_err(dev->net, "can't attach PHY to %s\n", pdata->mdiobus->id);
|
||||
goto unregister_mdio;
|
||||
}
|
||||
|
||||
phy_attached_info(dev->net->phydev);
|
||||
|
||||
return 0;
|
||||
|
||||
unregister_mdio:
|
||||
@ -1170,47 +1201,25 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
|
||||
{
|
||||
struct smsc95xx_priv *pdata = dev->driver_priv;
|
||||
|
||||
phy_disconnect(dev->net->phydev);
|
||||
mdiobus_unregister(pdata->mdiobus);
|
||||
mdiobus_free(pdata->mdiobus);
|
||||
netif_dbg(dev, ifdown, dev->net, "free pdata\n");
|
||||
kfree(pdata);
|
||||
}
|
||||
|
||||
static void smsc95xx_handle_link_change(struct net_device *net)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
|
||||
phy_print_status(net->phydev);
|
||||
usbnet_defer_kevent(dev, EVENT_LINK_CHANGE);
|
||||
}
|
||||
|
||||
static int smsc95xx_start_phy(struct usbnet *dev)
|
||||
{
|
||||
struct smsc95xx_priv *pdata = dev->driver_priv;
|
||||
struct net_device *net = dev->net;
|
||||
int ret;
|
||||
phy_start(dev->net->phydev);
|
||||
|
||||
ret = smsc95xx_reset(dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = phy_connect_direct(net, pdata->phydev,
|
||||
&smsc95xx_handle_link_change,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
if (ret) {
|
||||
netdev_err(net, "can't attach PHY to %s\n", pdata->mdiobus->id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
phy_attached_info(net->phydev);
|
||||
phy_start(net->phydev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smsc95xx_disconnect_phy(struct usbnet *dev)
|
||||
static int smsc95xx_stop(struct usbnet *dev)
|
||||
{
|
||||
phy_stop(dev->net->phydev);
|
||||
phy_disconnect(dev->net->phydev);
|
||||
if (dev->net->phydev)
|
||||
phy_stop(dev->net->phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1964,8 +1973,9 @@ static const struct driver_info smsc95xx_info = {
|
||||
.bind = smsc95xx_bind,
|
||||
.unbind = smsc95xx_unbind,
|
||||
.link_reset = smsc95xx_link_reset,
|
||||
.reset = smsc95xx_start_phy,
|
||||
.stop = smsc95xx_disconnect_phy,
|
||||
.reset = smsc95xx_reset,
|
||||
.check_connect = smsc95xx_start_phy,
|
||||
.stop = smsc95xx_stop,
|
||||
.rx_fixup = smsc95xx_rx_fixup,
|
||||
.tx_fixup = smsc95xx_tx_fixup,
|
||||
.status = smsc95xx_status,
|
||||
|
@ -1832,9 +1832,10 @@ mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc, u8 poll)
|
||||
enable_irq(reply_q->os_irq);
|
||||
}
|
||||
}
|
||||
|
||||
if (poll)
|
||||
_base_process_reply_queue(reply_q);
|
||||
}
|
||||
if (poll)
|
||||
_base_process_reply_queue(reply_q);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1889,6 +1889,7 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
|
||||
struct usbtmc_ctrlrequest request;
|
||||
u8 *buffer = NULL;
|
||||
int rv;
|
||||
unsigned int is_in, pipe;
|
||||
unsigned long res;
|
||||
|
||||
res = copy_from_user(&request, arg, sizeof(struct usbtmc_ctrlrequest));
|
||||
@ -1898,12 +1899,14 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
|
||||
if (request.req.wLength > USBTMC_BUFSIZE)
|
||||
return -EMSGSIZE;
|
||||
|
||||
is_in = request.req.bRequestType & USB_DIR_IN;
|
||||
|
||||
if (request.req.wLength) {
|
||||
buffer = kmalloc(request.req.wLength, GFP_KERNEL);
|
||||
if (!buffer)
|
||||
return -ENOMEM;
|
||||
|
||||
if ((request.req.bRequestType & USB_DIR_IN) == 0) {
|
||||
if (!is_in) {
|
||||
/* Send control data to device */
|
||||
res = copy_from_user(buffer, request.data,
|
||||
request.req.wLength);
|
||||
@ -1914,8 +1917,12 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
|
||||
}
|
||||
}
|
||||
|
||||
if (is_in)
|
||||
pipe = usb_rcvctrlpipe(data->usb_dev, 0);
|
||||
else
|
||||
pipe = usb_sndctrlpipe(data->usb_dev, 0);
|
||||
rv = usb_control_msg(data->usb_dev,
|
||||
usb_rcvctrlpipe(data->usb_dev, 0),
|
||||
pipe,
|
||||
request.req.bRequest,
|
||||
request.req.bRequestType,
|
||||
request.req.wValue,
|
||||
@ -1927,7 +1934,7 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (rv && (request.req.bRequestType & USB_DIR_IN)) {
|
||||
if (rv && is_in) {
|
||||
/* Read control data from device */
|
||||
res = copy_to_user(request.data, buffer, rv);
|
||||
if (res)
|
||||
|
@ -697,7 +697,8 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
|
||||
|
||||
/* Iterating over all connections for all CIDs to find orphans is
|
||||
* inefficient. Room for improvement here. */
|
||||
vsock_for_each_connected_socket(vhost_vsock_reset_orphans);
|
||||
vsock_for_each_connected_socket(&vhost_transport.transport,
|
||||
vhost_vsock_reset_orphans);
|
||||
|
||||
/* Don't check the owner, because we are in the release path, so we
|
||||
* need to stop the vsock device in any case.
|
||||
|
@ -1111,17 +1111,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
|
||||
goto read_super_error;
|
||||
}
|
||||
|
||||
root = d_make_root(inode);
|
||||
if (!root) {
|
||||
status = -ENOMEM;
|
||||
mlog_errno(status);
|
||||
goto read_super_error;
|
||||
}
|
||||
|
||||
sb->s_root = root;
|
||||
|
||||
ocfs2_complete_mount_recovery(osb);
|
||||
|
||||
osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
|
||||
&ocfs2_kset->kobj);
|
||||
if (!osb->osb_dev_kset) {
|
||||
@ -1139,6 +1128,17 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
|
||||
goto read_super_error;
|
||||
}
|
||||
|
||||
root = d_make_root(inode);
|
||||
if (!root) {
|
||||
status = -ENOMEM;
|
||||
mlog_errno(status);
|
||||
goto read_super_error;
|
||||
}
|
||||
|
||||
sb->s_root = root;
|
||||
|
||||
ocfs2_complete_mount_recovery(osb);
|
||||
|
||||
if (ocfs2_mount_local(osb))
|
||||
snprintf(nodestr, sizeof(nodestr), "local");
|
||||
else
|
||||
|
@ -51,6 +51,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev)
|
||||
case ARPHRD_VOID:
|
||||
case ARPHRD_NONE:
|
||||
case ARPHRD_RAWIP:
|
||||
case ARPHRD_PIMREG:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
|
@ -197,7 +197,8 @@ struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
|
||||
struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
|
||||
struct sockaddr_vm *dst);
|
||||
void vsock_remove_sock(struct vsock_sock *vsk);
|
||||
void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
|
||||
void vsock_for_each_connected_socket(struct vsock_transport *transport,
|
||||
void (*fn)(struct sock *sk));
|
||||
int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk);
|
||||
bool vsock_find_cid(unsigned int cid);
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
#define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER)
|
||||
|
||||
struct ip_esp_hdr;
|
||||
|
||||
static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
|
||||
|
@ -2691,6 +2691,7 @@ extern int sysctl_optmem_max;
|
||||
extern __u32 sysctl_wmem_default;
|
||||
extern __u32 sysctl_rmem_default;
|
||||
|
||||
#define SKB_FRAG_PAGE_ORDER get_order(32768)
|
||||
DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key);
|
||||
|
||||
static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
|
||||
|
@ -513,7 +513,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
|
||||
* __read_swap_cache_async(), which has set SWAP_HAS_CACHE
|
||||
* in swap_map, but not yet added its page to swap cache.
|
||||
*/
|
||||
cond_resched();
|
||||
schedule_timeout_uninterruptible(1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -766,6 +766,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
|
||||
struct net_device *master;
|
||||
|
||||
master = of_find_net_device_by_node(ethernet);
|
||||
of_node_put(ethernet);
|
||||
if (!master)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
|
@ -448,6 +448,7 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *
|
||||
struct page *page;
|
||||
struct sk_buff *trailer;
|
||||
int tailen = esp->tailen;
|
||||
unsigned int allocsz;
|
||||
|
||||
/* this is non-NULL only with TCP/UDP Encapsulation */
|
||||
if (x->encap) {
|
||||
@ -457,6 +458,10 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *
|
||||
return err;
|
||||
}
|
||||
|
||||
allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
|
||||
if (allocsz > ESP_SKB_FRAG_MAXSIZE)
|
||||
goto cow;
|
||||
|
||||
if (!skb_cloned(skb)) {
|
||||
if (tailen <= skb_tailroom(skb)) {
|
||||
nfrags = 1;
|
||||
|
@ -483,6 +483,7 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
|
||||
struct page *page;
|
||||
struct sk_buff *trailer;
|
||||
int tailen = esp->tailen;
|
||||
unsigned int allocsz;
|
||||
|
||||
if (x->encap) {
|
||||
int err = esp6_output_encap(x, skb, esp);
|
||||
@ -491,6 +492,10 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
|
||||
return err;
|
||||
}
|
||||
|
||||
allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
|
||||
if (allocsz > ESP_SKB_FRAG_MAXSIZE)
|
||||
goto cow;
|
||||
|
||||
if (!skb_cloned(skb)) {
|
||||
if (tailen <= skb_tailroom(skb)) {
|
||||
nfrags = 1;
|
||||
@ -808,8 +813,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
|
||||
struct tcphdr *th;
|
||||
|
||||
offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
|
||||
|
||||
if (offset < 0) {
|
||||
if (offset == -1) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -2278,8 +2278,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
copy_skb = skb_get(skb);
|
||||
skb_head = skb->data;
|
||||
}
|
||||
if (copy_skb)
|
||||
if (copy_skb) {
|
||||
memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0,
|
||||
sizeof(PACKET_SKB_CB(copy_skb)->sa.ll));
|
||||
skb_set_owner_r(copy_skb, sk);
|
||||
}
|
||||
}
|
||||
snaplen = po->rx_ring.frame_size - macoff;
|
||||
if ((int)snaplen < 0) {
|
||||
@ -3434,6 +3437,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||
sock_recv_ts_and_drops(msg, sk, skb);
|
||||
|
||||
if (msg->msg_name) {
|
||||
const size_t max_len = min(sizeof(skb->cb),
|
||||
sizeof(struct sockaddr_storage));
|
||||
int copy_len;
|
||||
|
||||
/* If the address length field is there to be filled
|
||||
@ -3456,6 +3461,10 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||
msg->msg_namelen = sizeof(struct sockaddr_ll);
|
||||
}
|
||||
}
|
||||
if (WARN_ON_ONCE(copy_len > max_len)) {
|
||||
copy_len = max_len;
|
||||
msg->msg_namelen = copy_len;
|
||||
}
|
||||
memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len);
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,8 @@ void vsock_remove_sock(struct vsock_sock *vsk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vsock_remove_sock);
|
||||
|
||||
void vsock_for_each_connected_socket(void (*fn)(struct sock *sk))
|
||||
void vsock_for_each_connected_socket(struct vsock_transport *transport,
|
||||
void (*fn)(struct sock *sk))
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -342,8 +343,12 @@ void vsock_for_each_connected_socket(void (*fn)(struct sock *sk))
|
||||
for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) {
|
||||
struct vsock_sock *vsk;
|
||||
list_for_each_entry(vsk, &vsock_connected_table[i],
|
||||
connected_table)
|
||||
connected_table) {
|
||||
if (vsk->transport != transport)
|
||||
continue;
|
||||
|
||||
fn(sk_vsock(vsk));
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&vsock_table_lock);
|
||||
|
@ -24,6 +24,7 @@
|
||||
static struct workqueue_struct *virtio_vsock_workqueue;
|
||||
static struct virtio_vsock __rcu *the_virtio_vsock;
|
||||
static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */
|
||||
static struct virtio_transport virtio_transport; /* forward declaration */
|
||||
|
||||
struct virtio_vsock {
|
||||
struct virtio_device *vdev;
|
||||
@ -383,7 +384,8 @@ static void virtio_vsock_event_handle(struct virtio_vsock *vsock,
|
||||
switch (le32_to_cpu(event->id)) {
|
||||
case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET:
|
||||
virtio_vsock_update_guest_cid(vsock);
|
||||
vsock_for_each_connected_socket(virtio_vsock_reset_sock);
|
||||
vsock_for_each_connected_socket(&virtio_transport.transport,
|
||||
virtio_vsock_reset_sock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -635,7 +637,8 @@ static void virtio_vsock_remove(struct virtio_device *vdev)
|
||||
synchronize_rcu();
|
||||
|
||||
/* Reset all connected sockets when the device disappear */
|
||||
vsock_for_each_connected_socket(virtio_vsock_reset_sock);
|
||||
vsock_for_each_connected_socket(&virtio_transport.transport,
|
||||
virtio_vsock_reset_sock);
|
||||
|
||||
/* Stop all work handlers to make sure no one is accessing the device,
|
||||
* so we can safely call vdev->config->reset().
|
||||
|
@ -75,6 +75,8 @@ static u32 vmci_transport_qp_resumed_sub_id = VMCI_INVALID_ID;
|
||||
|
||||
static int PROTOCOL_OVERRIDE = -1;
|
||||
|
||||
static struct vsock_transport vmci_transport; /* forward declaration */
|
||||
|
||||
/* Helper function to convert from a VMCI error code to a VSock error code. */
|
||||
|
||||
static s32 vmci_transport_error_to_vsock_error(s32 vmci_error)
|
||||
@ -882,7 +884,8 @@ static void vmci_transport_qp_resumed_cb(u32 sub_id,
|
||||
const struct vmci_event_data *e_data,
|
||||
void *client_data)
|
||||
{
|
||||
vsock_for_each_connected_socket(vmci_transport_handle_detach);
|
||||
vsock_for_each_connected_socket(&vmci_transport,
|
||||
vmci_transport_handle_detach);
|
||||
}
|
||||
|
||||
static void vmci_transport_recv_pkt_work(struct work_struct *work)
|
||||
|
@ -231,7 +231,7 @@ void symbols__fixup_end(struct rb_root_cached *symbols)
|
||||
prev = curr;
|
||||
curr = rb_entry(nd, struct symbol, rb_node);
|
||||
|
||||
if (prev->end == prev->start && prev->end != curr->start)
|
||||
if (prev->end == prev->start || prev->end != curr->start)
|
||||
arch__symbols__fixup_end(prev, curr);
|
||||
}
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <test_progs.h>
|
||||
#include "timer_crash.skel.h"
|
||||
|
||||
enum {
|
||||
MODE_ARRAY,
|
||||
MODE_HASH,
|
||||
};
|
||||
|
||||
static void test_timer_crash_mode(int mode)
|
||||
{
|
||||
struct timer_crash *skel;
|
||||
|
||||
skel = timer_crash__open_and_load();
|
||||
if (!ASSERT_OK_PTR(skel, "timer_crash__open_and_load"))
|
||||
return;
|
||||
skel->bss->pid = getpid();
|
||||
skel->bss->crash_map = mode;
|
||||
if (!ASSERT_OK(timer_crash__attach(skel), "timer_crash__attach"))
|
||||
goto end;
|
||||
usleep(1);
|
||||
end:
|
||||
timer_crash__destroy(skel);
|
||||
}
|
||||
|
||||
void test_timer_crash(void)
|
||||
{
|
||||
if (test__start_subtest("array"))
|
||||
test_timer_crash_mode(MODE_ARRAY);
|
||||
if (test__start_subtest("hash"))
|
||||
test_timer_crash_mode(MODE_HASH);
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <vmlinux.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
#include <bpf/bpf_helpers.h>
|
||||
|
||||
struct map_elem {
|
||||
struct bpf_timer timer;
|
||||
struct bpf_spin_lock lock;
|
||||
};
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||
__uint(max_entries, 1);
|
||||
__type(key, int);
|
||||
__type(value, struct map_elem);
|
||||
} amap SEC(".maps");
|
||||
|
||||
struct {
|
||||
__uint(type, BPF_MAP_TYPE_HASH);
|
||||
__uint(max_entries, 1);
|
||||
__type(key, int);
|
||||
__type(value, struct map_elem);
|
||||
} hmap SEC(".maps");
|
||||
|
||||
int pid = 0;
|
||||
int crash_map = 0; /* 0 for amap, 1 for hmap */
|
||||
|
||||
SEC("fentry/do_nanosleep")
|
||||
int sys_enter(void *ctx)
|
||||
{
|
||||
struct map_elem *e, value = {};
|
||||
void *map = crash_map ? (void *)&hmap : (void *)&amap;
|
||||
|
||||
if (bpf_get_current_task_btf()->tgid != pid)
|
||||
return 0;
|
||||
|
||||
*(void **)&value = (void *)0xdeadcaf3;
|
||||
|
||||
bpf_map_update_elem(map, &(int){0}, &value, 0);
|
||||
/* For array map, doing bpf_map_update_elem will do a
|
||||
* check_and_free_timer_in_array, which will trigger the crash if timer
|
||||
* pointer was overwritten, for hmap we need to use bpf_timer_cancel.
|
||||
*/
|
||||
if (crash_map == 1) {
|
||||
e = bpf_map_lookup_elem(map, &(int){0});
|
||||
if (!e)
|
||||
return 0;
|
||||
bpf_timer_cancel(&e->timer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char _license[] SEC("license") = "GPL";
|
Loading…
Reference in New Issue
Block a user