mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Move to tag and remove not needed patches (#4120)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/arm 5.4.210 Kernel Configuration
|
||||
# Linux/arm 5.4.211 Kernel Configuration
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
@@ -19,6 +19,7 @@ case $BRANCH in
|
||||
|
||||
KERNELSOURCE='https://github.com/hardkernel/linux'
|
||||
KERNELBRANCH='branch:odroid-5.4.y'
|
||||
KERNELBRANCH='tag:5.4.196-406'
|
||||
KERNELDIR='linux-odroidxu4'
|
||||
;;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,909 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 7380354e49513..062052f71a976 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 170
|
||||
+SUBLEVEL = 171
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c
|
||||
index b8d715c68ca44..11a0806469162 100644
|
||||
--- a/drivers/infiniband/core/uverbs_marshall.c
|
||||
+++ b/drivers/infiniband/core/uverbs_marshall.c
|
||||
@@ -66,7 +66,7 @@ void ib_copy_ah_attr_to_user(struct ib_device *device,
|
||||
struct rdma_ah_attr *src = ah_attr;
|
||||
struct rdma_ah_attr conv_ah;
|
||||
|
||||
- memset(&dst->grh.reserved, 0, sizeof(dst->grh.reserved));
|
||||
+ memset(&dst->grh, 0, sizeof(dst->grh));
|
||||
|
||||
if ((ah_attr->type == RDMA_AH_ATTR_TYPE_OPA) &&
|
||||
(rdma_ah_get_dlid(ah_attr) > be16_to_cpu(IB_LID_PERMISSIVE)) &&
|
||||
diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c
|
||||
index 00c5478871322..818699b855c5c 100644
|
||||
--- a/drivers/infiniband/core/uverbs_uapi.c
|
||||
+++ b/drivers/infiniband/core/uverbs_uapi.c
|
||||
@@ -450,6 +450,9 @@ static int uapi_finalize(struct uverbs_api *uapi)
|
||||
uapi->num_write_ex = max_write_ex + 1;
|
||||
data = kmalloc_array(uapi->num_write + uapi->num_write_ex,
|
||||
sizeof(*uapi->write_methods), GFP_KERNEL);
|
||||
+ if (!data)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
for (i = 0; i != uapi->num_write + uapi->num_write_ex; i++)
|
||||
data[i] = &uapi->notsupp_method;
|
||||
uapi->write_methods = data;
|
||||
diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
|
||||
index 2962c3747adc3..ed5fbcb40e3f0 100644
|
||||
--- a/drivers/input/touchscreen/of_touchscreen.c
|
||||
+++ b/drivers/input/touchscreen/of_touchscreen.c
|
||||
@@ -77,8 +77,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
|
||||
axis = multitouch ? ABS_MT_POSITION_X : ABS_X;
|
||||
data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x",
|
||||
input_abs_get_min(input, axis),
|
||||
- &minimum) |
|
||||
- touchscreen_get_prop_u32(dev, "touchscreen-size-x",
|
||||
+ &minimum);
|
||||
+ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-size-x",
|
||||
input_abs_get_max(input,
|
||||
axis) + 1,
|
||||
&maximum);
|
||||
@@ -91,8 +91,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
|
||||
axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y;
|
||||
data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-y",
|
||||
input_abs_get_min(input, axis),
|
||||
- &minimum) |
|
||||
- touchscreen_get_prop_u32(dev, "touchscreen-size-y",
|
||||
+ &minimum);
|
||||
+ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-size-y",
|
||||
input_abs_get_max(input,
|
||||
axis) + 1,
|
||||
&maximum);
|
||||
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
|
||||
index 55891e4204460..a41b4b2645941 100644
|
||||
--- a/drivers/isdn/mISDN/core.c
|
||||
+++ b/drivers/isdn/mISDN/core.c
|
||||
@@ -381,7 +381,7 @@ mISDNInit(void)
|
||||
err = mISDN_inittimer(&debug);
|
||||
if (err)
|
||||
goto error2;
|
||||
- err = l1_init(&debug);
|
||||
+ err = Isdnl1_Init(&debug);
|
||||
if (err)
|
||||
goto error3;
|
||||
err = Isdnl2_Init(&debug);
|
||||
@@ -395,7 +395,7 @@ mISDNInit(void)
|
||||
error5:
|
||||
Isdnl2_cleanup();
|
||||
error4:
|
||||
- l1_cleanup();
|
||||
+ Isdnl1_cleanup();
|
||||
error3:
|
||||
mISDN_timer_cleanup();
|
||||
error2:
|
||||
@@ -408,7 +408,7 @@ static void mISDN_cleanup(void)
|
||||
{
|
||||
misdn_sock_cleanup();
|
||||
Isdnl2_cleanup();
|
||||
- l1_cleanup();
|
||||
+ Isdnl1_cleanup();
|
||||
mISDN_timer_cleanup();
|
||||
class_unregister(&mISDN_class);
|
||||
|
||||
diff --git a/drivers/isdn/mISDN/core.h b/drivers/isdn/mISDN/core.h
|
||||
index 23b44d3033279..42599f49c189d 100644
|
||||
--- a/drivers/isdn/mISDN/core.h
|
||||
+++ b/drivers/isdn/mISDN/core.h
|
||||
@@ -60,8 +60,8 @@ struct Bprotocol *get_Bprotocol4id(u_int);
|
||||
extern int mISDN_inittimer(u_int *);
|
||||
extern void mISDN_timer_cleanup(void);
|
||||
|
||||
-extern int l1_init(u_int *);
|
||||
-extern void l1_cleanup(void);
|
||||
+extern int Isdnl1_Init(u_int *);
|
||||
+extern void Isdnl1_cleanup(void);
|
||||
extern int Isdnl2_Init(u_int *);
|
||||
extern void Isdnl2_cleanup(void);
|
||||
|
||||
diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c
|
||||
index 98a3bc6c17009..7b31c25a550e3 100644
|
||||
--- a/drivers/isdn/mISDN/layer1.c
|
||||
+++ b/drivers/isdn/mISDN/layer1.c
|
||||
@@ -398,7 +398,7 @@ create_l1(struct dchannel *dch, dchannel_l1callback *dcb) {
|
||||
EXPORT_SYMBOL(create_l1);
|
||||
|
||||
int
|
||||
-l1_init(u_int *deb)
|
||||
+Isdnl1_Init(u_int *deb)
|
||||
{
|
||||
debug = deb;
|
||||
l1fsm_s.state_count = L1S_STATE_COUNT;
|
||||
@@ -409,7 +409,7 @@ l1_init(u_int *deb)
|
||||
}
|
||||
|
||||
void
|
||||
-l1_cleanup(void)
|
||||
+Isdnl1_cleanup(void)
|
||||
{
|
||||
mISDN_FsmFree(&l1fsm_s);
|
||||
}
|
||||
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
||||
index 03821b46a8cb4..4c22f119ac62f 100644
|
||||
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
||||
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
||||
@@ -305,6 +305,10 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
||||
if (!buff->is_eop) {
|
||||
buff_ = buff;
|
||||
do {
|
||||
+ if (buff_->next >= self->size) {
|
||||
+ err = -EIO;
|
||||
+ goto err_exit;
|
||||
+ }
|
||||
next_ = buff_->next,
|
||||
buff_ = &self->buff_ring[next_];
|
||||
is_rsc_completed =
|
||||
@@ -327,6 +331,10 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
||||
if (buff->is_error || buff->is_cso_err) {
|
||||
buff_ = buff;
|
||||
do {
|
||||
+ if (buff_->next >= self->size) {
|
||||
+ err = -EIO;
|
||||
+ goto err_exit;
|
||||
+ }
|
||||
next_ = buff_->next,
|
||||
buff_ = &self->buff_ring[next_];
|
||||
|
||||
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||
index ce237da003ddb..a2326683be170 100644
|
||||
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||
@@ -107,6 +107,24 @@ MODULE_VERSION(DRV_VERSION);
|
||||
|
||||
static struct workqueue_struct *i40e_wq;
|
||||
|
||||
+static void netdev_hw_addr_refcnt(struct i40e_mac_filter *f,
|
||||
+ struct net_device *netdev, int delta)
|
||||
+{
|
||||
+ struct netdev_hw_addr *ha;
|
||||
+
|
||||
+ if (!f || !netdev)
|
||||
+ return;
|
||||
+
|
||||
+ netdev_for_each_mc_addr(ha, netdev) {
|
||||
+ if (ether_addr_equal(ha->addr, f->macaddr)) {
|
||||
+ ha->refcount += delta;
|
||||
+ if (ha->refcount <= 0)
|
||||
+ ha->refcount = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* i40e_allocate_dma_mem_d - OS specific memory alloc for shared code
|
||||
* @hw: pointer to the HW structure
|
||||
@@ -2022,6 +2040,7 @@ static void i40e_undo_add_filter_entries(struct i40e_vsi *vsi,
|
||||
hlist_for_each_entry_safe(new, h, from, hlist) {
|
||||
/* We can simply free the wrapper structure */
|
||||
hlist_del(&new->hlist);
|
||||
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
|
||||
kfree(new);
|
||||
}
|
||||
}
|
||||
@@ -2369,6 +2388,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
&tmp_add_list,
|
||||
&tmp_del_list,
|
||||
vlan_filters);
|
||||
+
|
||||
+ hlist_for_each_entry(new, &tmp_add_list, hlist)
|
||||
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, 1);
|
||||
+
|
||||
if (retval)
|
||||
goto err_no_memory_locked;
|
||||
|
||||
@@ -2501,6 +2524,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
if (new->f->state == I40E_FILTER_NEW)
|
||||
new->f->state = new->state;
|
||||
hlist_del(&new->hlist);
|
||||
+ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
|
||||
kfree(new);
|
||||
}
|
||||
spin_unlock_bh(&vsi->mac_filter_hash_lock);
|
||||
@@ -8302,6 +8326,27 @@ int i40e_open(struct net_device *netdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * i40e_netif_set_realnum_tx_rx_queues - Update number of tx/rx queues
|
||||
+ * @vsi: vsi structure
|
||||
+ *
|
||||
+ * This updates netdev's number of tx/rx queues
|
||||
+ *
|
||||
+ * Returns status of setting tx/rx queues
|
||||
+ **/
|
||||
+static int i40e_netif_set_realnum_tx_rx_queues(struct i40e_vsi *vsi)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = netif_set_real_num_rx_queues(vsi->netdev,
|
||||
+ vsi->num_queue_pairs);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return netif_set_real_num_tx_queues(vsi->netdev,
|
||||
+ vsi->num_queue_pairs);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* i40e_vsi_open -
|
||||
* @vsi: the VSI to open
|
||||
@@ -8338,13 +8383,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
|
||||
goto err_setup_rx;
|
||||
|
||||
/* Notify the stack of the actual queue counts. */
|
||||
- err = netif_set_real_num_tx_queues(vsi->netdev,
|
||||
- vsi->num_queue_pairs);
|
||||
- if (err)
|
||||
- goto err_set_queues;
|
||||
-
|
||||
- err = netif_set_real_num_rx_queues(vsi->netdev,
|
||||
- vsi->num_queue_pairs);
|
||||
+ err = i40e_netif_set_realnum_tx_rx_queues(vsi);
|
||||
if (err)
|
||||
goto err_set_queues;
|
||||
|
||||
@@ -13766,6 +13805,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
|
||||
case I40E_VSI_MAIN:
|
||||
case I40E_VSI_VMDQ2:
|
||||
ret = i40e_config_netdev(vsi);
|
||||
+ if (ret)
|
||||
+ goto err_netdev;
|
||||
+ ret = i40e_netif_set_realnum_tx_rx_queues(vsi);
|
||||
if (ret)
|
||||
goto err_netdev;
|
||||
ret = register_netdev(vsi->netdev);
|
||||
@@ -15012,8 +15054,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
|
||||
hw->aq.api_min_ver > I40E_FW_MINOR_VERSION(hw))
|
||||
- dev_info(&pdev->dev,
|
||||
- "The driver for the device detected a newer version of the NVM image v%u.%u than expected v%u.%u. Please install the most recent version of the network driver.\n",
|
||||
+ dev_dbg(&pdev->dev,
|
||||
+ "The driver for the device detected a newer version of the NVM image v%u.%u than v%u.%u.\n",
|
||||
hw->aq.api_maj_ver,
|
||||
hw->aq.api_min_ver,
|
||||
I40E_FW_API_VERSION_MAJOR,
|
||||
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
|
||||
index 449eb06e2c7da..309e953ed1e44 100644
|
||||
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
|
||||
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
|
||||
@@ -2604,8 +2604,11 @@ static int iavf_validate_ch_config(struct iavf_adapter *adapter,
|
||||
total_max_rate += tx_rate;
|
||||
num_qps += mqprio_qopt->qopt.count[i];
|
||||
}
|
||||
- if (num_qps > IAVF_MAX_REQ_QUEUES)
|
||||
+ if (num_qps > adapter->num_active_queues) {
|
||||
+ dev_err(&adapter->pdev->dev,
|
||||
+ "Cannot support requested number of queues\n");
|
||||
return -EINVAL;
|
||||
+ }
|
||||
|
||||
ret = iavf_validate_tx_bandwidth(adapter, total_max_rate);
|
||||
return ret;
|
||||
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
|
||||
index 23ee0b14cbfa1..2f5e7b31032aa 100644
|
||||
--- a/drivers/net/ieee802154/atusb.c
|
||||
+++ b/drivers/net/ieee802154/atusb.c
|
||||
@@ -93,7 +93,9 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
|
||||
|
||||
ret = usb_control_msg(usb_dev, pipe, request, requesttype,
|
||||
value, index, data, size, timeout);
|
||||
- if (ret < 0) {
|
||||
+ if (ret < size) {
|
||||
+ ret = ret < 0 ? ret : -ENODATA;
|
||||
+
|
||||
atusb->err = ret;
|
||||
dev_err(&usb_dev->dev,
|
||||
"%s: req 0x%02x val 0x%x idx 0x%x, error %d\n",
|
||||
@@ -861,9 +863,9 @@ static int atusb_get_and_show_build(struct atusb *atusb)
|
||||
if (!build)
|
||||
return -ENOMEM;
|
||||
|
||||
- ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
|
||||
- ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
|
||||
- build, ATUSB_BUILD_SIZE, 1000);
|
||||
+ /* We cannot call atusb_control_msg() here, since this request may read various length data */
|
||||
+ ret = usb_control_msg(atusb->usb_dev, usb_rcvctrlpipe(usb_dev, 0), ATUSB_BUILD,
|
||||
+ ATUSB_REQ_FROM_DEV, 0, 0, build, ATUSB_BUILD_SIZE, 1000);
|
||||
if (ret >= 0) {
|
||||
build[ret] = 0;
|
||||
dev_info(&usb_dev->dev, "Firmware: build %s\n", build);
|
||||
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
|
||||
index 0b61d80ea3f8c..18cc5e4280e83 100644
|
||||
--- a/drivers/net/phy/micrel.c
|
||||
+++ b/drivers/net/phy/micrel.c
|
||||
@@ -1096,6 +1096,7 @@ static struct phy_driver ksphy_driver[] = {
|
||||
.probe = kszphy_probe,
|
||||
.config_init = ksz8081_config_init,
|
||||
.ack_interrupt = kszphy_ack_interrupt,
|
||||
+ .soft_reset = genphy_soft_reset,
|
||||
.config_intr = kszphy_config_intr,
|
||||
.get_sset_count = kszphy_get_sset_count,
|
||||
.get_strings = kszphy_get_strings,
|
||||
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
|
||||
index f9b359d4e2939..1505fe3f87ed3 100644
|
||||
--- a/drivers/net/usb/rndis_host.c
|
||||
+++ b/drivers/net/usb/rndis_host.c
|
||||
@@ -608,6 +608,11 @@ static const struct usb_device_id products [] = {
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042,
|
||||
USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||
.driver_info = (unsigned long) &rndis_poll_status_info,
|
||||
+}, {
|
||||
+ /* Hytera Communications DMR radios' "Radio to PC Network" */
|
||||
+ USB_VENDOR_AND_INTERFACE_INFO(0x238b,
|
||||
+ USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||
+ .driver_info = (unsigned long)&rndis_info,
|
||||
}, {
|
||||
/* RNDIS is MSFT's un-official variant of CDC ACM */
|
||||
USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
|
||||
index e4a0cc45b3d11..ec613bcc0a302 100644
|
||||
--- a/drivers/power/reset/ltc2952-poweroff.c
|
||||
+++ b/drivers/power/reset/ltc2952-poweroff.c
|
||||
@@ -160,8 +160,8 @@ static void ltc2952_poweroff_kill(void)
|
||||
|
||||
static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
|
||||
{
|
||||
- data->wde_interval = 300L * 1E6L;
|
||||
- data->trigger_delay = ktime_set(2, 500L*1E6L);
|
||||
+ data->wde_interval = 300L * NSEC_PER_MSEC;
|
||||
+ data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
|
||||
|
||||
hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||
data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
|
||||
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
|
||||
index 5c36c430ce8b6..a2f56a68c50d6 100644
|
||||
--- a/drivers/power/supply/power_supply_core.c
|
||||
+++ b/drivers/power/supply/power_supply_core.c
|
||||
@@ -742,6 +742,10 @@ power_supply_find_ocv2cap_table(struct power_supply_battery_info *info,
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < POWER_SUPPLY_OCV_TEMP_MAX; i++) {
|
||||
+ /* Out of capacity tables */
|
||||
+ if (!info->ocv_table[i])
|
||||
+ break;
|
||||
+
|
||||
temp_diff = abs(info->ocv_temp[i] - temp);
|
||||
|
||||
if (temp_diff < best_temp_diff) {
|
||||
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
|
||||
index eeba6180711cd..f3cee64c6d12f 100644
|
||||
--- a/drivers/scsi/libiscsi.c
|
||||
+++ b/drivers/scsi/libiscsi.c
|
||||
@@ -2948,6 +2948,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||
{
|
||||
struct iscsi_conn *conn = cls_conn->dd_data;
|
||||
struct iscsi_session *session = conn->session;
|
||||
+ char *tmp_persistent_address = conn->persistent_address;
|
||||
+ char *tmp_local_ipaddr = conn->local_ipaddr;
|
||||
|
||||
del_timer_sync(&conn->transport_timer);
|
||||
|
||||
@@ -2969,8 +2971,6 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
free_pages((unsigned long) conn->data,
|
||||
get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
|
||||
- kfree(conn->persistent_address);
|
||||
- kfree(conn->local_ipaddr);
|
||||
/* regular RX path uses back_lock */
|
||||
spin_lock_bh(&session->back_lock);
|
||||
kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
|
||||
@@ -2982,6 +2982,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||
mutex_unlock(&session->eh_mutex);
|
||||
|
||||
iscsi_destroy_conn(cls_conn);
|
||||
+ kfree(tmp_persistent_address);
|
||||
+ kfree(tmp_local_ipaddr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iscsi_conn_teardown);
|
||||
|
||||
diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
|
||||
index 253c8b71d3c49..061da9b82b967 100644
|
||||
--- a/drivers/usb/mtu3/mtu3_gadget.c
|
||||
+++ b/drivers/usb/mtu3/mtu3_gadget.c
|
||||
@@ -85,7 +85,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
|
||||
if (usb_endpoint_xfer_int(desc) ||
|
||||
usb_endpoint_xfer_isoc(desc)) {
|
||||
interval = desc->bInterval;
|
||||
- interval = clamp_val(interval, 1, 16) - 1;
|
||||
+ interval = clamp_val(interval, 1, 16);
|
||||
if (usb_endpoint_xfer_isoc(desc) && comp_desc)
|
||||
mult = comp_desc->bmAttributes;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
|
||||
if (usb_endpoint_xfer_isoc(desc) ||
|
||||
usb_endpoint_xfer_int(desc)) {
|
||||
interval = desc->bInterval;
|
||||
- interval = clamp_val(interval, 1, 16) - 1;
|
||||
+ interval = clamp_val(interval, 1, 16);
|
||||
mult = usb_endpoint_maxp_mult(desc) - 1;
|
||||
}
|
||||
break;
|
||||
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
|
||||
index f7d27cbbeb860..03dce3980d90a 100644
|
||||
--- a/fs/f2fs/checkpoint.c
|
||||
+++ b/fs/f2fs/checkpoint.c
|
||||
@@ -1144,7 +1144,8 @@ static bool __need_flush_quota(struct f2fs_sb_info *sbi)
|
||||
if (!is_journalled_quota(sbi))
|
||||
return false;
|
||||
|
||||
- down_write(&sbi->quota_sem);
|
||||
+ if (!down_write_trylock(&sbi->quota_sem))
|
||||
+ return true;
|
||||
if (is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) {
|
||||
ret = false;
|
||||
} else if (is_sbi_flag_set(sbi, SBI_QUOTA_NEED_REPAIR)) {
|
||||
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
|
||||
index b3021d9b34a5e..7b7a009425e21 100644
|
||||
--- a/fs/xfs/xfs_ioctl.c
|
||||
+++ b/fs/xfs/xfs_ioctl.c
|
||||
@@ -714,7 +714,8 @@ xfs_ioc_space(
|
||||
flags |= XFS_PREALLOC_CLEAR;
|
||||
if (bf->l_start > XFS_ISIZE(ip)) {
|
||||
error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
|
||||
- bf->l_start - XFS_ISIZE(ip), 0);
|
||||
+ bf->l_start - XFS_ISIZE(ip),
|
||||
+ XFS_BMAPI_PREALLOC);
|
||||
if (error)
|
||||
goto out_unlock;
|
||||
}
|
||||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||
index 5240ba9a82db8..54f5b2f080f53 100644
|
||||
--- a/kernel/trace/trace.c
|
||||
+++ b/kernel/trace/trace.c
|
||||
@@ -3007,7 +3007,7 @@ struct trace_buffer_struct {
|
||||
char buffer[4][TRACE_BUF_SIZE];
|
||||
};
|
||||
|
||||
-static struct trace_buffer_struct *trace_percpu_buffer;
|
||||
+static struct trace_buffer_struct __percpu *trace_percpu_buffer;
|
||||
|
||||
/*
|
||||
* Thise allows for lockless recording. If we're nested too deeply, then
|
||||
@@ -3017,7 +3017,7 @@ static char *get_trace_buf(void)
|
||||
{
|
||||
struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
|
||||
|
||||
- if (!buffer || buffer->nesting >= 4)
|
||||
+ if (!trace_percpu_buffer || buffer->nesting >= 4)
|
||||
return NULL;
|
||||
|
||||
buffer->nesting++;
|
||||
@@ -3036,7 +3036,7 @@ static void put_trace_buf(void)
|
||||
|
||||
static int alloc_percpu_trace_buffer(void)
|
||||
{
|
||||
- struct trace_buffer_struct *buffers;
|
||||
+ struct trace_buffer_struct __percpu *buffers;
|
||||
|
||||
buffers = alloc_percpu(struct trace_buffer_struct);
|
||||
if (WARN(!buffers, "Could not allocate percpu trace_printk buffer"))
|
||||
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
|
||||
index f5bf931252c4b..09d81f9c2a649 100644
|
||||
--- a/net/batman-adv/multicast.c
|
||||
+++ b/net/batman-adv/multicast.c
|
||||
@@ -1373,6 +1373,7 @@ batadv_mcast_forw_rtr_node_get(struct batadv_priv *bat_priv,
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
* @skb: The multicast packet to check
|
||||
* @orig: an originator to be set to forward the skb to
|
||||
+ * @is_routable: stores whether the destination is routable
|
||||
*
|
||||
* Return: the forwarding mode as enum batadv_forw_mode and in case of
|
||||
* BATADV_FORW_SINGLE set the orig to the single originator the skb
|
||||
@@ -1380,17 +1381,16 @@ batadv_mcast_forw_rtr_node_get(struct batadv_priv *bat_priv,
|
||||
*/
|
||||
enum batadv_forw_mode
|
||||
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- struct batadv_orig_node **orig)
|
||||
+ struct batadv_orig_node **orig, int *is_routable)
|
||||
{
|
||||
int ret, tt_count, ip_count, unsnoop_count, total_count;
|
||||
bool is_unsnoopable = false;
|
||||
unsigned int mcast_fanout;
|
||||
struct ethhdr *ethhdr;
|
||||
- int is_routable = 0;
|
||||
int rtr_count = 0;
|
||||
|
||||
ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable,
|
||||
- &is_routable);
|
||||
+ is_routable);
|
||||
if (ret == -ENOMEM)
|
||||
return BATADV_FORW_NONE;
|
||||
else if (ret < 0)
|
||||
@@ -1403,7 +1403,7 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
ip_count = batadv_mcast_forw_want_all_ip_count(bat_priv, ethhdr);
|
||||
unsnoop_count = !is_unsnoopable ? 0 :
|
||||
atomic_read(&bat_priv->mcast.num_want_all_unsnoopables);
|
||||
- rtr_count = batadv_mcast_forw_rtr_count(bat_priv, is_routable);
|
||||
+ rtr_count = batadv_mcast_forw_rtr_count(bat_priv, *is_routable);
|
||||
|
||||
total_count = tt_count + ip_count + unsnoop_count + rtr_count;
|
||||
|
||||
@@ -1723,6 +1723,7 @@ batadv_mcast_forw_want_rtr(struct batadv_priv *bat_priv,
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
* @skb: the multicast packet to transmit
|
||||
* @vid: the vlan identifier
|
||||
+ * @is_routable: stores whether the destination is routable
|
||||
*
|
||||
* Sends copies of a frame with multicast destination to any node that signaled
|
||||
* interest in it, that is either via the translation table or the according
|
||||
@@ -1735,7 +1736,7 @@ batadv_mcast_forw_want_rtr(struct batadv_priv *bat_priv,
|
||||
* is neither IPv4 nor IPv6. NET_XMIT_SUCCESS otherwise.
|
||||
*/
|
||||
int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- unsigned short vid)
|
||||
+ unsigned short vid, int is_routable)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -1751,12 +1752,16 @@ int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ if (!is_routable)
|
||||
+ goto skip_mc_router;
|
||||
+
|
||||
ret = batadv_mcast_forw_want_rtr(bat_priv, skb, vid);
|
||||
if (ret != NET_XMIT_SUCCESS) {
|
||||
kfree_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+skip_mc_router:
|
||||
consume_skb(skb);
|
||||
return ret;
|
||||
}
|
||||
diff --git a/net/batman-adv/multicast.h b/net/batman-adv/multicast.h
|
||||
index 403929013ac47..fc1ffd22a6715 100644
|
||||
--- a/net/batman-adv/multicast.h
|
||||
+++ b/net/batman-adv/multicast.h
|
||||
@@ -44,7 +44,8 @@ enum batadv_forw_mode {
|
||||
|
||||
enum batadv_forw_mode
|
||||
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- struct batadv_orig_node **mcast_single_orig);
|
||||
+ struct batadv_orig_node **mcast_single_orig,
|
||||
+ int *is_routable);
|
||||
|
||||
int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
|
||||
struct sk_buff *skb,
|
||||
@@ -52,7 +53,7 @@ int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
|
||||
struct batadv_orig_node *orig_node);
|
||||
|
||||
int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- unsigned short vid);
|
||||
+ unsigned short vid, int is_routable);
|
||||
|
||||
void batadv_mcast_init(struct batadv_priv *bat_priv);
|
||||
|
||||
@@ -71,7 +72,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node);
|
||||
|
||||
static inline enum batadv_forw_mode
|
||||
batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- struct batadv_orig_node **mcast_single_orig)
|
||||
+ struct batadv_orig_node **mcast_single_orig,
|
||||
+ int *is_routable)
|
||||
{
|
||||
return BATADV_FORW_ALL;
|
||||
}
|
||||
@@ -88,7 +90,7 @@ batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
|
||||
|
||||
static inline int
|
||||
batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
- unsigned short vid)
|
||||
+ unsigned short vid, int is_routable)
|
||||
{
|
||||
kfree_skb(skb);
|
||||
return NET_XMIT_DROP;
|
||||
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
|
||||
index 7f209390069ea..504e3cb67bed4 100644
|
||||
--- a/net/batman-adv/soft-interface.c
|
||||
+++ b/net/batman-adv/soft-interface.c
|
||||
@@ -200,6 +200,7 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
|
||||
int gw_mode;
|
||||
enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE;
|
||||
struct batadv_orig_node *mcast_single_orig = NULL;
|
||||
+ int mcast_is_routable = 0;
|
||||
int network_offset = ETH_HLEN;
|
||||
__be16 proto;
|
||||
|
||||
@@ -302,7 +303,8 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
|
||||
send:
|
||||
if (do_bcast && !is_broadcast_ether_addr(ethhdr->h_dest)) {
|
||||
forw_mode = batadv_mcast_forw_mode(bat_priv, skb,
|
||||
- &mcast_single_orig);
|
||||
+ &mcast_single_orig,
|
||||
+ &mcast_is_routable);
|
||||
if (forw_mode == BATADV_FORW_NONE)
|
||||
goto dropped;
|
||||
|
||||
@@ -367,7 +369,8 @@ send:
|
||||
ret = batadv_mcast_forw_send_orig(bat_priv, skb, vid,
|
||||
mcast_single_orig);
|
||||
} else if (forw_mode == BATADV_FORW_SOME) {
|
||||
- ret = batadv_mcast_forw_send(bat_priv, skb, vid);
|
||||
+ ret = batadv_mcast_forw_send(bat_priv, skb, vid,
|
||||
+ mcast_is_routable);
|
||||
} else {
|
||||
if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
|
||||
skb))
|
||||
diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
|
||||
index 2f9c0de533c75..0b64f015b3b0b 100644
|
||||
--- a/net/core/lwtunnel.c
|
||||
+++ b/net/core/lwtunnel.c
|
||||
@@ -190,6 +190,10 @@ int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int remaining,
|
||||
nla_entype = nla_find(attrs, attrlen, RTA_ENCAP_TYPE);
|
||||
|
||||
if (nla_entype) {
|
||||
+ if (nla_len(nla_entype) < sizeof(u16)) {
|
||||
+ NL_SET_ERR_MSG(extack, "Invalid RTA_ENCAP_TYPE");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
encap_type = nla_get_u16(nla_entype);
|
||||
|
||||
if (lwtunnel_valid_encap_type(encap_type,
|
||||
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
|
||||
index c0b8154205237..ce4b28f011485 100644
|
||||
--- a/net/ipv4/fib_semantics.c
|
||||
+++ b/net/ipv4/fib_semantics.c
|
||||
@@ -654,6 +654,19 @@ static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining,
|
||||
return nhs;
|
||||
}
|
||||
|
||||
+static int fib_gw_from_attr(__be32 *gw, struct nlattr *nla,
|
||||
+ struct netlink_ext_ack *extack)
|
||||
+{
|
||||
+ if (nla_len(nla) < sizeof(*gw)) {
|
||||
+ NL_SET_ERR_MSG(extack, "Invalid IPv4 address in RTA_GATEWAY");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ *gw = nla_get_in_addr(nla);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* only called when fib_nh is integrated into fib_info */
|
||||
static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
|
||||
int remaining, struct fib_config *cfg,
|
||||
@@ -696,7 +709,11 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
|
||||
return -EINVAL;
|
||||
}
|
||||
if (nla) {
|
||||
- fib_cfg.fc_gw4 = nla_get_in_addr(nla);
|
||||
+ ret = fib_gw_from_attr(&fib_cfg.fc_gw4, nla,
|
||||
+ extack);
|
||||
+ if (ret)
|
||||
+ goto errout;
|
||||
+
|
||||
if (fib_cfg.fc_gw4)
|
||||
fib_cfg.fc_gw_family = AF_INET;
|
||||
} else if (nlav) {
|
||||
@@ -706,10 +723,18 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
|
||||
}
|
||||
|
||||
nla = nla_find(attrs, attrlen, RTA_FLOW);
|
||||
- if (nla)
|
||||
+ if (nla) {
|
||||
+ if (nla_len(nla) < sizeof(u32)) {
|
||||
+ NL_SET_ERR_MSG(extack, "Invalid RTA_FLOW");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
fib_cfg.fc_flow = nla_get_u32(nla);
|
||||
+ }
|
||||
|
||||
fib_cfg.fc_encap = nla_find(attrs, attrlen, RTA_ENCAP);
|
||||
+ /* RTA_ENCAP_TYPE length checked in
|
||||
+ * lwtunnel_valid_encap_type_attr
|
||||
+ */
|
||||
nla = nla_find(attrs, attrlen, RTA_ENCAP_TYPE);
|
||||
if (nla)
|
||||
fib_cfg.fc_encap_type = nla_get_u16(nla);
|
||||
@@ -894,6 +919,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi,
|
||||
attrlen = rtnh_attrlen(rtnh);
|
||||
if (attrlen > 0) {
|
||||
struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh);
|
||||
+ int err;
|
||||
|
||||
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
|
||||
nlav = nla_find(attrs, attrlen, RTA_VIA);
|
||||
@@ -904,12 +930,17 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi,
|
||||
}
|
||||
|
||||
if (nla) {
|
||||
+ __be32 gw;
|
||||
+
|
||||
+ err = fib_gw_from_attr(&gw, nla, extack);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
if (nh->fib_nh_gw_family != AF_INET ||
|
||||
- nla_get_in_addr(nla) != nh->fib_nh_gw4)
|
||||
+ gw != nh->fib_nh_gw4)
|
||||
return 1;
|
||||
} else if (nlav) {
|
||||
struct fib_config cfg2;
|
||||
- int err;
|
||||
|
||||
err = fib_gw_from_via(&cfg2, nlav, extack);
|
||||
if (err)
|
||||
@@ -932,8 +963,14 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi,
|
||||
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
nla = nla_find(attrs, attrlen, RTA_FLOW);
|
||||
- if (nla && nla_get_u32(nla) != nh->nh_tclassid)
|
||||
- return 1;
|
||||
+ if (nla) {
|
||||
+ if (nla_len(nla) < sizeof(u32)) {
|
||||
+ NL_SET_ERR_MSG(extack, "Invalid RTA_FLOW");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ if (nla_get_u32(nla) != nh->nh_tclassid)
|
||||
+ return 1;
|
||||
+ }
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
|
||||
index a0016f05c4f86..3cdf011a8dd8d 100644
|
||||
--- a/net/ipv4/udp.c
|
||||
+++ b/net/ipv4/udp.c
|
||||
@@ -2943,7 +2943,7 @@ int udp4_seq_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
seq_setwidth(seq, 127);
|
||||
if (v == SEQ_START_TOKEN)
|
||||
- seq_puts(seq, " sl local_address rem_address st tx_queue "
|
||||
+ seq_puts(seq, " sl local_address rem_address st tx_queue "
|
||||
"rx_queue tr tm->when retrnsmt uid timeout "
|
||||
"inode ref pointer drops");
|
||||
else {
|
||||
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
|
||||
index 12ab6605d9617..8b44d3b53844e 100644
|
||||
--- a/net/ipv6/ip6_vti.c
|
||||
+++ b/net/ipv6/ip6_vti.c
|
||||
@@ -795,6 +795,8 @@ vti6_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
struct net *net = dev_net(dev);
|
||||
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
|
||||
|
||||
+ memset(&p1, 0, sizeof(p1));
|
||||
+
|
||||
switch (cmd) {
|
||||
case SIOCGETTUNNEL:
|
||||
if (dev == ip6n->fb_tnl_dev) {
|
||||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
|
||||
index f36db3dd97346..5ef6e27e026e9 100644
|
||||
--- a/net/ipv6/route.c
|
||||
+++ b/net/ipv6/route.c
|
||||
@@ -5092,6 +5092,19 @@ static void ip6_route_mpath_notify(struct fib6_info *rt,
|
||||
inet6_rt_notify(RTM_NEWROUTE, rt, info, nlflags);
|
||||
}
|
||||
|
||||
+static int fib6_gw_from_attr(struct in6_addr *gw, struct nlattr *nla,
|
||||
+ struct netlink_ext_ack *extack)
|
||||
+{
|
||||
+ if (nla_len(nla) < sizeof(*gw)) {
|
||||
+ NL_SET_ERR_MSG(extack, "Invalid IPv6 address in RTA_GATEWAY");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ *gw = nla_get_in6_addr(nla);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int ip6_route_multipath_add(struct fib6_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
@@ -5133,10 +5146,18 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
|
||||
|
||||
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
|
||||
if (nla) {
|
||||
- r_cfg.fc_gateway = nla_get_in6_addr(nla);
|
||||
+ err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
|
||||
+ extack);
|
||||
+ if (err)
|
||||
+ goto cleanup;
|
||||
+
|
||||
r_cfg.fc_flags |= RTF_GATEWAY;
|
||||
}
|
||||
r_cfg.fc_encap = nla_find(attrs, attrlen, RTA_ENCAP);
|
||||
+
|
||||
+ /* RTA_ENCAP_TYPE length checked in
|
||||
+ * lwtunnel_valid_encap_type_attr
|
||||
+ */
|
||||
nla = nla_find(attrs, attrlen, RTA_ENCAP_TYPE);
|
||||
if (nla)
|
||||
r_cfg.fc_encap_type = nla_get_u16(nla);
|
||||
@@ -5288,7 +5309,13 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
|
||||
|
||||
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
|
||||
if (nla) {
|
||||
- nla_memcpy(&r_cfg.fc_gateway, nla, 16);
|
||||
+ err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
|
||||
+ extack);
|
||||
+ if (err) {
|
||||
+ last_err = err;
|
||||
+ goto next_rtnh;
|
||||
+ }
|
||||
+
|
||||
r_cfg.fc_flags |= RTF_GATEWAY;
|
||||
}
|
||||
}
|
||||
@@ -5296,6 +5323,7 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
|
||||
if (err)
|
||||
last_err = err;
|
||||
|
||||
+next_rtnh:
|
||||
rtnh = rtnh_next(rtnh, &remaining);
|
||||
}
|
||||
|
||||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
|
||||
index 5c727af01143f..ad00f31e20023 100644
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -4953,7 +4953,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
|
||||
*/
|
||||
if (new_sta) {
|
||||
u32 rates = 0, basic_rates = 0;
|
||||
- bool have_higher_than_11mbit;
|
||||
+ bool have_higher_than_11mbit = false;
|
||||
int min_rate = INT_MAX, min_rate_index = -1;
|
||||
const struct cfg80211_bss_ies *ies;
|
||||
int shift = ieee80211_vif_get_shift(&sdata->vif);
|
||||
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
|
||||
index a07e13f63332c..0c5d0f7b8b4bb 100644
|
||||
--- a/net/phonet/pep.c
|
||||
+++ b/net/phonet/pep.c
|
||||
@@ -868,6 +868,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
|
||||
|
||||
err = pep_accept_conn(newsk, skb);
|
||||
if (err) {
|
||||
+ __sock_put(sk);
|
||||
sock_put(newsk);
|
||||
newsk = NULL;
|
||||
goto drop;
|
||||
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
|
||||
index b046fd3cac2cf..1eb339d224ae5 100644
|
||||
--- a/net/sched/sch_qfq.c
|
||||
+++ b/net/sched/sch_qfq.c
|
||||
@@ -1421,10 +1421,8 @@ static int qfq_init_qdisc(struct Qdisc *sch, struct nlattr *opt,
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
- if (qdisc_dev(sch)->tx_queue_len + 1 > QFQ_MAX_AGG_CLASSES)
|
||||
- max_classes = QFQ_MAX_AGG_CLASSES;
|
||||
- else
|
||||
- max_classes = qdisc_dev(sch)->tx_queue_len + 1;
|
||||
+ max_classes = min_t(u64, (u64)qdisc_dev(sch)->tx_queue_len + 1,
|
||||
+ QFQ_MAX_AGG_CLASSES);
|
||||
/* max_cl_shift = floor(log_2(max_classes)) */
|
||||
max_cl_shift = __fls(max_classes);
|
||||
q->max_agg_classes = 1<<max_cl_shift;
|
||||
diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c
|
||||
index a4f4d4cf22c3b..d0752a0a8f362 100644
|
||||
--- a/tools/testing/selftests/x86/test_vsyscall.c
|
||||
+++ b/tools/testing/selftests/x86/test_vsyscall.c
|
||||
@@ -480,7 +480,7 @@ static int test_process_vm_readv(void)
|
||||
}
|
||||
|
||||
if (vsyscall_map_r) {
|
||||
- if (!memcmp(buf, (const void *)0xffffffffff600000, 4096)) {
|
||||
+ if (!memcmp(buf, remote.iov_base, sizeof(buf))) {
|
||||
printf("[OK]\tIt worked and read correct data\n");
|
||||
} else {
|
||||
printf("[FAIL]\tIt worked but returned incorrect data\n");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,788 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 2f914dd223c81..cb9e6cd0d0249 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 172
|
||||
+SUBLEVEL = 173
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
@@ -1022,7 +1022,7 @@ HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
|
||||
|
||||
ifdef CONFIG_STACK_VALIDATION
|
||||
has_libelf := $(call try-run,\
|
||||
- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
|
||||
+ echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
|
||||
ifeq ($(has_libelf),1)
|
||||
objtool_target := tools/objtool FORCE
|
||||
else
|
||||
diff --git a/arch/arm/kernel/perf_callchain.c b/arch/arm/kernel/perf_callchain.c
|
||||
index 3b69a76d341e7..1626dfc6f6ce6 100644
|
||||
--- a/arch/arm/kernel/perf_callchain.c
|
||||
+++ b/arch/arm/kernel/perf_callchain.c
|
||||
@@ -62,9 +62,10 @@ user_backtrace(struct frame_tail __user *tail,
|
||||
void
|
||||
perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct frame_tail __user *tail;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -98,9 +99,10 @@ callchain_trace(struct stackframe *fr,
|
||||
void
|
||||
perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct stackframe fr;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -111,18 +113,21 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
|
||||
|
||||
unsigned long perf_instruction_pointer(struct pt_regs *regs)
|
||||
{
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
- return perf_guest_cbs->get_guest_ip();
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
+ return guest_cbs->get_guest_ip();
|
||||
|
||||
return instruction_pointer(regs);
|
||||
}
|
||||
|
||||
unsigned long perf_misc_flags(struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
int misc = 0;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
- if (perf_guest_cbs->is_user_mode())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs->is_user_mode())
|
||||
misc |= PERF_RECORD_MISC_GUEST_USER;
|
||||
else
|
||||
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
|
||||
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
|
||||
index fc388eb60e0b7..64cce0c8560ab 100644
|
||||
--- a/arch/arm/mm/Kconfig
|
||||
+++ b/arch/arm/mm/Kconfig
|
||||
@@ -743,6 +743,7 @@ config SWP_EMULATE
|
||||
config CPU_BIG_ENDIAN
|
||||
bool "Build big-endian kernel"
|
||||
depends on ARCH_SUPPORTS_BIG_ENDIAN
|
||||
+ depends on !LD_IS_LLD
|
||||
help
|
||||
Say Y if you plan on running a kernel in big-endian mode.
|
||||
Note that your board must be properly built and your board
|
||||
diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c
|
||||
index b0e03e052dd1d..b84ec4ce7d8dc 100644
|
||||
--- a/arch/arm64/kernel/perf_callchain.c
|
||||
+++ b/arch/arm64/kernel/perf_callchain.c
|
||||
@@ -102,7 +102,9 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
|
||||
void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -147,9 +149,10 @@ static int callchain_trace(struct stackframe *frame, void *data)
|
||||
void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct stackframe frame;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -160,18 +163,21 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
|
||||
unsigned long perf_instruction_pointer(struct pt_regs *regs)
|
||||
{
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
- return perf_guest_cbs->get_guest_ip();
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
+ return guest_cbs->get_guest_ip();
|
||||
|
||||
return instruction_pointer(regs);
|
||||
}
|
||||
|
||||
unsigned long perf_misc_flags(struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
int misc = 0;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
- if (perf_guest_cbs->is_user_mode())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs->is_user_mode())
|
||||
misc |= PERF_RECORD_MISC_GUEST_USER;
|
||||
else
|
||||
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
|
||||
diff --git a/arch/csky/kernel/perf_callchain.c b/arch/csky/kernel/perf_callchain.c
|
||||
index ab55e98ee8f62..35318a635a5fa 100644
|
||||
--- a/arch/csky/kernel/perf_callchain.c
|
||||
+++ b/arch/csky/kernel/perf_callchain.c
|
||||
@@ -86,10 +86,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
|
||||
void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
unsigned long fp = 0;
|
||||
|
||||
/* C-SKY does not support virtualization. */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
return;
|
||||
|
||||
fp = regs->regs[4];
|
||||
@@ -110,10 +111,11 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct stackframe fr;
|
||||
|
||||
/* C-SKY does not support virtualization. */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
pr_warn("C-SKY does not support perf in guest mode!");
|
||||
return;
|
||||
}
|
||||
diff --git a/arch/nds32/kernel/perf_event_cpu.c b/arch/nds32/kernel/perf_event_cpu.c
|
||||
index 334c2a6cec23d..8a4f9babb1646 100644
|
||||
--- a/arch/nds32/kernel/perf_event_cpu.c
|
||||
+++ b/arch/nds32/kernel/perf_event_cpu.c
|
||||
@@ -1363,6 +1363,7 @@ void
|
||||
perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
unsigned long fp = 0;
|
||||
unsigned long gp = 0;
|
||||
unsigned long lp = 0;
|
||||
@@ -1371,7 +1372,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
|
||||
leaf_fp = 0;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -1479,9 +1480,10 @@ void
|
||||
perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct stackframe fr;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -1493,20 +1495,23 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
|
||||
unsigned long perf_instruction_pointer(struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
/* However, NDS32 does not support virtualization */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
- return perf_guest_cbs->get_guest_ip();
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
+ return guest_cbs->get_guest_ip();
|
||||
|
||||
return instruction_pointer(regs);
|
||||
}
|
||||
|
||||
unsigned long perf_misc_flags(struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
int misc = 0;
|
||||
|
||||
/* However, NDS32 does not support virtualization */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
- if (perf_guest_cbs->is_user_mode())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs->is_user_mode())
|
||||
misc |= PERF_RECORD_MISC_GUEST_USER;
|
||||
else
|
||||
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
|
||||
diff --git a/arch/riscv/kernel/perf_callchain.c b/arch/riscv/kernel/perf_callchain.c
|
||||
index 8d2804f05cf93..22a93009362d7 100644
|
||||
--- a/arch/riscv/kernel/perf_callchain.c
|
||||
+++ b/arch/riscv/kernel/perf_callchain.c
|
||||
@@ -60,10 +60,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
|
||||
void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
unsigned long fp = 0;
|
||||
|
||||
/* RISC-V does not support perf in guest mode. */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
return;
|
||||
|
||||
fp = regs->s0;
|
||||
@@ -84,8 +85,10 @@ void notrace walk_stackframe(struct task_struct *task,
|
||||
void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
/* RISC-V does not support perf in guest mode. */
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
pr_warn("RISC-V does not support perf in guest mode!");
|
||||
return;
|
||||
}
|
||||
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
|
||||
index fd73a8aa89d23..8be5750fe5ac3 100644
|
||||
--- a/arch/s390/kvm/interrupt.c
|
||||
+++ b/arch/s390/kvm/interrupt.c
|
||||
@@ -1982,6 +1982,13 @@ int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu)
|
||||
return test_bit(IRQ_PEND_SIGP_STOP, &li->pending_irqs);
|
||||
}
|
||||
|
||||
+int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu)
|
||||
+{
|
||||
+ struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
|
||||
+
|
||||
+ return test_bit(IRQ_PEND_RESTART, &li->pending_irqs);
|
||||
+}
|
||||
+
|
||||
void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
|
||||
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
|
||||
index b286818d8d54d..49dc00d82e5ea 100644
|
||||
--- a/arch/s390/kvm/kvm-s390.c
|
||||
+++ b/arch/s390/kvm/kvm-s390.c
|
||||
@@ -4205,10 +4205,15 @@ void kvm_s390_vcpu_stop(struct kvm_vcpu *vcpu)
|
||||
spin_lock(&vcpu->kvm->arch.start_stop_lock);
|
||||
online_vcpus = atomic_read(&vcpu->kvm->online_vcpus);
|
||||
|
||||
- /* SIGP STOP and SIGP STOP AND STORE STATUS has been fully processed */
|
||||
+ /*
|
||||
+ * Set the VCPU to STOPPED and THEN clear the interrupt flag,
|
||||
+ * now that the SIGP STOP and SIGP STOP AND STORE STATUS orders
|
||||
+ * have been fully processed. This will ensure that the VCPU
|
||||
+ * is kept BUSY if another VCPU is inquiring with SIGP SENSE.
|
||||
+ */
|
||||
+ kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
|
||||
kvm_s390_clear_stop_irq(vcpu);
|
||||
|
||||
- kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
|
||||
__disable_ibs_on_vcpu(vcpu);
|
||||
|
||||
for (i = 0; i < online_vcpus; i++) {
|
||||
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
|
||||
index 63d94a5253a8f..d497d3e58784b 100644
|
||||
--- a/arch/s390/kvm/kvm-s390.h
|
||||
+++ b/arch/s390/kvm/kvm-s390.h
|
||||
@@ -373,6 +373,7 @@ void kvm_s390_destroy_adapters(struct kvm *kvm);
|
||||
int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu);
|
||||
extern struct kvm_device_ops kvm_flic_ops;
|
||||
int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu);
|
||||
+int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu);
|
||||
void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu);
|
||||
int kvm_s390_set_irq_state(struct kvm_vcpu *vcpu,
|
||||
void __user *buf, int len);
|
||||
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
|
||||
index 683036c1c92a8..3dc921e853b6e 100644
|
||||
--- a/arch/s390/kvm/sigp.c
|
||||
+++ b/arch/s390/kvm/sigp.c
|
||||
@@ -288,6 +288,34 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
|
||||
if (!dst_vcpu)
|
||||
return SIGP_CC_NOT_OPERATIONAL;
|
||||
|
||||
+ /*
|
||||
+ * SIGP RESTART, SIGP STOP, and SIGP STOP AND STORE STATUS orders
|
||||
+ * are processed asynchronously. Until the affected VCPU finishes
|
||||
+ * its work and calls back into KVM to clear the (RESTART or STOP)
|
||||
+ * interrupt, we need to return any new non-reset orders "busy".
|
||||
+ *
|
||||
+ * This is important because a single VCPU could issue:
|
||||
+ * 1) SIGP STOP $DESTINATION
|
||||
+ * 2) SIGP SENSE $DESTINATION
|
||||
+ *
|
||||
+ * If the SIGP SENSE would not be rejected as "busy", it could
|
||||
+ * return an incorrect answer as to whether the VCPU is STOPPED
|
||||
+ * or OPERATING.
|
||||
+ */
|
||||
+ if (order_code != SIGP_INITIAL_CPU_RESET &&
|
||||
+ order_code != SIGP_CPU_RESET) {
|
||||
+ /*
|
||||
+ * Lockless check. Both SIGP STOP and SIGP (RE)START
|
||||
+ * properly synchronize everything while processing
|
||||
+ * their orders, while the guest cannot observe a
|
||||
+ * difference when issuing other orders from two
|
||||
+ * different VCPUs.
|
||||
+ */
|
||||
+ if (kvm_s390_is_stop_irq_pending(dst_vcpu) ||
|
||||
+ kvm_s390_is_restart_irq_pending(dst_vcpu))
|
||||
+ return SIGP_CC_BUSY;
|
||||
+ }
|
||||
+
|
||||
switch (order_code) {
|
||||
case SIGP_SENSE:
|
||||
vcpu->stat.instruction_sigp_sense++;
|
||||
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
|
||||
index 00bccb4d17722..e4f7ac28dcf2b 100644
|
||||
--- a/arch/x86/events/core.c
|
||||
+++ b/arch/x86/events/core.c
|
||||
@@ -2366,10 +2366,11 @@ static bool perf_hw_regs(struct pt_regs *regs)
|
||||
void
|
||||
perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct unwind_state state;
|
||||
unsigned long addr;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* TODO: We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -2475,10 +2476,11 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent
|
||||
void
|
||||
perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
struct stack_frame frame;
|
||||
const unsigned long __user *fp;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
/* TODO: We don't support guest os callchain now */
|
||||
return;
|
||||
}
|
||||
@@ -2562,18 +2564,21 @@ static unsigned long code_segment_base(struct pt_regs *regs)
|
||||
|
||||
unsigned long perf_instruction_pointer(struct pt_regs *regs)
|
||||
{
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
|
||||
- return perf_guest_cbs->get_guest_ip();
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
+
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest())
|
||||
+ return guest_cbs->get_guest_ip();
|
||||
|
||||
return regs->ip + code_segment_base(regs);
|
||||
}
|
||||
|
||||
unsigned long perf_misc_flags(struct pt_regs *regs)
|
||||
{
|
||||
+ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
|
||||
int misc = 0;
|
||||
|
||||
- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
||||
- if (perf_guest_cbs->is_user_mode())
|
||||
+ if (guest_cbs && guest_cbs->is_in_guest()) {
|
||||
+ if (guest_cbs->is_user_mode())
|
||||
misc |= PERF_RECORD_MISC_GUEST_USER;
|
||||
else
|
||||
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
|
||||
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
|
||||
index 70758f99c9e47..b33540e1efa88 100644
|
||||
--- a/arch/x86/events/intel/core.c
|
||||
+++ b/arch/x86/events/intel/core.c
|
||||
@@ -2333,6 +2333,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
|
||||
{
|
||||
struct perf_sample_data data;
|
||||
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
|
||||
+ struct perf_guest_info_callbacks *guest_cbs;
|
||||
int bit;
|
||||
int handled = 0;
|
||||
|
||||
@@ -2386,9 +2387,11 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
|
||||
*/
|
||||
if (__test_and_clear_bit(55, (unsigned long *)&status)) {
|
||||
handled++;
|
||||
- if (unlikely(perf_guest_cbs && perf_guest_cbs->is_in_guest() &&
|
||||
- perf_guest_cbs->handle_intel_pt_intr))
|
||||
- perf_guest_cbs->handle_intel_pt_intr();
|
||||
+
|
||||
+ guest_cbs = perf_get_guest_cbs();
|
||||
+ if (unlikely(guest_cbs && guest_cbs->is_in_guest() &&
|
||||
+ guest_cbs->handle_intel_pt_intr))
|
||||
+ guest_cbs->handle_intel_pt_intr();
|
||||
else
|
||||
intel_pt_interrupt();
|
||||
}
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index 0aaf40be956ff..1f7dfa5aa42da 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -1218,7 +1218,7 @@ static const u32 msrs_to_save_all[] = {
|
||||
MSR_IA32_UMWAIT_CONTROL,
|
||||
|
||||
MSR_ARCH_PERFMON_FIXED_CTR0, MSR_ARCH_PERFMON_FIXED_CTR1,
|
||||
- MSR_ARCH_PERFMON_FIXED_CTR0 + 2, MSR_ARCH_PERFMON_FIXED_CTR0 + 3,
|
||||
+ MSR_ARCH_PERFMON_FIXED_CTR0 + 2,
|
||||
MSR_CORE_PERF_FIXED_CTR_CTRL, MSR_CORE_PERF_GLOBAL_STATUS,
|
||||
MSR_CORE_PERF_GLOBAL_CTRL, MSR_CORE_PERF_GLOBAL_OVF_CTRL,
|
||||
MSR_ARCH_PERFMON_PERFCTR0, MSR_ARCH_PERFMON_PERFCTR1,
|
||||
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
|
||||
index 30d0523014e0d..5e9b00711357b 100644
|
||||
--- a/drivers/base/devtmpfs.c
|
||||
+++ b/drivers/base/devtmpfs.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kthread.h>
|
||||
+#include <linux/fs_context.h>
|
||||
#include <uapi/linux/mount.h>
|
||||
#include "base.h"
|
||||
|
||||
@@ -62,8 +63,15 @@ static struct dentry *public_dev_mount(struct file_system_type *fs_type, int fla
|
||||
const char *dev_name, void *data)
|
||||
{
|
||||
struct super_block *s = mnt->mnt_sb;
|
||||
+ int err;
|
||||
+
|
||||
atomic_inc(&s->s_active);
|
||||
down_write(&s->s_umount);
|
||||
+ err = reconfigure_single(s, flags, data);
|
||||
+ if (err < 0) {
|
||||
+ deactivate_locked_super(s);
|
||||
+ return ERR_PTR(err);
|
||||
+ }
|
||||
return dget(s->s_root);
|
||||
}
|
||||
|
||||
diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
|
||||
index 59db70fb45614..314b9bb78e437 100644
|
||||
--- a/drivers/firmware/qemu_fw_cfg.c
|
||||
+++ b/drivers/firmware/qemu_fw_cfg.c
|
||||
@@ -385,9 +385,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
|
||||
struct fw_cfg_sysfs_entry *entry, *next;
|
||||
|
||||
list_for_each_entry_safe(entry, next, &fw_cfg_entry_cache, list) {
|
||||
- /* will end up invoking fw_cfg_sysfs_cache_delist()
|
||||
- * via each object's release() method (i.e. destructor)
|
||||
- */
|
||||
+ fw_cfg_sysfs_cache_delist(entry);
|
||||
kobject_put(&entry->kobj);
|
||||
}
|
||||
}
|
||||
@@ -445,7 +443,6 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
|
||||
{
|
||||
struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
|
||||
|
||||
- fw_cfg_sysfs_cache_delist(entry);
|
||||
kfree(entry);
|
||||
}
|
||||
|
||||
@@ -598,20 +595,18 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||
/* set file entry information */
|
||||
entry->size = be32_to_cpu(f->size);
|
||||
entry->select = be16_to_cpu(f->select);
|
||||
- memcpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
|
||||
+ strscpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
|
||||
|
||||
/* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
|
||||
err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
|
||||
fw_cfg_sel_ko, "%d", entry->select);
|
||||
- if (err) {
|
||||
- kobject_put(&entry->kobj);
|
||||
- return err;
|
||||
- }
|
||||
+ if (err)
|
||||
+ goto err_put_entry;
|
||||
|
||||
/* add raw binary content access */
|
||||
err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
|
||||
if (err)
|
||||
- goto err_add_raw;
|
||||
+ goto err_del_entry;
|
||||
|
||||
/* try adding "/sys/firmware/qemu_fw_cfg/by_name/" symlink */
|
||||
fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->name);
|
||||
@@ -620,9 +615,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||
fw_cfg_sysfs_cache_enlist(entry);
|
||||
return 0;
|
||||
|
||||
-err_add_raw:
|
||||
+err_del_entry:
|
||||
kobject_del(&entry->kobj);
|
||||
- kfree(entry);
|
||||
+err_put_entry:
|
||||
+ kobject_put(&entry->kobj);
|
||||
return err;
|
||||
}
|
||||
|
||||
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
|
||||
index 96b85d66e7a87..fe58723fc5ac7 100644
|
||||
--- a/drivers/media/usb/uvc/uvc_video.c
|
||||
+++ b/drivers/media/usb/uvc/uvc_video.c
|
||||
@@ -1915,6 +1915,10 @@ static int uvc_video_start_transfer(struct uvc_streaming *stream,
|
||||
if (ep == NULL)
|
||||
return -EIO;
|
||||
|
||||
+ /* Reject broken descriptors. */
|
||||
+ if (usb_endpoint_maxp(&ep->desc) == 0)
|
||||
+ return -EIO;
|
||||
+
|
||||
ret = uvc_init_video_bulk(stream, ep, gfp_flags);
|
||||
}
|
||||
|
||||
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
|
||||
index a7e47e068ad9b..7769a9b556c70 100644
|
||||
--- a/drivers/mtd/chips/Kconfig
|
||||
+++ b/drivers/mtd/chips/Kconfig
|
||||
@@ -55,12 +55,14 @@ choice
|
||||
LITTLE_ENDIAN_BYTE, if the bytes are reversed.
|
||||
|
||||
config MTD_CFI_NOSWAP
|
||||
+ depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN
|
||||
bool "NO"
|
||||
|
||||
config MTD_CFI_BE_BYTE_SWAP
|
||||
bool "BIG_ENDIAN_BYTE"
|
||||
|
||||
config MTD_CFI_LE_BYTE_SWAP
|
||||
+ depends on !ARCH_IXP4XX
|
||||
bool "LITTLE_ENDIAN_BYTE"
|
||||
|
||||
endchoice
|
||||
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
|
||||
index bc82305ebb4c2..ffbf4f6cb9cfe 100644
|
||||
--- a/drivers/mtd/maps/Kconfig
|
||||
+++ b/drivers/mtd/maps/Kconfig
|
||||
@@ -303,7 +303,7 @@ config MTD_DC21285
|
||||
|
||||
config MTD_IXP4XX
|
||||
tristate "CFI Flash device mapped on Intel IXP4xx based systems"
|
||||
- depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
|
||||
+ depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS
|
||||
help
|
||||
This enables MTD access to flash devices on platforms based
|
||||
on Intel's IXP4xx family of network processors such as the
|
||||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
|
||||
index f070f25bb735a..df7a14320fd29 100644
|
||||
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
|
||||
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
|
||||
@@ -1000,6 +1000,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
|
||||
_initpabias(hw);
|
||||
rtl92c_dm_init(hw);
|
||||
exit:
|
||||
+ local_irq_disable();
|
||||
local_irq_restore(flags);
|
||||
return err;
|
||||
}
|
||||
diff --git a/fs/fs_context.c b/fs/fs_context.c
|
||||
index 138b5b4d621d2..a2367c7aef5b3 100644
|
||||
--- a/fs/fs_context.c
|
||||
+++ b/fs/fs_context.c
|
||||
@@ -585,7 +585,7 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
|
||||
param->key);
|
||||
}
|
||||
|
||||
- if (len > PAGE_SIZE - 2 - size)
|
||||
+ if (size + len + 2 > PAGE_SIZE)
|
||||
return invalf(fc, "VFS: Legacy: Cumulative options too large");
|
||||
if (strchr(param->key, ',') ||
|
||||
(param->type == fs_value_is_string &&
|
||||
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
|
||||
index 2bb916d68576f..023b9bc54b7ce 100644
|
||||
--- a/fs/orangefs/orangefs-bufmap.c
|
||||
+++ b/fs/orangefs/orangefs-bufmap.c
|
||||
@@ -179,7 +179,7 @@ orangefs_bufmap_free(struct orangefs_bufmap *bufmap)
|
||||
{
|
||||
kfree(bufmap->page_array);
|
||||
kfree(bufmap->desc_array);
|
||||
- kfree(bufmap->buffer_index_array);
|
||||
+ bitmap_free(bufmap->buffer_index_array);
|
||||
kfree(bufmap);
|
||||
}
|
||||
|
||||
@@ -229,8 +229,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
|
||||
bufmap->desc_size = user_desc->size;
|
||||
bufmap->desc_shift = ilog2(bufmap->desc_size);
|
||||
|
||||
- bufmap->buffer_index_array =
|
||||
- kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL);
|
||||
+ bufmap->buffer_index_array = bitmap_zalloc(bufmap->desc_count, GFP_KERNEL);
|
||||
if (!bufmap->buffer_index_array)
|
||||
goto out_free_bufmap;
|
||||
|
||||
@@ -253,7 +252,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
|
||||
out_free_desc_array:
|
||||
kfree(bufmap->desc_array);
|
||||
out_free_index_array:
|
||||
- kfree(bufmap->buffer_index_array);
|
||||
+ bitmap_free(bufmap->buffer_index_array);
|
||||
out_free_bufmap:
|
||||
kfree(bufmap);
|
||||
out:
|
||||
diff --git a/fs/super.c b/fs/super.c
|
||||
index 877532baf513d..b289356f302fc 100644
|
||||
--- a/fs/super.c
|
||||
+++ b/fs/super.c
|
||||
@@ -1470,8 +1470,8 @@ struct dentry *mount_nodev(struct file_system_type *fs_type,
|
||||
}
|
||||
EXPORT_SYMBOL(mount_nodev);
|
||||
|
||||
-static int reconfigure_single(struct super_block *s,
|
||||
- int flags, void *data)
|
||||
+int reconfigure_single(struct super_block *s,
|
||||
+ int flags, void *data)
|
||||
{
|
||||
struct fs_context *fc;
|
||||
int ret;
|
||||
diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h
|
||||
index ba8a58754340d..ebcb91a57e865 100644
|
||||
--- a/include/linux/fs_context.h
|
||||
+++ b/include/linux/fs_context.h
|
||||
@@ -135,6 +135,8 @@ extern int generic_parse_monolithic(struct fs_context *fc, void *data);
|
||||
extern int vfs_get_tree(struct fs_context *fc);
|
||||
extern void put_fs_context(struct fs_context *fc);
|
||||
extern void fc_drop_locked(struct fs_context *fc);
|
||||
+int reconfigure_single(struct super_block *s,
|
||||
+ int flags, void *data);
|
||||
|
||||
/*
|
||||
* sget() wrappers to be called from the ->get_tree() op.
|
||||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
|
||||
index 68ccc5b1913b4..b7ac395513c0f 100644
|
||||
--- a/include/linux/perf_event.h
|
||||
+++ b/include/linux/perf_event.h
|
||||
@@ -1175,7 +1175,18 @@ extern void perf_event_bpf_event(struct bpf_prog *prog,
|
||||
enum perf_bpf_event_type type,
|
||||
u16 flags);
|
||||
|
||||
-extern struct perf_guest_info_callbacks *perf_guest_cbs;
|
||||
+extern struct perf_guest_info_callbacks __rcu *perf_guest_cbs;
|
||||
+static inline struct perf_guest_info_callbacks *perf_get_guest_cbs(void)
|
||||
+{
|
||||
+ /*
|
||||
+ * Callbacks are RCU-protected and must be READ_ONCE to avoid reloading
|
||||
+ * the callbacks between a !NULL check and dereferences, to ensure
|
||||
+ * pending stores/changes to the callback pointers are visible before a
|
||||
+ * non-NULL perf_guest_cbs is visible to readers, and to prevent a
|
||||
+ * module from unloading callbacks while readers are active.
|
||||
+ */
|
||||
+ return rcu_dereference(perf_guest_cbs);
|
||||
+}
|
||||
extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
|
||||
extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
|
||||
|
||||
diff --git a/kernel/events/core.c b/kernel/events/core.c
|
||||
index 6ffe3d3e7b06d..7e124f9abb18b 100644
|
||||
--- a/kernel/events/core.c
|
||||
+++ b/kernel/events/core.c
|
||||
@@ -6045,18 +6045,25 @@ static void perf_pending_event(struct irq_work *entry)
|
||||
* Later on, we might change it to a list if there is
|
||||
* another virtualization implementation supporting the callbacks.
|
||||
*/
|
||||
-struct perf_guest_info_callbacks *perf_guest_cbs;
|
||||
+struct perf_guest_info_callbacks __rcu *perf_guest_cbs;
|
||||
|
||||
int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs)
|
||||
{
|
||||
- perf_guest_cbs = cbs;
|
||||
+ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs)))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ rcu_assign_pointer(perf_guest_cbs, cbs);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks);
|
||||
|
||||
int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs)
|
||||
{
|
||||
- perf_guest_cbs = NULL;
|
||||
+ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs) != cbs))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ rcu_assign_pointer(perf_guest_cbs, NULL);
|
||||
+ synchronize_rcu();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(perf_unregister_guest_info_callbacks);
|
||||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
||||
index 022799479a722..d06205626cd54 100644
|
||||
--- a/sound/pci/hda/patch_realtek.c
|
||||
+++ b/sound/pci/hda/patch_realtek.c
|
||||
@@ -1926,6 +1926,7 @@ enum {
|
||||
ALC887_FIXUP_ASUS_BASS,
|
||||
ALC887_FIXUP_BASS_CHMAP,
|
||||
ALC1220_FIXUP_GB_DUAL_CODECS,
|
||||
+ ALC1220_FIXUP_GB_X570,
|
||||
ALC1220_FIXUP_CLEVO_P950,
|
||||
ALC1220_FIXUP_CLEVO_PB51ED,
|
||||
ALC1220_FIXUP_CLEVO_PB51ED_PINS,
|
||||
@@ -2115,6 +2116,29 @@ static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
|
||||
}
|
||||
}
|
||||
|
||||
+static void alc1220_fixup_gb_x570(struct hda_codec *codec,
|
||||
+ const struct hda_fixup *fix,
|
||||
+ int action)
|
||||
+{
|
||||
+ static const hda_nid_t conn1[] = { 0x0c };
|
||||
+ static const struct coef_fw gb_x570_coefs[] = {
|
||||
+ WRITE_COEF(0x1a, 0x01c1),
|
||||
+ WRITE_COEF(0x1b, 0x0202),
|
||||
+ WRITE_COEF(0x43, 0x3005),
|
||||
+ {}
|
||||
+ };
|
||||
+
|
||||
+ switch (action) {
|
||||
+ case HDA_FIXUP_ACT_PRE_PROBE:
|
||||
+ snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
|
||||
+ snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
|
||||
+ break;
|
||||
+ case HDA_FIXUP_ACT_INIT:
|
||||
+ alc_process_coef_fw(codec, gb_x570_coefs);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
|
||||
const struct hda_fixup *fix,
|
||||
int action)
|
||||
@@ -2417,6 +2441,10 @@ static const struct hda_fixup alc882_fixups[] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc1220_fixup_gb_dual_codecs,
|
||||
},
|
||||
+ [ALC1220_FIXUP_GB_X570] = {
|
||||
+ .type = HDA_FIXUP_FUNC,
|
||||
+ .v.func = alc1220_fixup_gb_x570,
|
||||
+ },
|
||||
[ALC1220_FIXUP_CLEVO_P950] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc1220_fixup_clevo_p950,
|
||||
@@ -2519,7 +2547,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
|
||||
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
|
||||
- SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
|
||||
+ SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
|
||||
SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
|
||||
SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,891 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 3075f06f77131..2f6c51097d003 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 174
|
||||
+SUBLEVEL = 175
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
|
||||
index 50c64146d4926..af81f386793ca 100644
|
||||
--- a/arch/arm/boot/dts/bcm283x.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm283x.dtsi
|
||||
@@ -183,6 +183,7 @@
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
+ gpio-ranges = <&gpio 0 0 54>;
|
||||
|
||||
/* Defines pin muxing groups according to
|
||||
* BCM2835-ARM-Peripherals.pdf page 102.
|
||||
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
|
||||
index 08b35587bc6dc..352c102f3459c 100644
|
||||
--- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
|
||||
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
|
||||
@@ -118,6 +118,9 @@ struct drm_i915_gem_object {
|
||||
|
||||
I915_SELFTEST_DECLARE(struct list_head st_link);
|
||||
|
||||
+ unsigned long flags;
|
||||
+#define I915_BO_WAS_BOUND_BIT 0
|
||||
+
|
||||
/*
|
||||
* Is the object to be mapped as read-only to the GPU
|
||||
* Only honoured if hardware has relevant pte bit
|
||||
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
|
||||
index 18f0ce0135c17..aa63fa0ab575e 100644
|
||||
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
|
||||
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "i915_gem_object.h"
|
||||
#include "i915_scatterlist.h"
|
||||
|
||||
+#include "gt/intel_gt.h"
|
||||
+
|
||||
void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
|
||||
struct sg_table *pages,
|
||||
unsigned int sg_page_sizes)
|
||||
@@ -176,6 +178,14 @@ __i915_gem_object_unset_pages(struct drm_i915_gem_object *obj)
|
||||
__i915_gem_object_reset_page_iter(obj);
|
||||
obj->mm.page_sizes.phys = obj->mm.page_sizes.sg = 0;
|
||||
|
||||
+ if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
|
||||
+ struct drm_i915_private *i915 = to_i915(obj->base.dev);
|
||||
+ intel_wakeref_t wakeref;
|
||||
+
|
||||
+ with_intel_runtime_pm_if_in_use(&i915->runtime_pm, wakeref)
|
||||
+ intel_gt_invalidate_tlbs(&i915->gt);
|
||||
+ }
|
||||
+
|
||||
return pages;
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
|
||||
index d48ec9a76ed16..c8c070375d298 100644
|
||||
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
|
||||
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
|
||||
@@ -15,6 +15,8 @@ void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
|
||||
|
||||
spin_lock_init(>->irq_lock);
|
||||
|
||||
+ mutex_init(>->tlb_invalidate_lock);
|
||||
+
|
||||
INIT_LIST_HEAD(>->closed_vma);
|
||||
spin_lock_init(>->closed_lock);
|
||||
|
||||
@@ -266,3 +268,100 @@ void intel_gt_driver_late_release(struct intel_gt *gt)
|
||||
intel_uc_driver_late_release(>->uc);
|
||||
intel_gt_fini_reset(gt);
|
||||
}
|
||||
+
|
||||
+struct reg_and_bit {
|
||||
+ i915_reg_t reg;
|
||||
+ u32 bit;
|
||||
+};
|
||||
+
|
||||
+static struct reg_and_bit
|
||||
+get_reg_and_bit(const struct intel_engine_cs *engine, const bool gen8,
|
||||
+ const i915_reg_t *regs, const unsigned int num)
|
||||
+{
|
||||
+ const unsigned int class = engine->class;
|
||||
+ struct reg_and_bit rb = { };
|
||||
+
|
||||
+ if (WARN_ON_ONCE(class >= num || !regs[class].reg))
|
||||
+ return rb;
|
||||
+
|
||||
+ rb.reg = regs[class];
|
||||
+ if (gen8 && class == VIDEO_DECODE_CLASS)
|
||||
+ rb.reg.reg += 4 * engine->instance; /* GEN8_M2TCR */
|
||||
+ else
|
||||
+ rb.bit = engine->instance;
|
||||
+
|
||||
+ rb.bit = BIT(rb.bit);
|
||||
+
|
||||
+ return rb;
|
||||
+}
|
||||
+
|
||||
+void intel_gt_invalidate_tlbs(struct intel_gt *gt)
|
||||
+{
|
||||
+ static const i915_reg_t gen8_regs[] = {
|
||||
+ [RENDER_CLASS] = GEN8_RTCR,
|
||||
+ [VIDEO_DECODE_CLASS] = GEN8_M1TCR, /* , GEN8_M2TCR */
|
||||
+ [VIDEO_ENHANCEMENT_CLASS] = GEN8_VTCR,
|
||||
+ [COPY_ENGINE_CLASS] = GEN8_BTCR,
|
||||
+ };
|
||||
+ static const i915_reg_t gen12_regs[] = {
|
||||
+ [RENDER_CLASS] = GEN12_GFX_TLB_INV_CR,
|
||||
+ [VIDEO_DECODE_CLASS] = GEN12_VD_TLB_INV_CR,
|
||||
+ [VIDEO_ENHANCEMENT_CLASS] = GEN12_VE_TLB_INV_CR,
|
||||
+ [COPY_ENGINE_CLASS] = GEN12_BLT_TLB_INV_CR,
|
||||
+ };
|
||||
+ struct drm_i915_private *i915 = gt->i915;
|
||||
+ struct intel_uncore *uncore = gt->uncore;
|
||||
+ struct intel_engine_cs *engine;
|
||||
+ enum intel_engine_id id;
|
||||
+ const i915_reg_t *regs;
|
||||
+ unsigned int num = 0;
|
||||
+
|
||||
+ if (I915_SELFTEST_ONLY(gt->awake == -ENODEV))
|
||||
+ return;
|
||||
+
|
||||
+ if (INTEL_GEN(i915) == 12) {
|
||||
+ regs = gen12_regs;
|
||||
+ num = ARRAY_SIZE(gen12_regs);
|
||||
+ } else if (INTEL_GEN(i915) >= 8 && INTEL_GEN(i915) <= 11) {
|
||||
+ regs = gen8_regs;
|
||||
+ num = ARRAY_SIZE(gen8_regs);
|
||||
+ } else if (INTEL_GEN(i915) < 8) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (WARN_ONCE(!num, "Platform does not implement TLB invalidation!"))
|
||||
+ return;
|
||||
+
|
||||
+ GEM_TRACE("\n");
|
||||
+
|
||||
+ assert_rpm_wakelock_held(&i915->runtime_pm);
|
||||
+
|
||||
+ mutex_lock(>->tlb_invalidate_lock);
|
||||
+ intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
|
||||
+
|
||||
+ for_each_engine(engine, gt, id) {
|
||||
+ /*
|
||||
+ * HW architecture suggest typical invalidation time at 40us,
|
||||
+ * with pessimistic cases up to 100us and a recommendation to
|
||||
+ * cap at 1ms. We go a bit higher just in case.
|
||||
+ */
|
||||
+ const unsigned int timeout_us = 100;
|
||||
+ const unsigned int timeout_ms = 4;
|
||||
+ struct reg_and_bit rb;
|
||||
+
|
||||
+ rb = get_reg_and_bit(engine, regs == gen8_regs, regs, num);
|
||||
+ if (!i915_mmio_reg_offset(rb.reg))
|
||||
+ continue;
|
||||
+
|
||||
+ intel_uncore_write_fw(uncore, rb.reg, rb.bit);
|
||||
+ if (__intel_wait_for_register_fw(uncore,
|
||||
+ rb.reg, rb.bit, 0,
|
||||
+ timeout_us, timeout_ms,
|
||||
+ NULL))
|
||||
+ DRM_ERROR_RATELIMITED("%s TLB invalidation did not complete in %ums!\n",
|
||||
+ engine->name, timeout_ms);
|
||||
+ }
|
||||
+
|
||||
+ intel_uncore_forcewake_put(uncore, FORCEWAKE_ALL);
|
||||
+ mutex_unlock(>->tlb_invalidate_lock);
|
||||
+}
|
||||
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
|
||||
index 4920cb351f109..4eab15bdcd97b 100644
|
||||
--- a/drivers/gpu/drm/i915/gt/intel_gt.h
|
||||
+++ b/drivers/gpu/drm/i915/gt/intel_gt.h
|
||||
@@ -57,4 +57,6 @@ static inline bool intel_gt_is_wedged(struct intel_gt *gt)
|
||||
|
||||
void intel_gt_queue_hangcheck(struct intel_gt *gt);
|
||||
|
||||
+void intel_gt_invalidate_tlbs(struct intel_gt *gt);
|
||||
+
|
||||
#endif /* __INTEL_GT_H__ */
|
||||
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
|
||||
index dc295c196d11c..82a78719b32d5 100644
|
||||
--- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
|
||||
+++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
|
||||
@@ -40,6 +40,8 @@ struct intel_gt {
|
||||
|
||||
struct intel_uc uc;
|
||||
|
||||
+ struct mutex tlb_invalidate_lock;
|
||||
+
|
||||
struct intel_gt_timelines {
|
||||
spinlock_t lock; /* protects active_list */
|
||||
struct list_head active_list;
|
||||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
|
||||
index 7b6e68f082f8c..1386d0f5eac63 100644
|
||||
--- a/drivers/gpu/drm/i915/i915_reg.h
|
||||
+++ b/drivers/gpu/drm/i915/i915_reg.h
|
||||
@@ -2519,6 +2519,12 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
|
||||
#define GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING (1 << 28)
|
||||
#define GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT (1 << 24)
|
||||
|
||||
+#define GEN8_RTCR _MMIO(0x4260)
|
||||
+#define GEN8_M1TCR _MMIO(0x4264)
|
||||
+#define GEN8_M2TCR _MMIO(0x4268)
|
||||
+#define GEN8_BTCR _MMIO(0x426c)
|
||||
+#define GEN8_VTCR _MMIO(0x4270)
|
||||
+
|
||||
#if 0
|
||||
#define PRB0_TAIL _MMIO(0x2030)
|
||||
#define PRB0_HEAD _MMIO(0x2034)
|
||||
@@ -2602,6 +2608,11 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
|
||||
#define FAULT_VA_HIGH_BITS (0xf << 0)
|
||||
#define FAULT_GTT_SEL (1 << 4)
|
||||
|
||||
+#define GEN12_GFX_TLB_INV_CR _MMIO(0xced8)
|
||||
+#define GEN12_VD_TLB_INV_CR _MMIO(0xcedc)
|
||||
+#define GEN12_VE_TLB_INV_CR _MMIO(0xcee0)
|
||||
+#define GEN12_BLT_TLB_INV_CR _MMIO(0xcee4)
|
||||
+
|
||||
#define FPGA_DBG _MMIO(0x42300)
|
||||
#define FPGA_DBG_RM_NOCLAIM (1 << 31)
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
|
||||
index e0e677b2a3a94..c24f49ee10d73 100644
|
||||
--- a/drivers/gpu/drm/i915/i915_vma.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_vma.c
|
||||
@@ -341,6 +341,10 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
|
||||
return ret;
|
||||
|
||||
vma->flags |= bind_flags;
|
||||
+
|
||||
+ if (vma->obj)
|
||||
+ set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
|
||||
index 5eb73ded8e07a..765f7a62870db 100644
|
||||
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
|
||||
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
|
||||
@@ -1002,15 +1002,14 @@ extern int vmw_execbuf_fence_commands(struct drm_file *file_priv,
|
||||
struct vmw_private *dev_priv,
|
||||
struct vmw_fence_obj **p_fence,
|
||||
uint32_t *p_handle);
|
||||
-extern void vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
|
||||
+extern int vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
|
||||
struct vmw_fpriv *vmw_fp,
|
||||
int ret,
|
||||
struct drm_vmw_fence_rep __user
|
||||
*user_fence_rep,
|
||||
struct vmw_fence_obj *fence,
|
||||
uint32_t fence_handle,
|
||||
- int32_t out_fence_fd,
|
||||
- struct sync_file *sync_file);
|
||||
+ int32_t out_fence_fd);
|
||||
bool vmw_cmd_describe(const void *buf, u32 *size, char const **cmd);
|
||||
|
||||
/**
|
||||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
|
||||
index ff86d49dc5e8a..e3d20048075bf 100644
|
||||
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
|
||||
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
|
||||
@@ -3413,17 +3413,17 @@ int vmw_execbuf_fence_commands(struct drm_file *file_priv,
|
||||
* Also if copying fails, user-space will be unable to signal the fence object
|
||||
* so we wait for it immediately, and then unreference the user-space reference.
|
||||
*/
|
||||
-void
|
||||
+int
|
||||
vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
|
||||
struct vmw_fpriv *vmw_fp, int ret,
|
||||
struct drm_vmw_fence_rep __user *user_fence_rep,
|
||||
struct vmw_fence_obj *fence, uint32_t fence_handle,
|
||||
- int32_t out_fence_fd, struct sync_file *sync_file)
|
||||
+ int32_t out_fence_fd)
|
||||
{
|
||||
struct drm_vmw_fence_rep fence_rep;
|
||||
|
||||
if (user_fence_rep == NULL)
|
||||
- return;
|
||||
+ return 0;
|
||||
|
||||
memset(&fence_rep, 0, sizeof(fence_rep));
|
||||
|
||||
@@ -3451,20 +3451,14 @@ vmw_execbuf_copy_fence_user(struct vmw_private *dev_priv,
|
||||
* handle.
|
||||
*/
|
||||
if (unlikely(ret != 0) && (fence_rep.error == 0)) {
|
||||
- if (sync_file)
|
||||
- fput(sync_file->file);
|
||||
-
|
||||
- if (fence_rep.fd != -1) {
|
||||
- put_unused_fd(fence_rep.fd);
|
||||
- fence_rep.fd = -1;
|
||||
- }
|
||||
-
|
||||
ttm_ref_object_base_unref(vmw_fp->tfile, fence_handle,
|
||||
TTM_REF_USAGE);
|
||||
VMW_DEBUG_USER("Fence copy error. Syncing.\n");
|
||||
(void) vmw_fence_obj_wait(fence, false, false,
|
||||
VMW_FENCE_WAIT_TIMEOUT);
|
||||
}
|
||||
+
|
||||
+ return ret ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3806,16 +3800,23 @@ int vmw_execbuf_process(struct drm_file *file_priv,
|
||||
|
||||
(void) vmw_fence_obj_wait(fence, false, false,
|
||||
VMW_FENCE_WAIT_TIMEOUT);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
|
||||
+ user_fence_rep, fence, handle, out_fence_fd);
|
||||
+
|
||||
+ if (sync_file) {
|
||||
+ if (ret) {
|
||||
+ /* usercopy of fence failed, put the file object */
|
||||
+ fput(sync_file->file);
|
||||
+ put_unused_fd(out_fence_fd);
|
||||
} else {
|
||||
/* Link the fence with the FD created earlier */
|
||||
fd_install(out_fence_fd, sync_file->file);
|
||||
}
|
||||
}
|
||||
|
||||
- vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret,
|
||||
- user_fence_rep, fence, handle, out_fence_fd,
|
||||
- sync_file);
|
||||
-
|
||||
/* Don't unreference when handing fence out */
|
||||
if (unlikely(out_fence != NULL)) {
|
||||
*out_fence = fence;
|
||||
@@ -3833,7 +3834,7 @@ int vmw_execbuf_process(struct drm_file *file_priv,
|
||||
*/
|
||||
vmw_validation_unref_lists(&val_ctx);
|
||||
|
||||
- return 0;
|
||||
+ return ret;
|
||||
|
||||
out_unlock_binding:
|
||||
mutex_unlock(&dev_priv->binding_mutex);
|
||||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
|
||||
index 178a6cd1a06fe..874093a0b04f0 100644
|
||||
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
|
||||
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
|
||||
@@ -1171,7 +1171,7 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
|
||||
}
|
||||
|
||||
vmw_execbuf_copy_fence_user(dev_priv, vmw_fp, 0, user_fence_rep, fence,
|
||||
- handle, -1, NULL);
|
||||
+ handle, -1);
|
||||
vmw_fence_obj_unreference(&fence);
|
||||
return 0;
|
||||
out_no_create:
|
||||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
|
||||
index 33b1519887474..0b800c3540492 100644
|
||||
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
|
||||
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
|
||||
@@ -2570,7 +2570,7 @@ void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv,
|
||||
if (file_priv)
|
||||
vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv),
|
||||
ret, user_fence_rep, fence,
|
||||
- handle, -1, NULL);
|
||||
+ handle, -1);
|
||||
if (out_fence)
|
||||
*out_fence = fence;
|
||||
else
|
||||
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
index 2c01e2ebef7aa..d97c19ef75830 100644
|
||||
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
@@ -218,8 +218,7 @@ static struct esdhc_soc_data usdhc_imx7ulp_data = {
|
||||
static struct esdhc_soc_data usdhc_imx8qxp_data = {
|
||||
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
|
||||
- | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
|
||||
- | ESDHC_FLAG_CQHCI,
|
||||
+ | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES,
|
||||
};
|
||||
|
||||
struct pltfm_imx_data {
|
||||
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
|
||||
index 0de1a3a96984c..fa742535f6791 100644
|
||||
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
|
||||
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdesc.h>
|
||||
#include <linux/init.h>
|
||||
+#include <linux/interrupt.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
@@ -37,12 +38,10 @@
|
||||
|
||||
#define MODULE_NAME "pinctrl-bcm2835"
|
||||
#define BCM2835_NUM_GPIOS 54
|
||||
+#define BCM2711_NUM_GPIOS 58
|
||||
#define BCM2835_NUM_BANKS 2
|
||||
#define BCM2835_NUM_IRQS 3
|
||||
|
||||
-#define BCM2835_PIN_BITMAP_SZ \
|
||||
- DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8)
|
||||
-
|
||||
/* GPIO register offsets */
|
||||
#define GPFSEL0 0x0 /* Function Select */
|
||||
#define GPSET0 0x1c /* Pin Output Set */
|
||||
@@ -78,13 +77,15 @@
|
||||
struct bcm2835_pinctrl {
|
||||
struct device *dev;
|
||||
void __iomem *base;
|
||||
+ int *wake_irq;
|
||||
|
||||
/* note: locking assumes each bank will have its own unsigned long */
|
||||
unsigned long enabled_irq_map[BCM2835_NUM_BANKS];
|
||||
- unsigned int irq_type[BCM2835_NUM_GPIOS];
|
||||
+ unsigned int irq_type[BCM2711_NUM_GPIOS];
|
||||
|
||||
struct pinctrl_dev *pctl_dev;
|
||||
struct gpio_chip gpio_chip;
|
||||
+ struct pinctrl_desc pctl_desc;
|
||||
struct pinctrl_gpio_range gpio_range;
|
||||
|
||||
raw_spinlock_t irq_lock[BCM2835_NUM_BANKS];
|
||||
@@ -147,6 +148,10 @@ static struct pinctrl_pin_desc bcm2835_gpio_pins[] = {
|
||||
BCM2835_GPIO_PIN(51),
|
||||
BCM2835_GPIO_PIN(52),
|
||||
BCM2835_GPIO_PIN(53),
|
||||
+ BCM2835_GPIO_PIN(54),
|
||||
+ BCM2835_GPIO_PIN(55),
|
||||
+ BCM2835_GPIO_PIN(56),
|
||||
+ BCM2835_GPIO_PIN(57),
|
||||
};
|
||||
|
||||
/* one pin per group */
|
||||
@@ -205,6 +210,10 @@ static const char * const bcm2835_gpio_groups[] = {
|
||||
"gpio51",
|
||||
"gpio52",
|
||||
"gpio53",
|
||||
+ "gpio54",
|
||||
+ "gpio55",
|
||||
+ "gpio56",
|
||||
+ "gpio57",
|
||||
};
|
||||
|
||||
enum bcm2835_fsel {
|
||||
@@ -355,6 +364,22 @@ static const struct gpio_chip bcm2835_gpio_chip = {
|
||||
.can_sleep = false,
|
||||
};
|
||||
|
||||
+static const struct gpio_chip bcm2711_gpio_chip = {
|
||||
+ .label = "pinctrl-bcm2711",
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .request = gpiochip_generic_request,
|
||||
+ .free = gpiochip_generic_free,
|
||||
+ .direction_input = bcm2835_gpio_direction_input,
|
||||
+ .direction_output = bcm2835_gpio_direction_output,
|
||||
+ .get_direction = bcm2835_gpio_get_direction,
|
||||
+ .get = bcm2835_gpio_get,
|
||||
+ .set = bcm2835_gpio_set,
|
||||
+ .set_config = gpiochip_generic_config,
|
||||
+ .base = -1,
|
||||
+ .ngpio = BCM2711_NUM_GPIOS,
|
||||
+ .can_sleep = false,
|
||||
+};
|
||||
+
|
||||
static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
|
||||
unsigned int bank, u32 mask)
|
||||
{
|
||||
@@ -401,7 +426,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
|
||||
bcm2835_gpio_irq_handle_bank(pc, 0, 0xf0000000);
|
||||
bcm2835_gpio_irq_handle_bank(pc, 1, 0x00003fff);
|
||||
break;
|
||||
- case 2: /* IRQ2 covers GPIOs 46-53 */
|
||||
+ case 2: /* IRQ2 covers GPIOs 46-57 */
|
||||
bcm2835_gpio_irq_handle_bank(pc, 1, 0x003fc000);
|
||||
break;
|
||||
}
|
||||
@@ -409,6 +434,11 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
|
||||
chained_irq_exit(host_chip, desc);
|
||||
}
|
||||
|
||||
+static irqreturn_t bcm2835_gpio_wake_irq_handler(int irq, void *dev_id)
|
||||
+{
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
static inline void __bcm2835_gpio_irq_config(struct bcm2835_pinctrl *pc,
|
||||
unsigned reg, unsigned offset, bool enable)
|
||||
{
|
||||
@@ -608,6 +638,34 @@ static void bcm2835_gpio_irq_ack(struct irq_data *data)
|
||||
bcm2835_gpio_set_bit(pc, GPEDS0, gpio);
|
||||
}
|
||||
|
||||
+static int bcm2835_gpio_irq_set_wake(struct irq_data *data, unsigned int on)
|
||||
+{
|
||||
+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
|
||||
+ struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
|
||||
+ unsigned gpio = irqd_to_hwirq(data);
|
||||
+ unsigned int irqgroup;
|
||||
+ int ret = -EINVAL;
|
||||
+
|
||||
+ if (!pc->wake_irq)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (gpio <= 27)
|
||||
+ irqgroup = 0;
|
||||
+ else if (gpio >= 28 && gpio <= 45)
|
||||
+ irqgroup = 1;
|
||||
+ else if (gpio >= 46 && gpio <= 57)
|
||||
+ irqgroup = 2;
|
||||
+ else
|
||||
+ return ret;
|
||||
+
|
||||
+ if (on)
|
||||
+ ret = enable_irq_wake(pc->wake_irq[irqgroup]);
|
||||
+ else
|
||||
+ ret = disable_irq_wake(pc->wake_irq[irqgroup]);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static struct irq_chip bcm2835_gpio_irq_chip = {
|
||||
.name = MODULE_NAME,
|
||||
.irq_enable = bcm2835_gpio_irq_enable,
|
||||
@@ -616,11 +674,13 @@ static struct irq_chip bcm2835_gpio_irq_chip = {
|
||||
.irq_ack = bcm2835_gpio_irq_ack,
|
||||
.irq_mask = bcm2835_gpio_irq_disable,
|
||||
.irq_unmask = bcm2835_gpio_irq_enable,
|
||||
+ .irq_set_wake = bcm2835_gpio_irq_set_wake,
|
||||
+ .flags = IRQCHIP_MASK_ON_SUSPEND,
|
||||
};
|
||||
|
||||
static int bcm2835_pctl_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
- return ARRAY_SIZE(bcm2835_gpio_groups);
|
||||
+ return BCM2835_NUM_GPIOS;
|
||||
}
|
||||
|
||||
static const char *bcm2835_pctl_get_group_name(struct pinctrl_dev *pctldev,
|
||||
@@ -778,7 +838,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
|
||||
err = of_property_read_u32_index(np, "brcm,pins", i, &pin);
|
||||
if (err)
|
||||
goto out;
|
||||
- if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
|
||||
+ if (pin >= pc->pctl_desc.npins) {
|
||||
dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n",
|
||||
np, pin);
|
||||
err = -EINVAL;
|
||||
@@ -854,7 +914,7 @@ static int bcm2835_pmx_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
{
|
||||
/* every pin can do every function */
|
||||
*groups = bcm2835_gpio_groups;
|
||||
- *num_groups = ARRAY_SIZE(bcm2835_gpio_groups);
|
||||
+ *num_groups = BCM2835_NUM_GPIOS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1054,29 +1114,66 @@ static const struct pinconf_ops bcm2711_pinconf_ops = {
|
||||
.pin_config_set = bcm2711_pinconf_set,
|
||||
};
|
||||
|
||||
-static struct pinctrl_desc bcm2835_pinctrl_desc = {
|
||||
+static const struct pinctrl_desc bcm2835_pinctrl_desc = {
|
||||
.name = MODULE_NAME,
|
||||
.pins = bcm2835_gpio_pins,
|
||||
- .npins = ARRAY_SIZE(bcm2835_gpio_pins),
|
||||
+ .npins = BCM2835_NUM_GPIOS,
|
||||
.pctlops = &bcm2835_pctl_ops,
|
||||
.pmxops = &bcm2835_pmx_ops,
|
||||
.confops = &bcm2835_pinconf_ops,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
-static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
|
||||
+static const struct pinctrl_desc bcm2711_pinctrl_desc = {
|
||||
+ .name = "pinctrl-bcm2711",
|
||||
+ .pins = bcm2835_gpio_pins,
|
||||
+ .npins = BCM2711_NUM_GPIOS,
|
||||
+ .pctlops = &bcm2835_pctl_ops,
|
||||
+ .pmxops = &bcm2835_pmx_ops,
|
||||
+ .confops = &bcm2711_pinconf_ops,
|
||||
+ .owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+static const struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
|
||||
.name = MODULE_NAME,
|
||||
.npins = BCM2835_NUM_GPIOS,
|
||||
};
|
||||
|
||||
+static const struct pinctrl_gpio_range bcm2711_pinctrl_gpio_range = {
|
||||
+ .name = "pinctrl-bcm2711",
|
||||
+ .npins = BCM2711_NUM_GPIOS,
|
||||
+};
|
||||
+
|
||||
+struct bcm_plat_data {
|
||||
+ const struct gpio_chip *gpio_chip;
|
||||
+ const struct pinctrl_desc *pctl_desc;
|
||||
+ const struct pinctrl_gpio_range *gpio_range;
|
||||
+};
|
||||
+
|
||||
+static const struct bcm_plat_data bcm2835_plat_data = {
|
||||
+ .gpio_chip = &bcm2835_gpio_chip,
|
||||
+ .pctl_desc = &bcm2835_pinctrl_desc,
|
||||
+ .gpio_range = &bcm2835_pinctrl_gpio_range,
|
||||
+};
|
||||
+
|
||||
+static const struct bcm_plat_data bcm2711_plat_data = {
|
||||
+ .gpio_chip = &bcm2711_gpio_chip,
|
||||
+ .pctl_desc = &bcm2711_pinctrl_desc,
|
||||
+ .gpio_range = &bcm2711_pinctrl_gpio_range,
|
||||
+};
|
||||
+
|
||||
static const struct of_device_id bcm2835_pinctrl_match[] = {
|
||||
{
|
||||
.compatible = "brcm,bcm2835-gpio",
|
||||
- .data = &bcm2835_pinconf_ops,
|
||||
+ .data = &bcm2835_plat_data,
|
||||
},
|
||||
{
|
||||
.compatible = "brcm,bcm2711-gpio",
|
||||
- .data = &bcm2711_pinconf_ops,
|
||||
+ .data = &bcm2711_plat_data,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "brcm,bcm7211-gpio",
|
||||
+ .data = &bcm2711_plat_data,
|
||||
},
|
||||
{}
|
||||
};
|
||||
@@ -1085,14 +1182,16 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
+ const struct bcm_plat_data *pdata;
|
||||
struct bcm2835_pinctrl *pc;
|
||||
struct gpio_irq_chip *girq;
|
||||
struct resource iomem;
|
||||
int err, i;
|
||||
const struct of_device_id *match;
|
||||
+ int is_7211 = 0;
|
||||
|
||||
- BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS);
|
||||
- BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS);
|
||||
+ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2711_NUM_GPIOS);
|
||||
+ BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2711_NUM_GPIOS);
|
||||
|
||||
pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL);
|
||||
if (!pc)
|
||||
@@ -1111,7 +1210,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(pc->base))
|
||||
return PTR_ERR(pc->base);
|
||||
|
||||
- pc->gpio_chip = bcm2835_gpio_chip;
|
||||
+ match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
|
||||
+ if (!match)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ pdata = match->data;
|
||||
+ is_7211 = of_device_is_compatible(np, "brcm,bcm7211-gpio");
|
||||
+
|
||||
+ pc->gpio_chip = *pdata->gpio_chip;
|
||||
pc->gpio_chip.parent = dev;
|
||||
pc->gpio_chip.of_node = np;
|
||||
|
||||
@@ -1135,6 +1241,18 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
raw_spin_lock_init(&pc->irq_lock[i]);
|
||||
}
|
||||
|
||||
+ pc->pctl_desc = *pdata->pctl_desc;
|
||||
+ pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc);
|
||||
+ if (IS_ERR(pc->pctl_dev)) {
|
||||
+ gpiochip_remove(&pc->gpio_chip);
|
||||
+ return PTR_ERR(pc->pctl_dev);
|
||||
+ }
|
||||
+
|
||||
+ pc->gpio_range = *pdata->gpio_range;
|
||||
+ pc->gpio_range.base = pc->gpio_chip.base;
|
||||
+ pc->gpio_range.gc = &pc->gpio_chip;
|
||||
+ pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
+
|
||||
girq = &pc->gpio_chip.irq;
|
||||
girq->chip = &bcm2835_gpio_irq_chip;
|
||||
girq->parent_handler = bcm2835_gpio_irq_handler;
|
||||
@@ -1142,8 +1260,19 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
girq->parents = devm_kcalloc(dev, BCM2835_NUM_IRQS,
|
||||
sizeof(*girq->parents),
|
||||
GFP_KERNEL);
|
||||
- if (!girq->parents)
|
||||
+ if (!girq->parents) {
|
||||
+ pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ if (is_7211) {
|
||||
+ pc->wake_irq = devm_kcalloc(dev, BCM2835_NUM_IRQS,
|
||||
+ sizeof(*pc->wake_irq),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!pc->wake_irq)
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Use the same handler for all groups: this is necessary
|
||||
* since we use one gpiochip to cover all lines - the
|
||||
@@ -1151,34 +1280,44 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
* bank that was firing the IRQ and look up the per-group
|
||||
* and bank data.
|
||||
*/
|
||||
- for (i = 0; i < BCM2835_NUM_IRQS; i++)
|
||||
+ for (i = 0; i < BCM2835_NUM_IRQS; i++) {
|
||||
+ int len;
|
||||
+ char *name;
|
||||
+
|
||||
girq->parents[i] = irq_of_parse_and_map(np, i);
|
||||
+ if (!is_7211)
|
||||
+ continue;
|
||||
+
|
||||
+ /* Skip over the all banks interrupts */
|
||||
+ pc->wake_irq[i] = irq_of_parse_and_map(np, i +
|
||||
+ BCM2835_NUM_IRQS + 1);
|
||||
+
|
||||
+ len = strlen(dev_name(pc->dev)) + 16;
|
||||
+ name = devm_kzalloc(pc->dev, len, GFP_KERNEL);
|
||||
+ if (!name)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ snprintf(name, len, "%s:bank%d", dev_name(pc->dev), i);
|
||||
+
|
||||
+ /* These are optional interrupts */
|
||||
+ err = devm_request_irq(dev, pc->wake_irq[i],
|
||||
+ bcm2835_gpio_wake_irq_handler,
|
||||
+ IRQF_SHARED, name, pc);
|
||||
+ if (err)
|
||||
+ dev_warn(dev, "unable to request wake IRQ %d\n",
|
||||
+ pc->wake_irq[i]);
|
||||
+ }
|
||||
+
|
||||
girq->default_type = IRQ_TYPE_NONE;
|
||||
girq->handler = handle_level_irq;
|
||||
|
||||
err = gpiochip_add_data(&pc->gpio_chip, pc);
|
||||
if (err) {
|
||||
dev_err(dev, "could not add GPIO chip\n");
|
||||
+ pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
return err;
|
||||
}
|
||||
|
||||
- match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
|
||||
- if (match) {
|
||||
- bcm2835_pinctrl_desc.confops =
|
||||
- (const struct pinconf_ops *)match->data;
|
||||
- }
|
||||
-
|
||||
- pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
|
||||
- if (IS_ERR(pc->pctl_dev)) {
|
||||
- gpiochip_remove(&pc->gpio_chip);
|
||||
- return PTR_ERR(pc->pctl_dev);
|
||||
- }
|
||||
-
|
||||
- pc->gpio_range = bcm2835_pinctrl_gpio_range;
|
||||
- pc->gpio_range.base = pc->gpio_chip.base;
|
||||
- pc->gpio_range.gc = &pc->gpio_chip;
|
||||
- pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/fs/select.c b/fs/select.c
|
||||
index e51796063cb6e..7716d9d5be1e8 100644
|
||||
--- a/fs/select.c
|
||||
+++ b/fs/select.c
|
||||
@@ -458,9 +458,11 @@ get_max:
|
||||
return max;
|
||||
}
|
||||
|
||||
-#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | EPOLLHUP | EPOLLERR)
|
||||
-#define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT | EPOLLERR)
|
||||
-#define POLLEX_SET (EPOLLPRI)
|
||||
+#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | EPOLLHUP | EPOLLERR |\
|
||||
+ EPOLLNVAL)
|
||||
+#define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT | EPOLLERR |\
|
||||
+ EPOLLNVAL)
|
||||
+#define POLLEX_SET (EPOLLPRI | EPOLLNVAL)
|
||||
|
||||
static inline void wait_key_set(poll_table *wait, unsigned long in,
|
||||
unsigned long out, unsigned long bit,
|
||||
@@ -527,6 +529,7 @@ static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
|
||||
break;
|
||||
if (!(bit & all_bits))
|
||||
continue;
|
||||
+ mask = EPOLLNVAL;
|
||||
f = fdget(i);
|
||||
if (f.file) {
|
||||
wait_key_set(wait, in, out, bit,
|
||||
@@ -534,34 +537,34 @@ static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
|
||||
mask = vfs_poll(f.file, wait);
|
||||
|
||||
fdput(f);
|
||||
- if ((mask & POLLIN_SET) && (in & bit)) {
|
||||
- res_in |= bit;
|
||||
- retval++;
|
||||
- wait->_qproc = NULL;
|
||||
- }
|
||||
- if ((mask & POLLOUT_SET) && (out & bit)) {
|
||||
- res_out |= bit;
|
||||
- retval++;
|
||||
- wait->_qproc = NULL;
|
||||
- }
|
||||
- if ((mask & POLLEX_SET) && (ex & bit)) {
|
||||
- res_ex |= bit;
|
||||
- retval++;
|
||||
- wait->_qproc = NULL;
|
||||
- }
|
||||
- /* got something, stop busy polling */
|
||||
- if (retval) {
|
||||
- can_busy_loop = false;
|
||||
- busy_flag = 0;
|
||||
-
|
||||
- /*
|
||||
- * only remember a returned
|
||||
- * POLL_BUSY_LOOP if we asked for it
|
||||
- */
|
||||
- } else if (busy_flag & mask)
|
||||
- can_busy_loop = true;
|
||||
-
|
||||
}
|
||||
+ if ((mask & POLLIN_SET) && (in & bit)) {
|
||||
+ res_in |= bit;
|
||||
+ retval++;
|
||||
+ wait->_qproc = NULL;
|
||||
+ }
|
||||
+ if ((mask & POLLOUT_SET) && (out & bit)) {
|
||||
+ res_out |= bit;
|
||||
+ retval++;
|
||||
+ wait->_qproc = NULL;
|
||||
+ }
|
||||
+ if ((mask & POLLEX_SET) && (ex & bit)) {
|
||||
+ res_ex |= bit;
|
||||
+ retval++;
|
||||
+ wait->_qproc = NULL;
|
||||
+ }
|
||||
+ /* got something, stop busy polling */
|
||||
+ if (retval) {
|
||||
+ can_busy_loop = false;
|
||||
+ busy_flag = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * only remember a returned
|
||||
+ * POLL_BUSY_LOOP if we asked for it
|
||||
+ */
|
||||
+ } else if (busy_flag & mask)
|
||||
+ can_busy_loop = true;
|
||||
+
|
||||
}
|
||||
if (res_in)
|
||||
*rinp = res_in;
|
||||
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
|
||||
index 7777c35e0a171..5797cf2909b00 100644
|
||||
--- a/kernel/rcu/tree.c
|
||||
+++ b/kernel/rcu/tree.c
|
||||
@@ -1358,10 +1358,11 @@ static void __maybe_unused rcu_advance_cbs_nowake(struct rcu_node *rnp,
|
||||
struct rcu_data *rdp)
|
||||
{
|
||||
rcu_lockdep_assert_cblist_protected(rdp);
|
||||
- if (!rcu_seq_state(rcu_seq_current(&rnp->gp_seq)) ||
|
||||
- !raw_spin_trylock_rcu_node(rnp))
|
||||
+ if (!rcu_seq_state(rcu_seq_current(&rnp->gp_seq)) || !raw_spin_trylock_rcu_node(rnp))
|
||||
return;
|
||||
- WARN_ON_ONCE(rcu_advance_cbs(rnp, rdp));
|
||||
+ // The grace period cannot end while we hold the rcu_node lock.
|
||||
+ if (rcu_seq_state(rcu_seq_current(&rnp->gp_seq)))
|
||||
+ WARN_ON_ONCE(rcu_advance_cbs(rnp, rdp));
|
||||
raw_spin_unlock_rcu_node(rnp);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,468 +0,0 @@
|
||||
diff --git a/Documentation/accounting/psi.rst b/Documentation/accounting/psi.rst
|
||||
index 621111ce57401..28c0461ba2e1b 100644
|
||||
--- a/Documentation/accounting/psi.rst
|
||||
+++ b/Documentation/accounting/psi.rst
|
||||
@@ -90,7 +90,8 @@ Triggers can be set on more than one psi metric and more than one trigger
|
||||
for the same psi metric can be specified. However for each trigger a separate
|
||||
file descriptor is required to be able to poll it separately from others,
|
||||
therefore for each trigger a separate open() syscall should be made even
|
||||
-when opening the same psi interface file.
|
||||
+when opening the same psi interface file. Write operations to a file descriptor
|
||||
+with an already existing psi trigger will fail with EBUSY.
|
||||
|
||||
Monitors activate only when system enters stall state for the monitored
|
||||
psi metric and deactivates upon exit from the stall state. While system is
|
||||
diff --git a/Makefile b/Makefile
|
||||
index b23aa51ada93e..324939b64d7b7 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 176
|
||||
+SUBLEVEL = 177
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
|
||||
index da8c2c4aca7ef..0442d7e1cd20b 100644
|
||||
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
|
||||
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
|
||||
@@ -721,7 +721,9 @@ static void xgbe_stop_timers(struct xgbe_prv_data *pdata)
|
||||
if (!channel->tx_ring)
|
||||
break;
|
||||
|
||||
+ /* Deactivate the Tx timer */
|
||||
del_timer_sync(&channel->tx_timer);
|
||||
+ channel->tx_timer_active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2765,6 +2767,14 @@ read_again:
|
||||
buf2_len = xgbe_rx_buf2_len(rdata, packet, len);
|
||||
len += buf2_len;
|
||||
|
||||
+ if (buf2_len > rdata->rx.buf.dma_len) {
|
||||
+ /* Hardware inconsistency within the descriptors
|
||||
+ * that has resulted in a length underflow.
|
||||
+ */
|
||||
+ error = 1;
|
||||
+ goto skip_data;
|
||||
+ }
|
||||
+
|
||||
if (!skb) {
|
||||
skb = xgbe_create_skb(pdata, napi, rdata,
|
||||
buf1_len);
|
||||
@@ -2794,8 +2804,10 @@ skip_data:
|
||||
if (!last || context_next)
|
||||
goto read_again;
|
||||
|
||||
- if (!skb)
|
||||
+ if (!skb || error) {
|
||||
+ dev_kfree_skb(skb);
|
||||
goto next_packet;
|
||||
+ }
|
||||
|
||||
/* Be sure we don't exceed the configured MTU */
|
||||
max_len = netdev->mtu + ETH_HLEN;
|
||||
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
|
||||
index 345576f1a7470..73ad78f47763c 100644
|
||||
--- a/drivers/net/usb/ipheth.c
|
||||
+++ b/drivers/net/usb/ipheth.c
|
||||
@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
|
||||
if (tx_buf == NULL)
|
||||
goto free_rx_urb;
|
||||
|
||||
- rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
|
||||
+ rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
|
||||
GFP_KERNEL, &rx_urb->transfer_dma);
|
||||
if (rx_buf == NULL)
|
||||
goto free_tx_buf;
|
||||
@@ -146,7 +146,7 @@ error_nomem:
|
||||
|
||||
static void ipheth_free_urbs(struct ipheth_device *iphone)
|
||||
{
|
||||
- usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
|
||||
+ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf,
|
||||
iphone->rx_urb->transfer_dma);
|
||||
usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
|
||||
iphone->tx_urb->transfer_dma);
|
||||
@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
|
||||
|
||||
usb_fill_bulk_urb(dev->rx_urb, udev,
|
||||
usb_rcvbulkpipe(udev, dev->bulk_in),
|
||||
- dev->rx_buf, IPHETH_BUF_SIZE,
|
||||
+ dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
|
||||
ipheth_rcvbulk_callback,
|
||||
dev);
|
||||
dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
|
||||
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
|
||||
index 88b996764ff95..907b8be86ce04 100644
|
||||
--- a/drivers/pci/hotplug/pciehp_hpc.c
|
||||
+++ b/drivers/pci/hotplug/pciehp_hpc.c
|
||||
@@ -577,6 +577,8 @@ read_status:
|
||||
*/
|
||||
if (ctrl->power_fault_detected)
|
||||
status &= ~PCI_EXP_SLTSTA_PFD;
|
||||
+ else if (status & PCI_EXP_SLTSTA_PFD)
|
||||
+ ctrl->power_fault_detected = true;
|
||||
|
||||
events |= status;
|
||||
if (!events) {
|
||||
@@ -586,7 +588,7 @@ read_status:
|
||||
}
|
||||
|
||||
if (status) {
|
||||
- pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, events);
|
||||
+ pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, status);
|
||||
|
||||
/*
|
||||
* In MSI mode, all event bits must be zero before the port
|
||||
@@ -660,8 +662,7 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id)
|
||||
}
|
||||
|
||||
/* Check Power Fault Detected */
|
||||
- if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
|
||||
- ctrl->power_fault_detected = 1;
|
||||
+ if (events & PCI_EXP_SLTSTA_PFD) {
|
||||
ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(ctrl));
|
||||
pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF,
|
||||
PCI_EXP_SLTCTL_ATTN_IND_ON);
|
||||
diff --git a/include/linux/psi.h b/include/linux/psi.h
|
||||
index 7b3de73212199..7712b58009276 100644
|
||||
--- a/include/linux/psi.h
|
||||
+++ b/include/linux/psi.h
|
||||
@@ -31,7 +31,7 @@ void cgroup_move_task(struct task_struct *p, struct css_set *to);
|
||||
|
||||
struct psi_trigger *psi_trigger_create(struct psi_group *group,
|
||||
char *buf, size_t nbytes, enum psi_res res);
|
||||
-void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *t);
|
||||
+void psi_trigger_destroy(struct psi_trigger *t);
|
||||
|
||||
__poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
|
||||
poll_table *wait);
|
||||
diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h
|
||||
index 07aaf9b822416..0023052eab23f 100644
|
||||
--- a/include/linux/psi_types.h
|
||||
+++ b/include/linux/psi_types.h
|
||||
@@ -120,9 +120,6 @@ struct psi_trigger {
|
||||
* events to one per window
|
||||
*/
|
||||
u64 last_event_time;
|
||||
-
|
||||
- /* Refcounting to prevent premature destruction */
|
||||
- struct kref refcount;
|
||||
};
|
||||
|
||||
struct psi_group {
|
||||
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
|
||||
index 2d0ef613ca070..5e465c4b1e64c 100644
|
||||
--- a/kernel/cgroup/cgroup-v1.c
|
||||
+++ b/kernel/cgroup/cgroup-v1.c
|
||||
@@ -549,6 +549,14 @@ static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
|
||||
|
||||
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
|
||||
|
||||
+ /*
|
||||
+ * Release agent gets called with all capabilities,
|
||||
+ * require capabilities to set release agent.
|
||||
+ */
|
||||
+ if ((of->file->f_cred->user_ns != &init_user_ns) ||
|
||||
+ !capable(CAP_SYS_ADMIN))
|
||||
+ return -EPERM;
|
||||
+
|
||||
cgrp = cgroup_kn_lock_live(of->kn, false);
|
||||
if (!cgrp)
|
||||
return -ENODEV;
|
||||
@@ -961,6 +969,12 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
|
||||
/* Specifying two release agents is forbidden */
|
||||
if (ctx->release_agent)
|
||||
return cg_invalf(fc, "cgroup1: release_agent respecified");
|
||||
+ /*
|
||||
+ * Release agent gets called with all capabilities,
|
||||
+ * require capabilities to set release agent.
|
||||
+ */
|
||||
+ if ((fc->user_ns != &init_user_ns) || !capable(CAP_SYS_ADMIN))
|
||||
+ return cg_invalf(fc, "cgroup1: Setting release_agent not allowed");
|
||||
ctx->release_agent = param->string;
|
||||
param->string = NULL;
|
||||
break;
|
||||
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
|
||||
index 1904ffcee0f1e..ce1745ac7b8c0 100644
|
||||
--- a/kernel/cgroup/cgroup.c
|
||||
+++ b/kernel/cgroup/cgroup.c
|
||||
@@ -3659,6 +3659,12 @@ static ssize_t cgroup_pressure_write(struct kernfs_open_file *of, char *buf,
|
||||
cgroup_get(cgrp);
|
||||
cgroup_kn_unlock(of->kn);
|
||||
|
||||
+ /* Allow only one trigger per file descriptor */
|
||||
+ if (of->priv) {
|
||||
+ cgroup_put(cgrp);
|
||||
+ return -EBUSY;
|
||||
+ }
|
||||
+
|
||||
psi = cgroup_ino(cgrp) == 1 ? &psi_system : &cgrp->psi;
|
||||
new = psi_trigger_create(psi, buf, nbytes, res);
|
||||
if (IS_ERR(new)) {
|
||||
@@ -3666,8 +3672,7 @@ static ssize_t cgroup_pressure_write(struct kernfs_open_file *of, char *buf,
|
||||
return PTR_ERR(new);
|
||||
}
|
||||
|
||||
- psi_trigger_replace(&of->priv, new);
|
||||
-
|
||||
+ smp_store_release(&of->priv, new);
|
||||
cgroup_put(cgrp);
|
||||
|
||||
return nbytes;
|
||||
@@ -3702,7 +3707,7 @@ static __poll_t cgroup_pressure_poll(struct kernfs_open_file *of,
|
||||
|
||||
static void cgroup_pressure_release(struct kernfs_open_file *of)
|
||||
{
|
||||
- psi_trigger_replace(&of->priv, NULL);
|
||||
+ psi_trigger_destroy(of->priv);
|
||||
}
|
||||
#endif /* CONFIG_PSI */
|
||||
|
||||
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
|
||||
index badfa8f153599..411be8b2e837e 100644
|
||||
--- a/kernel/cgroup/cpuset.c
|
||||
+++ b/kernel/cgroup/cpuset.c
|
||||
@@ -1558,8 +1558,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
|
||||
* Make sure that subparts_cpus is a subset of cpus_allowed.
|
||||
*/
|
||||
if (cs->nr_subparts_cpus) {
|
||||
- cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
|
||||
- cs->cpus_allowed);
|
||||
+ cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
|
||||
cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
|
||||
}
|
||||
spin_unlock_irq(&callback_lock);
|
||||
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
|
||||
index 9154e745f0978..9dd83eb74a9da 100644
|
||||
--- a/kernel/sched/psi.c
|
||||
+++ b/kernel/sched/psi.c
|
||||
@@ -1046,7 +1046,6 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
|
||||
t->event = 0;
|
||||
t->last_event_time = 0;
|
||||
init_waitqueue_head(&t->event_wait);
|
||||
- kref_init(&t->refcount);
|
||||
|
||||
mutex_lock(&group->trigger_lock);
|
||||
|
||||
@@ -1079,15 +1078,19 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
|
||||
return t;
|
||||
}
|
||||
|
||||
-static void psi_trigger_destroy(struct kref *ref)
|
||||
+void psi_trigger_destroy(struct psi_trigger *t)
|
||||
{
|
||||
- struct psi_trigger *t = container_of(ref, struct psi_trigger, refcount);
|
||||
- struct psi_group *group = t->group;
|
||||
+ struct psi_group *group;
|
||||
struct kthread_worker *kworker_to_destroy = NULL;
|
||||
|
||||
- if (static_branch_likely(&psi_disabled))
|
||||
+ /*
|
||||
+ * We do not check psi_disabled since it might have been disabled after
|
||||
+ * the trigger got created.
|
||||
+ */
|
||||
+ if (!t)
|
||||
return;
|
||||
|
||||
+ group = t->group;
|
||||
/*
|
||||
* Wakeup waiters to stop polling. Can happen if cgroup is deleted
|
||||
* from under a polling process.
|
||||
@@ -1122,9 +1125,9 @@ static void psi_trigger_destroy(struct kref *ref)
|
||||
mutex_unlock(&group->trigger_lock);
|
||||
|
||||
/*
|
||||
- * Wait for both *trigger_ptr from psi_trigger_replace and
|
||||
- * poll_kworker RCUs to complete their read-side critical sections
|
||||
- * before destroying the trigger and optionally the poll_kworker
|
||||
+ * Wait for psi_schedule_poll_work RCU to complete its read-side
|
||||
+ * critical section before destroying the trigger and optionally the
|
||||
+ * poll_task.
|
||||
*/
|
||||
synchronize_rcu();
|
||||
/*
|
||||
@@ -1146,18 +1149,6 @@ static void psi_trigger_destroy(struct kref *ref)
|
||||
kfree(t);
|
||||
}
|
||||
|
||||
-void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *new)
|
||||
-{
|
||||
- struct psi_trigger *old = *trigger_ptr;
|
||||
-
|
||||
- if (static_branch_likely(&psi_disabled))
|
||||
- return;
|
||||
-
|
||||
- rcu_assign_pointer(*trigger_ptr, new);
|
||||
- if (old)
|
||||
- kref_put(&old->refcount, psi_trigger_destroy);
|
||||
-}
|
||||
-
|
||||
__poll_t psi_trigger_poll(void **trigger_ptr,
|
||||
struct file *file, poll_table *wait)
|
||||
{
|
||||
@@ -1167,24 +1158,15 @@ __poll_t psi_trigger_poll(void **trigger_ptr,
|
||||
if (static_branch_likely(&psi_disabled))
|
||||
return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
|
||||
|
||||
- rcu_read_lock();
|
||||
-
|
||||
- t = rcu_dereference(*(void __rcu __force **)trigger_ptr);
|
||||
- if (!t) {
|
||||
- rcu_read_unlock();
|
||||
+ t = smp_load_acquire(trigger_ptr);
|
||||
+ if (!t)
|
||||
return DEFAULT_POLLMASK | EPOLLERR | EPOLLPRI;
|
||||
- }
|
||||
- kref_get(&t->refcount);
|
||||
-
|
||||
- rcu_read_unlock();
|
||||
|
||||
poll_wait(file, &t->event_wait, wait);
|
||||
|
||||
if (cmpxchg(&t->event, 1, 0) == 1)
|
||||
ret |= EPOLLPRI;
|
||||
|
||||
- kref_put(&t->refcount, psi_trigger_destroy);
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1208,14 +1190,24 @@ static ssize_t psi_write(struct file *file, const char __user *user_buf,
|
||||
|
||||
buf[buf_size - 1] = '\0';
|
||||
|
||||
- new = psi_trigger_create(&psi_system, buf, nbytes, res);
|
||||
- if (IS_ERR(new))
|
||||
- return PTR_ERR(new);
|
||||
-
|
||||
seq = file->private_data;
|
||||
+
|
||||
/* Take seq->lock to protect seq->private from concurrent writes */
|
||||
mutex_lock(&seq->lock);
|
||||
- psi_trigger_replace(&seq->private, new);
|
||||
+
|
||||
+ /* Allow only one trigger per file descriptor */
|
||||
+ if (seq->private) {
|
||||
+ mutex_unlock(&seq->lock);
|
||||
+ return -EBUSY;
|
||||
+ }
|
||||
+
|
||||
+ new = psi_trigger_create(&psi_system, buf, nbytes, res);
|
||||
+ if (IS_ERR(new)) {
|
||||
+ mutex_unlock(&seq->lock);
|
||||
+ return PTR_ERR(new);
|
||||
+ }
|
||||
+
|
||||
+ smp_store_release(&seq->private, new);
|
||||
mutex_unlock(&seq->lock);
|
||||
|
||||
return nbytes;
|
||||
@@ -1250,7 +1242,7 @@ static int psi_fop_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct seq_file *seq = file->private_data;
|
||||
|
||||
- psi_trigger_replace(&seq->private, NULL);
|
||||
+ psi_trigger_destroy(seq->private);
|
||||
return single_release(inode, file);
|
||||
}
|
||||
|
||||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
|
||||
index 55c0f32b9375b..dbc9b2f53649d 100644
|
||||
--- a/net/core/rtnetlink.c
|
||||
+++ b/net/core/rtnetlink.c
|
||||
@@ -3022,8 +3022,8 @@ static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
struct nlattr *slave_attr[RTNL_SLAVE_MAX_TYPE + 1];
|
||||
unsigned char name_assign_type = NET_NAME_USER;
|
||||
struct nlattr *linkinfo[IFLA_INFO_MAX + 1];
|
||||
- const struct rtnl_link_ops *m_ops = NULL;
|
||||
- struct net_device *master_dev = NULL;
|
||||
+ const struct rtnl_link_ops *m_ops;
|
||||
+ struct net_device *master_dev;
|
||||
struct net *net = sock_net(skb->sk);
|
||||
const struct rtnl_link_ops *ops;
|
||||
struct nlattr *tb[IFLA_MAX + 1];
|
||||
@@ -3063,6 +3063,8 @@ replay:
|
||||
dev = NULL;
|
||||
}
|
||||
|
||||
+ master_dev = NULL;
|
||||
+ m_ops = NULL;
|
||||
if (dev) {
|
||||
master_dev = netdev_master_upper_dev_get(dev);
|
||||
if (master_dev)
|
||||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
|
||||
index 839e1caa57a59..ed11013d4b953 100644
|
||||
--- a/net/packet/af_packet.c
|
||||
+++ b/net/packet/af_packet.c
|
||||
@@ -1729,7 +1729,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
|
||||
err = -ENOSPC;
|
||||
if (refcount_read(&match->sk_ref) < PACKET_FANOUT_MAX) {
|
||||
__dev_remove_pack(&po->prot_hook);
|
||||
- po->fanout = match;
|
||||
+
|
||||
+ /* Paired with packet_setsockopt(PACKET_FANOUT_DATA) */
|
||||
+ WRITE_ONCE(po->fanout, match);
|
||||
+
|
||||
po->rollover = rollover;
|
||||
rollover = NULL;
|
||||
refcount_set(&match->sk_ref, refcount_read(&match->sk_ref) + 1);
|
||||
@@ -3876,7 +3879,8 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
|
||||
}
|
||||
case PACKET_FANOUT_DATA:
|
||||
{
|
||||
- if (!po->fanout)
|
||||
+ /* Paired with the WRITE_ONCE() in fanout_add() */
|
||||
+ if (!READ_ONCE(po->fanout))
|
||||
return -EINVAL;
|
||||
|
||||
return fanout_set_data(po, optval, optlen);
|
||||
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
|
||||
index a4c61205462ac..80205b138d113 100644
|
||||
--- a/net/sched/cls_api.c
|
||||
+++ b/net/sched/cls_api.c
|
||||
@@ -1928,9 +1928,9 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
bool prio_allocate;
|
||||
u32 parent;
|
||||
u32 chain_index;
|
||||
- struct Qdisc *q = NULL;
|
||||
+ struct Qdisc *q;
|
||||
struct tcf_chain_info chain_info;
|
||||
- struct tcf_chain *chain = NULL;
|
||||
+ struct tcf_chain *chain;
|
||||
struct tcf_block *block;
|
||||
struct tcf_proto *tp;
|
||||
unsigned long cl;
|
||||
@@ -1958,6 +1958,8 @@ replay:
|
||||
tp = NULL;
|
||||
cl = 0;
|
||||
block = NULL;
|
||||
+ q = NULL;
|
||||
+ chain = NULL;
|
||||
|
||||
if (prio == 0) {
|
||||
/* If no priority is provided by the user,
|
||||
@@ -2764,8 +2766,8 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
struct tcmsg *t;
|
||||
u32 parent;
|
||||
u32 chain_index;
|
||||
- struct Qdisc *q = NULL;
|
||||
- struct tcf_chain *chain = NULL;
|
||||
+ struct Qdisc *q;
|
||||
+ struct tcf_chain *chain;
|
||||
struct tcf_block *block;
|
||||
unsigned long cl;
|
||||
int err;
|
||||
@@ -2775,6 +2777,7 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
return -EPERM;
|
||||
|
||||
replay:
|
||||
+ q = NULL;
|
||||
err = nlmsg_parse_deprecated(n, sizeof(*t), tca, TCA_MAX,
|
||||
rtm_tca_policy, extack);
|
||||
if (err < 0)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,79 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 6d33284664fef..5688e17a44363 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 178
|
||||
+SUBLEVEL = 179
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c
|
||||
index 5553a5643f405..5c81dc7371db7 100644
|
||||
--- a/drivers/mmc/host/moxart-mmc.c
|
||||
+++ b/drivers/mmc/host/moxart-mmc.c
|
||||
@@ -696,12 +696,12 @@ static int moxart_remove(struct platform_device *pdev)
|
||||
if (!IS_ERR(host->dma_chan_rx))
|
||||
dma_release_channel(host->dma_chan_rx);
|
||||
mmc_remove_host(mmc);
|
||||
- mmc_free_host(mmc);
|
||||
|
||||
writel(0, host->base + REG_INTERRUPT_MASK);
|
||||
writel(0, host->base + REG_POWER_CONTROL);
|
||||
writel(readl(host->base + REG_CLOCK_CONTROL) | CLK_OFF,
|
||||
host->base + REG_CLOCK_CONTROL);
|
||||
+ mmc_free_host(mmc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
diff --git a/net/tipc/link.c b/net/tipc/link.c
|
||||
index f25010261a9e0..8f2ee71c63c6d 100644
|
||||
--- a/net/tipc/link.c
|
||||
+++ b/net/tipc/link.c
|
||||
@@ -1953,15 +1953,18 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
|
||||
u16 peers_tol = msg_link_tolerance(hdr);
|
||||
u16 peers_prio = msg_linkprio(hdr);
|
||||
u16 rcv_nxt = l->rcv_nxt;
|
||||
- u16 dlen = msg_data_sz(hdr);
|
||||
+ u32 dlen = msg_data_sz(hdr), glen = 0;
|
||||
int mtyp = msg_type(hdr);
|
||||
bool reply = msg_probe(hdr);
|
||||
- u16 glen = 0;
|
||||
void *data;
|
||||
char *if_name;
|
||||
int rc = 0;
|
||||
|
||||
trace_tipc_proto_rcv(skb, false, l->name);
|
||||
+
|
||||
+ if (dlen > U16_MAX)
|
||||
+ goto exit;
|
||||
+
|
||||
if (tipc_link_is_blocked(l) || !xmitq)
|
||||
goto exit;
|
||||
|
||||
@@ -2063,7 +2066,8 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
|
||||
if (glen != tipc_gap_ack_blks_sz(ga->gack_cnt))
|
||||
ga = NULL;
|
||||
}
|
||||
-
|
||||
+ if(glen > dlen)
|
||||
+ break;
|
||||
tipc_mon_rcv(l->net, data + glen, dlen - glen, l->addr,
|
||||
&l->mon_state, l->bearer_id);
|
||||
|
||||
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
|
||||
index 58708b4c7719f..e7155a7743001 100644
|
||||
--- a/net/tipc/monitor.c
|
||||
+++ b/net/tipc/monitor.c
|
||||
@@ -457,6 +457,8 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
|
||||
state->probing = false;
|
||||
|
||||
/* Sanity check received domain record */
|
||||
+ if (new_member_cnt > MAX_MON_DOMAIN)
|
||||
+ return;
|
||||
if (dlen < dom_rec_len(arrv_dom, 0))
|
||||
return;
|
||||
if (dlen != dom_rec_len(arrv_dom, new_member_cnt))
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,511 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f9054b4e8a123..d07421bc5c2fb 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 186
|
||||
+SUBLEVEL = 187
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
diff --git a/arch/arm64/include/asm/vectors.h b/arch/arm64/include/asm/vectors.h
|
||||
index f64613a96d530..bc9a2145f4194 100644
|
||||
--- a/arch/arm64/include/asm/vectors.h
|
||||
+++ b/arch/arm64/include/asm/vectors.h
|
||||
@@ -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);
|
||||
|
||||
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
|
||||
index de52428b8833d..4816db0553ef8 100644
|
||||
--- a/drivers/atm/eni.c
|
||||
+++ b/drivers/atm/eni.c
|
||||
@@ -1116,6 +1116,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
|
||||
}
|
||||
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;
|
||||
diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c
|
||||
index 4730f84b646de..3a633a0c40fdf 100644
|
||||
--- a/drivers/crypto/qcom-rng.c
|
||||
+++ b/drivers/crypto/qcom-rng.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/crypto.h>
|
||||
+#include <linux/iopoll.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
@@ -42,16 +43,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);
|
||||
@@ -60,11 +64,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,
|
||||
@@ -86,7 +89,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,
|
||||
diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c
|
||||
index 0e206c9e0d7ae..7ad2d85d7270b 100644
|
||||
--- a/drivers/firmware/efi/apple-properties.c
|
||||
+++ b/drivers/firmware/efi/apple-properties.c
|
||||
@@ -23,7 +23,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);
|
||||
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
|
||||
index 415d7b3a59f82..8fd74a7501d40 100644
|
||||
--- a/drivers/firmware/efi/efi.c
|
||||
+++ b/drivers/firmware/efi/efi.c
|
||||
@@ -231,7 +231,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);
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
|
||||
index f0ea782df836d..312a3c4e23318 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-simple.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-simple.c
|
||||
@@ -1619,7 +1619,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,
|
||||
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
|
||||
index 06d0ffef4a171..acaf8c045f19a 100644
|
||||
--- a/drivers/input/tablet/aiptek.c
|
||||
+++ b/drivers/input/tablet/aiptek.c
|
||||
@@ -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.
|
||||
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
|
||||
index 362b7ca6f3b2a..57e92c5bfcc92 100644
|
||||
--- a/drivers/net/hyperv/netvsc_drv.c
|
||||
+++ b/drivers/net/hyperv/netvsc_drv.c
|
||||
@@ -1445,6 +1445,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];
|
||||
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
|
||||
index 53420c5312667..49801c2eb6271 100644
|
||||
--- a/drivers/net/phy/marvell.c
|
||||
+++ b/drivers/net/phy/marvell.c
|
||||
@@ -1408,8 +1408,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;
|
||||
@@ -1443,8 +1443,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;
|
||||
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
|
||||
index 3922a6f8c50a6..77b1802f829b3 100644
|
||||
--- a/drivers/usb/class/usbtmc.c
|
||||
+++ b/drivers/usb/class/usbtmc.c
|
||||
@@ -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)
|
||||
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
|
||||
index 970ed1514f0bc..fa0c173a0d26f 100644
|
||||
--- a/drivers/usb/gadget/function/rndis.c
|
||||
+++ b/drivers/usb/gadget/function/rndis.c
|
||||
@@ -640,6 +640,7 @@ static int rndis_set_response(struct rndis_params *params,
|
||||
BufLength = le32_to_cpu(buf->InformationBufferLength);
|
||||
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
|
||||
if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||
|
||||
+ (BufOffset > RNDIS_MAX_TOTAL_SIZE) ||
|
||||
(BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE))
|
||||
return -EINVAL;
|
||||
|
||||
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
|
||||
index e41f67cd3d469..f9d2737aabe82 100644
|
||||
--- a/drivers/usb/gadget/udc/core.c
|
||||
+++ b/drivers/usb/gadget/udc/core.c
|
||||
@@ -1303,7 +1303,6 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
|
||||
usb_gadget_udc_stop(udc);
|
||||
|
||||
udc->driver = NULL;
|
||||
- udc->dev.driver = NULL;
|
||||
udc->gadget->dev.driver = NULL;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1351,6 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
|
||||
driver->function);
|
||||
|
||||
udc->driver = driver;
|
||||
- udc->dev.driver = &driver->driver;
|
||||
udc->gadget->dev.driver = &driver->driver;
|
||||
|
||||
usb_gadget_udc_set_speed(udc, driver->max_speed);
|
||||
@@ -1374,7 +1372,6 @@ err1:
|
||||
dev_err(&udc->dev, "failed to start %s: %d\n",
|
||||
udc->driver->function, ret);
|
||||
udc->driver = NULL;
|
||||
- udc->dev.driver = NULL;
|
||||
udc->gadget->dev.driver = NULL;
|
||||
return ret;
|
||||
}
|
||||
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
|
||||
index eaec97892dce8..c1cf67b24c19b 100644
|
||||
--- a/fs/ocfs2/super.c
|
||||
+++ b/fs/ocfs2/super.c
|
||||
@@ -1100,17 +1100,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) {
|
||||
@@ -1128,6 +1117,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
|
||||
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
|
||||
index bf5c5f32c65e4..e147ea6794670 100644
|
||||
--- a/include/linux/if_arp.h
|
||||
+++ b/include/linux/if_arp.h
|
||||
@@ -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;
|
||||
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
|
||||
index 70e6fc2edd304..1f27641f9cc07 100644
|
||||
--- a/net/dsa/dsa2.c
|
||||
+++ b/net/dsa/dsa2.c
|
||||
@@ -669,6 +669,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;
|
||||
|
||||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
|
||||
index ed11013d4b953..70c102359bfef 100644
|
||||
--- a/net/packet/af_packet.c
|
||||
+++ b/net/packet/af_packet.c
|
||||
@@ -2257,8 +2257,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) {
|
||||
@@ -3405,6 +3408,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
|
||||
@@ -3427,6 +3432,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);
|
||||
}
|
||||
|
||||
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
|
||||
index 901ad7f6f4dcc..ea2c7beff4868 100644
|
||||
--- a/tools/perf/util/symbol.c
|
||||
+++ b/tools/perf/util/symbol.c
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
diff --git a/tools/testing/selftests/bpf/prog_tests/timer_crash.c b/tools/testing/selftests/bpf/prog_tests/timer_crash.c
|
||||
deleted file mode 100644
|
||||
index f74b82305da8c..0000000000000
|
||||
--- a/tools/testing/selftests/bpf/prog_tests/timer_crash.c
|
||||
+++ /dev/null
|
||||
@@ -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);
|
||||
-}
|
||||
diff --git a/tools/testing/selftests/bpf/progs/timer_crash.c b/tools/testing/selftests/bpf/progs/timer_crash.c
|
||||
deleted file mode 100644
|
||||
index f8f7944e70dae..0000000000000
|
||||
--- a/tools/testing/selftests/bpf/progs/timer_crash.c
|
||||
+++ /dev/null
|
||||
@@ -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";
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
10220
patch/kernel/archive/odroidxu4-5.4/patch-5.4.210-211.patch
Normal file
10220
patch/kernel/archive/odroidxu4-5.4/patch-5.4.210-211.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user