5.10.163-rc1 review
Subsystems (11)
Greg Kroah-Hartman
maintainerPATCH 735/783 vringh: fix range used in iotlb_translate()
In reply to Greg Kroah-HartmanFrom: Stefano Garzarella <[email protected]>
[ Upstream commit f85efa9b0f5381874f727bd98f56787840313f0b ]
vhost_iotlb_itree_first() requires start and last parameters to search for a mapping that overlaps the range.
In iotlb_translate() we cyclically call vhost_iotlb_itree_first(), incrementing addr by the amount already translated, so rightly we move the start parameter passed to vhost_iotlb_itree_first(), but we should hold the last parameter constant.
Let's fix it by saving the last parameter value before incrementing addr in the loop.
Message-Id: <[email protected]>
--- drivers/vhost/vringh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/vhost/vringh.c +2 -3
@@ -1077,7 +1077,7 @@ static int iotlb_translate(const struct vringh *vrh,struct vhost_iotlb_map *map;struct vhost_iotlb *iotlb = vrh->iotlb;int ret =0 ; -u64 s =0 ; +u64 s =0 , last = addr + len -1 ;while (len > s) {u64 size, pa, pfn;
@@ -1087,8 +1087,7 @@ static int iotlb_translate(const struct vringh *vrh,break ; } - map =vhost_iotlb_itree_first (iotlb, addr, - addr + len -1 ); + map =vhost_iotlb_itree_first (iotlb, addr, last);if (!map || map->start > addr) { ret = -EINVAL ;break ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 736/783 vhost: fix range used in translate_desc()
In reply to Greg Kroah-HartmanFrom: Stefano Garzarella <[email protected]>
[ Upstream commit 98047313cdb46828093894d0ac8b1183b8b317f9 ]
vhost_iotlb_itree_first() requires start and last parameters to search for a mapping that overlaps the range.
In translate_desc() we cyclically call vhost_iotlb_itree_first(), incrementing addr by the amount already translated, so rightly we move the start parameter passed to vhost_iotlb_itree_first(), but we should hold the last parameter constant.
Let's fix it by saving the last parameter value before incrementing addr in the loop.
Message-Id: <[email protected]>
--- drivers/vhost/vhost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vhost/vhost.c +2 -2
@@ -2041,7 +2041,7 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,struct vhost_dev *dev = vq->dev;struct vhost_iotlb *umem = dev->iotlb ? dev->iotlb : dev->umem;struct iovec *_iov; -u64 s =0 ; +u64 s =0 , last = addr + len -1 ;int ret =0 ;while ((u64 )len > s) {
@@ -2051,7 +2051,7 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,break ; } - map =vhost_iotlb_itree_first (umem, addr, addr + len -1 ); + map =vhost_iotlb_itree_first (umem, addr, last);if (map ==NULL || map->start > addr) {if (umem != dev->iotlb) { ret = -EFAULT ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 737/783 net/mlx5: Add forgotten cleanup calls into mlx5_init_once() error path
In reply to Greg Kroah-HartmanFrom: Jiri Pirko <[email protected]>
[ Upstream commit 2a35b2c2e6a252eda2134aae6a756861d9299531 ]
There are two cleanup calls missing in mlx5_init_once() error path. Add them making the error path flow to be the same as mlx5_cleanup_once().
--- drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/main.c +2 -0
@@ -906,6 +906,8 @@ static int mlx5_init_once(struct mlx5_core_dev *dev) err_tables_cleanup:mlx5_geneve_destroy (dev->geneve);mlx5_vxlan_destroy (dev->vxlan); +mlx5_cleanup_clock (dev); +mlx5_cleanup_reserved_gids (dev);mlx5_cq_debugfs_cleanup (dev);mlx5_fw_reset_cleanup (dev); err_events_cleanup:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 738/783 net/mlx5: Avoid recovery in probe flows
In reply to Greg Kroah-HartmanFrom: Shay Drory <[email protected]>
[ Upstream commit 9078e843efec530f279a155f262793c58b0746bd ]
Currently, recovery is done without considering whether the device is still in probe flow.
This may lead to recovery before device have finished probed successfully. e.g.: while mlx5_init_one() is running. Recovery flow is using functionality that is loaded only by mlx5_init_one(), and there is no point in running recovery without mlx5_init_one() finished successfully.
Fix it by waiting for probe flow to finish and checking whether the device is probed before trying to perform recovery.
--- drivers/net/ethernet/mellanox/mlx5/core/health.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/health.c +6 -0
@@ -618,6 +618,12 @@ static void mlx5_fw_fatal_reporter_err_work(struct work_struct *work) priv = container_of(health, struct mlx5_priv, health); dev = container_of(priv, struct mlx5_core_dev, priv); +mutex_lock (&dev->intf_state_mutex); +if (test_bit (MLX5_DROP_NEW_HEALTH_WORK , &health->flags)) { +mlx5_core_err (dev,"health works are not permitted at this stage\n" ); +return ; + } +mutex_unlock (&dev->intf_state_mutex);enter_error_state (dev, false);if (IS_ERR_OR_NULL (health->fw_fatal_reporter)) {if (mlx5_health_try_recover (dev))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 739/783 net/mlx5e: IPoIB, Dont allow CQE compression to be turned on by default
In reply to Greg Kroah-HartmanFrom: Dragos Tatulea <[email protected]>
[ Upstream commit b12d581e83e3ae1080c32ab83f123005bd89a840 ]
mlx5e_build_nic_params will turn CQE compression on if the hardware capability is enabled and the slow_pci_heuristic condition is detected. As IPoIB doesn't support CQE compression, make sure to disable the feature in the IPoIB profile init.
Please note that the feature is not exposed to the user for IPoIB interfaces, so it can't be subsequently turned on.
--- drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +4 -0
@@ -69,6 +69,10 @@ static void mlx5i_build_nic_params(struct mlx5_core_dev *mdev, params->lro_en = false; params->hard_mtu =MLX5_IB_GRH_BYTES +MLX5_IPOIB_HARD_LEN ; params->tunneled_offload_en = false; + +/* CQE compression is not supported for IPoIB */ + params->rx_cqe_compress_def = false; +MLX5E_SET_PFLAG (params,MLX5E_PFLAG_RX_CQE_COMPRESS , params->rx_cqe_compress_def); }/* Called directly after IPoIB netdevice was created to initialize SW structs */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 740/783 net/mlx5e: Fix hw mtu initializing at XDP SQ allocation
In reply to Greg Kroah-HartmanFrom: Adham Faris <[email protected]>
[ Upstream commit 1e267ab88dc44c48f556218f7b7f14c76f7aa066 ]
Current xdp xmit functions logic (mlx5e_xmit_xdp_frame_mpwqe or mlx5e_xmit_xdp_frame), validates xdp packet length by comparing it to hw mtu (configured at xdp sq allocation) before xmiting it. This check does not account for ethernet fcs length (calculated and filled by the nic). Hence, when we try sending packets with length > (hw-mtu - ethernet-fcs-size), the device port drops it and tx_errors_phy is incremented. Desired behavior is to catch these packets and drop them by the driver.
Fix this behavior in XDP SQ allocation function (mlx5e_alloc_xdpsq) by subtracting ethernet FCS header size (4 Bytes) from current hw mtu value, since ethernet FCS is calculated and written to ethernet frames by the nic.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
@@ -992,7 +992,7 @@ static int mlx5e_alloc_xdpsq(struct mlx5e_channel *c, sq->channel = c; sq->uar_map = mdev->mlx5e_res.bfreg.map; sq->min_inline_mode = params->tx_min_inline_mode; - sq->hw_mtu =MLX5E_SW2HW_MTU (params, params->sw_mtu); + sq->hw_mtu =MLX5E_SW2HW_MTU (params, params->sw_mtu) -ETH_FCS_LEN ; sq->xsk_pool = xsk_pool; sq->stats = sq->xsk_pool ?
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 741/783 net: amd-xgbe: add missed tasklet_kill
In reply to Greg Kroah-HartmanFrom: Jiguang Xiao <[email protected]>
[ Upstream commit d530ece70f16f912e1d1bfeea694246ab78b0a4b ]
The driver does not call tasklet_kill in several places. Add the calls to fix it.
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +++ drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 4 +++- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +3 -0
@@ -1064,6 +1064,9 @@ static void xgbe_free_irqs(struct xgbe_prv_data *pdata)devm_free_irq (pdata->dev, pdata->dev_irq, pdata); +tasklet_kill (&pdata->tasklet_dev); +tasklet_kill (&pdata->tasklet_ecc); +if (pdata->vdata->ecc_support && (pdata->dev_irq != pdata->ecc_irq))devm_free_irq (pdata->dev, pdata->ecc_irq, pdata);
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c +3 -1
@@ -447,8 +447,10 @@ static void xgbe_i2c_stop(struct xgbe_prv_data *pdata)xgbe_i2c_disable (pdata);xgbe_i2c_clear_all_interrupts (pdata); -if (pdata->dev_irq != pdata->i2c_irq) +if (pdata->dev_irq != pdata->i2c_irq) {devm_free_irq (pdata->dev, pdata->i2c_irq, pdata); +tasklet_kill (&pdata->tasklet_i2c); + } }static int xgbe_i2c_start (struct xgbe_prv_data *pdata)
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +3 -1
@@ -1390,8 +1390,10 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)/* Disable auto-negotiation */ xgbe_an_disable_all (pdata); -if (pdata->dev_irq != pdata->an_irq) +if (pdata->dev_irq != pdata->an_irq) {devm_free_irq (pdata->dev, pdata->an_irq, pdata); +tasklet_kill (&pdata->tasklet_an); + } pdata->phy_if.phy_impl.stop (pdata);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 742/783 net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit d039535850ee47079d59527e96be18d8e0daa84b ]
of_phy_find_device() return device node with refcount incremented. Call put_device() to relese it when not needed anymore.
--- drivers/net/phy/xilinx_gmii2rgmii.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/phy/xilinx_gmii2rgmii.c +1 -0
@@ -82,6 +82,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)if (!priv->phy_dev->drv) {dev_info (dev,"Attached phy not ready\n" ); +put_device (&priv->phy_dev->mdio.dev);return -EPROBE_DEFER ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 743/783 RDMA/mlx5: Fix validation of max_rd_atomic caps for DC
In reply to Greg Kroah-HartmanFrom: Maor Gottlieb <[email protected]>
[ Upstream commit 8de8482fe5732fbef4f5af82bc0c0362c804cd1f ]
Currently, when modifying DC, we validate max_rd_atomic user attribute against the RC cap, validate against DC. RC and DC QP types have different device limitations.
This can cause userspace created DC QPs to malfunction.
--- drivers/infiniband/hw/mlx5/qp.c | 49 +++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 14 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +35 -14
@@ -4258,6 +4258,40 @@ static bool mlx5_ib_modify_qp_allowed(struct mlx5_ib_dev *dev,return false; } +static int validate_rd_atomic (struct mlx5_ib_dev *dev,struct ib_qp_attr *attr, +int attr_mask,enum ib_qp_type qp_type) +{ +int log_max_ra_res; +int log_max_ra_req; + +if (qp_type ==MLX5_IB_QPT_DCI ) { + log_max_ra_res =1 <<MLX5_CAP_GEN (dev->mdev, + log_max_ra_res_dc); + log_max_ra_req =1 <<MLX5_CAP_GEN (dev->mdev, + log_max_ra_req_dc); + }else { + log_max_ra_res =1 <<MLX5_CAP_GEN (dev->mdev, + log_max_ra_res_qp); + log_max_ra_req =1 <<MLX5_CAP_GEN (dev->mdev, + log_max_ra_req_qp); + } + +if (attr_mask &IB_QP_MAX_QP_RD_ATOMIC && + attr->max_rd_atomic > log_max_ra_res) { +mlx5_ib_dbg (dev,"invalid max_rd_atomic value %d\n" , + attr->max_rd_atomic); +return false; + } + +if (attr_mask &IB_QP_MAX_DEST_RD_ATOMIC && + attr->max_dest_rd_atomic > log_max_ra_req) { +mlx5_ib_dbg (dev,"invalid max_dest_rd_atomic value %d\n" , + attr->max_dest_rd_atomic); +return false; + } +return true; +} +int mlx5_ib_modify_qp (struct ib_qp *ibqp,struct ib_qp_attr *attr,int attr_mask,struct ib_udata *udata) {
@@ -4352,21 +4386,8 @@ int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, } } -if (attr_mask &IB_QP_MAX_QP_RD_ATOMIC && - attr->max_rd_atomic > - (1 <<MLX5_CAP_GEN (dev->mdev, log_max_ra_res_qp))) { -mlx5_ib_dbg (dev,"invalid max_rd_atomic value %d\n" , - attr->max_rd_atomic); - goto out; - } - -if (attr_mask &IB_QP_MAX_DEST_RD_ATOMIC && - attr->max_dest_rd_atomic > - (1 <<MLX5_CAP_GEN (dev->mdev, log_max_ra_req_qp))) { -mlx5_ib_dbg (dev,"invalid max_dest_rd_atomic value %d\n" , - attr->max_dest_rd_atomic); +if (!validate_rd_atomic (dev, attr, attr_mask, qp_type)) goto out; - }if (cur_state == new_state && cur_state ==IB_QPS_RESET ) { err =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 744/783 drm/meson: Reduce the FIFO lines held when AFBC is not used
In reply to Greg Kroah-HartmanFrom: Carlo Caione <[email protected]>
[ Upstream commit 3b754ed6d1cd90017e66e5cc16f3923e4a952ffc ]
Having a bigger number of FIFO lines held after vsync is only useful to SoCs using AFBC to give time to the AFBC decoder to be reset, configured and enabled again.
For SoCs not using AFBC this, on the contrary, is causing on some displays issues and a few pixels vertical offset in the displayed image.
Conditionally increase the number of lines held after vsync only for SoCs using AFBC, leaving the default value for all the others.
--- drivers/gpu/drm/meson/meson_viu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/meson/meson_viu.c +2 -3
@@ -436,15 +436,14 @@ void meson_viu_init(struct meson_drm *priv)/* Initialize OSD1 fifo control register */ reg =VIU_OSD_DDR_PRIORITY_URGENT | -VIU_OSD_HOLD_FIFO_LINES (31 ) |VIU_OSD_FIFO_DEPTH_VAL (32 ) |/* fifo_depth_val: 32*8=256 */ VIU_OSD_WORDS_PER_BURST (4 ) |/* 4 words in 1 burst */ VIU_OSD_FIFO_LIMITS (2 );/* fifo_lim: 2*16=32 */ if (meson_vpu_is_compatible (priv,VPU_COMPATIBLE_G12A )) - reg |=VIU_OSD_BURST_LENGTH_32 ; + reg |= (VIU_OSD_BURST_LENGTH_32 |VIU_OSD_HOLD_FIFO_LINES (31 ));else - reg |=VIU_OSD_BURST_LENGTH_64 ; + reg |= (VIU_OSD_BURST_LENGTH_64 |VIU_OSD_HOLD_FIFO_LINES (4 ));writel_relaxed (reg, priv->io_base +_REG (VIU_OSD1_FIFO_CTRL_STAT ));writel_relaxed (reg, priv->io_base +_REG (VIU_OSD2_FIFO_CTRL_STAT ));
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 745/783 filelock: new helper: vfs_inode_has_locks
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
[ Upstream commit ab1ddef98a715eddb65309ffa83267e4e84a571e ]
Ceph has a need to know whether a particular inode has any locks set on it. It's currently tracking that by a num_locks field in its filp->private_data, but that's problematic as it tries to decrement this field when releasing locks and that can race with the file being torn down.
Add a new vfs_inode_has_locks helper that just returns whether any locks are currently held on the inode.
Stable-dep-of: 461ab10ef7e6 ("ceph: switch to vfs_inode_has_locks() to fix file lock bug")
--- fs/locks.c | 23 +++++++++++++++++++++++ include/linux/fs.h | 6 ++++++ 2 files changed, 29 insertions(+)
fs/locks.c +23 -0
@@ -2813,6 +2813,29 @@ int vfs_cancel_lock(struct file *filp, struct file_lock *fl) }EXPORT_SYMBOL_GPL (vfs_cancel_lock); +/** +* vfs_inode_has_locks - are any file locks held on @inode? +* @inode: inode to check for locks +* +* Return true if there are any FL_POSIX or FL_FLOCK locks currently +* set on @inode. +*/ +bool vfs_inode_has_locks (struct inode *inode) +{ +struct file_lock_context *ctx; +bool ret; + + ctx =smp_load_acquire (&inode->i_flctx); +if (!ctx) +return false; + +spin_lock (&ctx->flc_lock); + ret = !list_empty (&ctx->flc_posix) || !list_empty (&ctx->flc_flock); +spin_unlock (&ctx->flc_lock); +return ret; +} +EXPORT_SYMBOL_GPL (vfs_inode_has_locks); +#ifdef CONFIG_PROC_FS #include <linux/proc_fs.h> #include <linux/seq_file.h>
include/linux/fs.h +6 -0
@@ -1145,6 +1145,7 @@ extern int locks_delete_block(struct file_lock *);extern int vfs_test_lock (struct file *,struct file_lock *);extern int vfs_lock_file (struct file *,unsigned int ,struct file_lock *,struct file_lock *);extern int vfs_cancel_lock (struct file *filp,struct file_lock *fl); +bool vfs_inode_has_locks (struct inode *inode);extern int locks_lock_inode_wait (struct inode *inode,struct file_lock *fl);extern int __break_lease (struct inode *inode,unsigned int flags,unsigned int type);extern void lease_get_mtime (struct inode *,struct timespec64 *time);
@@ -1257,6 +1258,11 @@ static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)return 0 ; } +static inline bool vfs_inode_has_locks (struct inode *inode) +{ +return false; +} +static inline int locks_lock_inode_wait (struct inode *inode,struct file_lock *fl) {return -ENOLCK ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 746/783 ceph: switch to vfs_inode_has_locks() to fix file lock bug
In reply to Greg Kroah-HartmanFrom: Xiubo Li <[email protected]>
[ Upstream commit 461ab10ef7e6ea9b41a0571a7fc6a72af9549a3c ]
For the POSIX locks they are using the same owner, which is the thread id. And multiple POSIX locks could be merged into single one, so when checking whether the 'file' has locks may fail.
For a file where some openers use locking and others don't is a really odd usage pattern though. Locks are like stoplights -- they only work if everyone pays attention to them.
Just switch ceph_get_caps() to check whether any locks are set on the inode. If there are POSIX/OFD/FLOCK locks on the file at the time, we should set CHECK_FILELOCK, regardless of what fd was used to set the lock.
--- fs/ceph/caps.c | 2 +- fs/ceph/locks.c | 4 ---- fs/ceph/super.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-)
fs/ceph/caps.c +1 -1
@@ -2957,7 +2957,7 @@ int ceph_get_caps(struct file *filp, int need, int want,while (true) { flags &=CEPH_FILE_MODE_MASK ; -if (atomic_read (&fi->num_locks)) +if (vfs_inode_has_locks (inode)) flags |=CHECK_FILELOCK ; _got =0 ; ret = try_get_cap_refs(inode, need, want, endoff,
fs/ceph/locks.c +0 -4
@@ -32,18 +32,14 @@ void __init ceph_flock_init(void)static void ceph_fl_copy_lock (struct file_lock *dst,struct file_lock *src) { -struct ceph_file_info *fi = dst->fl_file->private_data;struct inode *inode =file_inode (dst->fl_file);atomic_inc (&ceph_inode (inode)->i_filelock_ref); -atomic_inc (&fi->num_locks); }static void ceph_fl_release_lock (struct file_lock *fl) { -struct ceph_file_info *fi = fl->fl_file->private_data;struct inode *inode =file_inode (fl->fl_file);struct ceph_inode_info *ci =ceph_inode (inode); -atomic_dec (&fi->num_locks);if (atomic_dec_and_test (&ci->i_filelock_ref)) {/* clear error when all locks are released */ spin_lock (&ci->i_ceph_lock);
fs/ceph/super.h +0 -1
@@ -772,7 +772,6 @@ struct ceph_file_info {struct list_head rw_contexts;u32 filp_gen; -atomic_t num_locks; };struct ceph_dir_file_info {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 747/783 gpio: sifive: Fix refcount leak in sifive_gpio_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 694175cd8a1643cde3acb45c9294bca44a8e08e9 ]
of_irq_find_parent() returns a node pointer with refcount incremented, We should use of_node_put() on it when not needed anymore. Add missing of_node_put() to avoid refcount leak.
--- drivers/gpio/gpio-sifive.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-sifive.c +1 -0
@@ -195,6 +195,7 @@ static int sifive_gpio_probe(struct platform_device *pdev)return -ENODEV ; } parent =irq_find_host (irq_parent); +of_node_put (irq_parent);if (!parent) {dev_err (dev,"no IRQ parent domain\n" );return -ENODEV ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 748/783 net: sched: atm: dont intepret cls results when asked to drop
In reply to Greg Kroah-HartmanFrom: Jamal Hadi Salim <[email protected]>
[ Upstream commit a2965c7be0522eaa18808684b7b82b248515511b ]
If asked to drop a packet via TC_ACT_SHOT it is unsafe to assume res.class contains a valid pointer
--- net/sched/sch_atm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/sch_atm.c +4 -1
@@ -396,10 +396,13 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch, result =tcf_classify (skb, fl, &res, true);if (result <0 )continue ; +if (result ==TC_ACT_SHOT ) + goto done; + flow = (struct atm_flow_data *)res.class;if (!flow) flow =lookup_flow (sch, res.classid); - goto done; + goto drop; } } flow =NULL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 749/783 net: sched: cbq: dont intepret cls results when asked to drop
In reply to Greg Kroah-HartmanFrom: Jamal Hadi Salim <[email protected]>
[ Upstream commit caa4b35b4317d5147b3ab0fbdc9c075c7d2e9c12 ]
If asked to drop a packet via TC_ACT_SHOT it is unsafe to assume that res.class contains a valid pointer
Sample splat reported by Kyle Zeng
[ 5.405624] 0: reclassify loop, rule prio 0, protocol 800 [ 5.406326] ================================================================== [ 5.407240] BUG: KASAN: slab-out-of-bounds in cbq_enqueue+0x54b/0xea0 [ 5.407987] Read of size 1 at addr ffff88800e3122aa by task poc/299 [ 5.408731] [ 5.408897] CPU: 0 PID: 299 Comm: poc Not tainted 5.10.155+ #15 [ 5.409516] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [ 5.410439] Call Trace: [ 5.410764] dump_stack+0x87/0xcd [ 5.411153] print_address_description+0x7a/0x6b0 [ 5.411687] ? vprintk_func+0xb9/0xc0 [ 5.411905] ? printk+0x76/0x96 [ 5.412110] ? cbq_enqueue+0x54b/0xea0 [ 5.412323] kasan_report+0x17d/0x220 [ 5.412591] ? cbq_enqueue+0x54b/0xea0 [ 5.412803] __asan_report_load1_noabort+0x10/0x20 [ 5.413119] cbq_enqueue+0x54b/0xea0 [ 5.413400] ? __kasan_check_write+0x10/0x20 [ 5.413679] __dev_queue_xmit+0x9c0/0x1db0 [ 5.413922] dev_queue_xmit+0xc/0x10 [ 5.414136] ip_finish_output2+0x8bc/0xcd0 [ 5.414436] __ip_finish_output+0x472/0x7a0 [ 5.414692] ip_finish_output+0x5c/0x190 [ 5.414940] ip_output+0x2d8/0x3c0 [ 5.415150] ? ip_mc_finish_output+0x320/0x320 [ 5.415429] __ip_queue_xmit+0x753/0x1760 [ 5.415664] ip_queue_xmit+0x47/0x60 [ 5.415874] __tcp_transmit_skb+0x1ef9/0x34c0 [ 5.416129] tcp_connect+0x1f5e/0x4cb0 [ 5.416347] tcp_v4_connect+0xc8d/0x18c0 [ 5.416577] __inet_stream_connect+0x1ae/0xb40 [ 5.416836] ? local_bh_enable+0x11/0x20 [ 5.417066] ? lock_sock_nested+0x175/0x1d0 [ 5.417309] inet_stream_connect+0x5d/0x90 [ 5.417548] ? __inet_stream_connect+0xb40/0xb40 [ 5.417817] __sys_connect+0x260/0x2b0 [ 5.418037] __x64_sys_connect+0x76/0x80 [ 5.418267] do_syscall_64+0x31/0x50 [ 5.418477] entry_SYSCALL_64_after_hwframe+0x61/0xc6 [ 5.418770] RIP: 0033:0x473bb7 [ 5.418952] Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2a 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 18 89 54 24 0c 48 89 34 24 89 [ 5.420046] RSP: 002b:00007fffd20eb0f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a [ 5.420472] RAX: ffffffffffffffda RBX: 00007fffd20eb578 RCX: 0000000000473bb7 [ 5.420872] RDX: 0000000000000010 RSI: 00007fffd20eb110 RDI: 0000000000000007 [ 5.421271] RBP: 00007fffd20eb150 R08: 0000000000000001 R09: 0000000000000004 [ 5.421671] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 5.422071] R13: 00007fffd20eb568 R14: 00000000004fc740 R15: 0000000000000002 [ 5.422471] [ 5.422562] Allocated by task 299: [ 5.422782] __kasan_kmalloc+0x12d/0x160 [ 5.423007] kasan_kmalloc+0x5/0x10 [ 5.423208] kmem_cache_alloc_trace+0x201/0x2e0 [ 5.423492] tcf_proto_create+0x65/0x290 [ 5.423721] tc_new_tfilter+0x137e/0x1830 [ 5.423957] rtnetlink_rcv_msg+0x730/0x9f0 [ 5.424197] netlink_rcv_skb+0x166/0x300 [ 5.424428] rtnetlink_rcv+0x11/0x20 [ 5.424639] netlink_unicast+0x673/0x860 [ 5.424870] netlink_sendmsg+0x6af/0x9f0 [ 5.425100] __sys_sendto+0x58d/0x5a0 [ 5.425315] __x64_sys_sendto+0xda/0xf0 [ 5.425539] do_syscall_64+0x31/0x50 [ 5.425764] entry_SYSCALL_64_after_hwframe+0x61/0xc6 [ 5.426065] [ 5.426157] The buggy address belongs to the object at ffff88800e312200 [ 5.426157] which belongs to the cache kmalloc-128 of size 128 [ 5.426955] The buggy address is located 42 bytes to the right of [ 5.426955] 128-byte region [ffff88800e312200, ffff88800e312280) [ 5.427688] The buggy address belongs to the page: [ 5.427992] page:000000009875fabc refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xe312 [ 5.428562] flags: 0x100000000000200(slab) [ 5.428812] raw: 0100000000000200 dead000000000100 dead000000000122 ffff888007843680 [ 5.429325] raw: 0000000000000000 0000000000100010 00000001ffffffff ffff88800e312401 [ 5.429875] page dumped because: kasan: bad access detected [ 5.430214] page->mem_cgroup:ffff88800e312401 [ 5.430471] [ 5.430564] Memory state around the buggy address: [ 5.430846] ffff88800e312180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 5.431267] ffff88800e312200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc [ 5.431705] >ffff88800e312280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 5.432123] ^ [ 5.432391] ffff88800e312300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc [ 5.432810] ffff88800e312380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 5.433229] ================================================================== [ 5.433648] Disabling lock debugging due to kernel taint
--- net/sched/sch_cbq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/sched/sch_cbq.c +2 -2
@@ -231,6 +231,8 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) result =tcf_classify (skb, fl, &res, true);if (!fl || result <0 ) goto fallback; +if (result ==TC_ACT_SHOT ) +return NULL ; cl = (void *)res.class;if (!cl) {
@@ -251,8 +253,6 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)case TC_ACT_TRAP : *qerr =NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; fallthrough; -case TC_ACT_SHOT : -return NULL ;case TC_ACT_RECLASSIFY :return cbq_reclassify (skb, cl); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 750/783 netfilter: ipset: fix hash:net,port,net hang with /0 subnet
In reply to Greg Kroah-HartmanFrom: Jozsef Kadlecsik <[email protected]>
[ Upstream commit a31d47be64b9b74f8cfedffe03e0a8a1f9e51f23 ]
The hash:net,port,net set type supports /0 subnets. However, the patch commit 5f7b51bf09baca8e titled "netfilter: ipset: Limit the maximal range of consecutive elements to add/delete" did not take into account it and resulted in an endless loop. The bug is actually older but the patch 5f7b51bf09baca8e brings it out earlier.
Handle /0 subnets properly in hash:net,port,net set types.
--- net/netfilter/ipset/ip_set_hash_netportnet.c | 40 ++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-)
net/netfilter/ipset/ip_set_hash_netportnet.c +21 -19
@@ -172,17 +172,26 @@ hash_netportnet4_kadt(struct ip_set *set, const struct sk_buff *skb,return adtfn (set, &e, &ext, &opt->ext, opt->cmdflags); } +static u32 +hash_netportnet4_range_to_cidr (u32 from,u32 to,u8 *cidr) +{ +if (from ==0 && to ==UINT_MAX ) { + *cidr =0 ; +return to; + } +return ip_set_range_to_cidr (from, to, cidr); +} +static int hash_netportnet4_uadt (struct ip_set *set,struct nlattr *tb[],enum ipset_adt adt,u32 *lineno,u32 flags,bool retried) { -const struct hash_netportnet4 *h = set->data; +struct hash_netportnet4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_netportnet4_elem e = { };struct ip_set_ext ext =IP_SET_INIT_UEXT (set);u32 ip =0 , ip_to =0 , p =0 , port, port_to; -u32 ip2_from =0 , ip2_to =0 , ip2, ipn; -u64 n =0 , m =0 ; +u32 ip2_from =0 , ip2_to =0 , ip2, i =0 ;bool with_ports = false;int ret;
@@ -284,19 +293,6 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[], }else {ip_set_mask_from_to (ip2_from, ip2_to, e.cidr[1 ]); } - ipn = ip; -do { - ipn =ip_set_range_to_cidr (ipn, ip_to, &e.cidr[0 ]); - n++; - }while (ipn++ < ip_to); - ipn = ip2_from; -do { - ipn =ip_set_range_to_cidr (ipn, ip2_to, &e.cidr[1 ]); - m++; - }while (ipn++ < ip2_to); - -if (n*m*(port_to - port +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ;if (retried) { ip =ntohl (h->next.ip[0 ]);
@@ -309,13 +305,19 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[], do { e.ip[0] = htonl(ip); - ip = ip_set_range_to_cidr(ip, ip_to, &e.cidr[0]); + ip = hash_netportnet4_range_to_cidr(ip, ip_to, &e.cidr[0]); for (; p <= port_to; p++) { e.port = htons(p); do { + i++; e.ip[1] = htonl(ip2); - ip2 = ip_set_range_to_cidr(ip2, ip2_to, - &e.cidr[1]); + if (i > IPSET_MAX_RANGE) { + hash_netportnet4_data_next(&h->next, + &e); + return -ERANGE; + } + ip2 = hash_netportnet4_range_to_cidr(ip2, + ip2_to, &e.cidr[1]); ret = adtfn(set, &e, &ext, &ext, flags); if (ret && !ip_set_eexist(ret, flags)) return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 751/783 netfilter: ipset: Rework long task execution when adding/deleting entries
In reply to Greg Kroah-HartmanFrom: Jozsef Kadlecsik <[email protected]>
[ Upstream commit 5e29dc36bd5e2166b834ceb19990d9e68a734d7d ]
When adding/deleting large number of elements in one step in ipset, it can take a reasonable amount of time and can result in soft lockup errors. The patch 5f7b51bf09ba ("netfilter: ipset: Limit the maximal range of consecutive elements to add/delete") tried to fix it by limiting the max elements to process at all. However it was not enough, it is still possible that we get hung tasks. Lowering the limit is not reasonable, so the approach in this patch is as follows: rely on the method used at resizing sets and save the state when we reach a smaller internal batch limit, unlock/lock and proceed from the saved state. Thus we can avoid long continuous tasks and at the same time removed the limit to add/delete large number of elements in one step.
The nfnl mutex is held during the whole operation which prevents one to issue other ipset commands in parallel.
--- include/linux/netfilter/ipset/ip_set.h | 2 +- net/netfilter/ipset/ip_set_core.c | 7 ++++--- net/netfilter/ipset/ip_set_hash_ip.c | 14 ++++++------- net/netfilter/ipset/ip_set_hash_ipmark.c | 13 ++++++------ net/netfilter/ipset/ip_set_hash_ipport.c | 13 ++++++------ net/netfilter/ipset/ip_set_hash_ipportip.c | 13 ++++++------ net/netfilter/ipset/ip_set_hash_ipportnet.c | 13 +++++++----- net/netfilter/ipset/ip_set_hash_net.c | 17 +++++++-------- net/netfilter/ipset/ip_set_hash_netiface.c | 15 ++++++-------- net/netfilter/ipset/ip_set_hash_netnet.c | 23 +++++++-------------- net/netfilter/ipset/ip_set_hash_netport.c | 19 +++++++---------- 11 files changed, 68 insertions(+), 81 deletions(-)
include/linux/netfilter/ipset/ip_set.h +1 -1
@@ -199,7 +199,7 @@ struct ip_set_region { };/* Max range where every element is added/deleted in one step */ -#define IPSET_MAX_RANGE (1<<20) +#define IPSET_MAX_RANGE (1<<14)/* The core set type structure */ struct ip_set_type {
net/netfilter/ipset/ip_set_core.c +4 -3
@@ -1708,9 +1708,10 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set, ret = set->variant->uadt (set, tb, adt, &lineno, flags, retried);ip_set_unlock (set); retried = true; - }while (ret == -EAGAIN && - set->variant->resize && - (ret = set->variant->resize (set, retried)) ==0 ); + }while (ret == -ERANGE || + (ret == -EAGAIN && + set->variant->resize && + (ret = set->variant->resize (set, retried)) ==0 ));if (!ret || (ret == -IPSET_ERR_EXIST && eexist))return 0 ;
net/netfilter/ipset/ip_set_hash_ip.c +7 -7
@@ -97,11 +97,11 @@ static int hash_ip4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_ip4 *h = set->data; + struct hash_ip4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_ip4_elem e = {0 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip =0 , ip_to =0 , hosts; +u32 ip =0 , ip_to =0 , hosts, i =0 ;int ret =0 ;if (tb[IPSET_ATTR_LINENO ])
@@ -146,14 +146,14 @@ hash_ip4_uadt(struct ip_set *set, struct nlattr *tb[], hosts = h->netmask ==32 ?1 :2 << (32 - h->netmask -1 ); -/* 64bit division is not allowed on 32bit */ -if (((u64 )ip_to - ip +1 ) >> (32 - h->netmask) >IPSET_MAX_RANGE ) -return -ERANGE ; -if (retried) ip =ntohl (h->next.ip); -for (; ip <= ip_to;) { +for (; ip <= ip_to; i++) { e.ip =htonl (ip); +if (i >IPSET_MAX_RANGE ) { +hash_ip4_data_next (&h->next, &e); +return -ERANGE ; + } ret =adtfn (set, &e, &ext, &ext, flags);if (ret && !ip_set_eexist (ret, flags))return ret;
net/netfilter/ipset/ip_set_hash_ipmark.c +7 -6
@@ -96,11 +96,11 @@ static int hash_ipmark4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_ipmark4 *h = set->data; + struct hash_ipmark4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_ipmark4_elem e = { };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip, ip_to =0 ; +u32 ip, ip_to =0 , i =0 ;int ret;if (tb[IPSET_ATTR_LINENO ])
@@ -147,13 +147,14 @@ hash_ipmark4_uadt(struct ip_set *set, struct nlattr *tb[],ip_set_mask_from_to (ip, ip_to, cidr); } -if (((u64 )ip_to - ip +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ; -if (retried) ip =ntohl (h->next.ip); -for (; ip <= ip_to; ip++) { +for (; ip <= ip_to; ip++, i++) { e.ip =htonl (ip); +if (i >IPSET_MAX_RANGE ) { +hash_ipmark4_data_next (&h->next, &e); +return -ERANGE ; + } ret =adtfn (set, &e, &ext, &ext, flags);if (ret && !ip_set_eexist (ret, flags))
net/netfilter/ipset/ip_set_hash_ipport.c +7 -6
@@ -104,11 +104,11 @@ static int hash_ipport4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_ipport4 *h = set->data; + struct hash_ipport4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_ipport4_elem e = { .ip =0 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip, ip_to =0 , p =0 , port, port_to; +u32 ip, ip_to =0 , p =0 , port, port_to, i =0 ;bool with_ports = false;int ret;
@@ -172,17 +172,18 @@ hash_ipport4_uadt(struct ip_set *set, struct nlattr *tb[],swap (port, port_to); } -if (((u64 )ip_to - ip +1 )*(port_to - port +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ; -if (retried) ip =ntohl (h->next.ip);for (; ip <= ip_to; ip++) { p = retried && ip ==ntohl (h->next.ip) ?ntohs (h->next.port) : port; -for (; p <= port_to; p++) { +for (; p <= port_to; p++, i++) { e.ip =htonl (ip); e.port =htons (p); +if (i >IPSET_MAX_RANGE ) { +hash_ipport4_data_next (&h->next, &e); +return -ERANGE ; + } ret =adtfn (set, &e, &ext, &ext, flags);if (ret && !ip_set_eexist (ret, flags))
net/netfilter/ipset/ip_set_hash_ipportip.c +7 -6
@@ -107,11 +107,11 @@ static int hash_ipportip4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_ipportip4 *h = set->data; + struct hash_ipportip4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_ipportip4_elem e = { .ip =0 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip, ip_to =0 , p =0 , port, port_to; +u32 ip, ip_to =0 , p =0 , port, port_to, i =0 ;bool with_ports = false;int ret;
@@ -179,17 +179,18 @@ hash_ipportip4_uadt(struct ip_set *set, struct nlattr *tb[],swap (port, port_to); } -if (((u64 )ip_to - ip +1 )*(port_to - port +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ; -if (retried) ip =ntohl (h->next.ip);for (; ip <= ip_to; ip++) { p = retried && ip ==ntohl (h->next.ip) ?ntohs (h->next.port) : port; -for (; p <= port_to; p++) { +for (; p <= port_to; p++, i++) { e.ip =htonl (ip); e.port =htons (p); +if (i >IPSET_MAX_RANGE ) { +hash_ipportip4_data_next (&h->next, &e); +return -ERANGE ; + } ret =adtfn (set, &e, &ext, &ext, flags);if (ret && !ip_set_eexist (ret, flags))
net/netfilter/ipset/ip_set_hash_ipportnet.c +8 -5
@@ -159,12 +159,12 @@ static int hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_ipportnet4 *h = set->data; + struct hash_ipportnet4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_ipportnet4_elem e = { .cidr =HOST_MASK -1 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set);u32 ip =0 , ip_to =0 , p =0 , port, port_to; -u32 ip2_from =0 , ip2_to =0 , ip2; +u32 ip2_from =0 , ip2_to =0 , ip2, i =0 ;bool with_ports = false;u8 cidr;int ret;
@@ -252,9 +252,6 @@ hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[],swap (port, port_to); } -if (((u64 )ip_to - ip +1 )*(port_to - port +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ; - ip2_to = ip2_from;if (tb[IPSET_ATTR_IP2_TO ]) { ret =ip_set_get_hostipaddr4 (tb[IPSET_ATTR_IP2_TO ], &ip2_to);
@@ -281,9 +278,15 @@ hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[],for (; p <= port_to; p++) { e.port =htons (p); do { + i++; e.ip2 = htonl(ip2); ip2 = ip_set_range_to_cidr(ip2, ip2_to, &cidr); e.cidr = cidr - 1; + if (i > IPSET_MAX_RANGE) { + hash_ipportnet4_data_next(&h->next, + &e); + return -ERANGE; + } ret = adtfn(set, &e, &ext, &ext, flags); if (ret && !ip_set_eexist(ret, flags))
net/netfilter/ipset/ip_set_hash_net.c +7 -10
@@ -135,11 +135,11 @@ static int hash_net4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_net4 *h = set->data; + struct hash_net4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_net4_elem e = { .cidr =HOST_MASK };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip =0 , ip_to =0 , ipn, n =0 ; +u32 ip =0 , ip_to =0 , i =0 ;int ret;if (tb[IPSET_ATTR_LINENO ])
@@ -187,19 +187,16 @@ hash_net4_uadt(struct ip_set *set, struct nlattr *tb[],if (ip +UINT_MAX == ip_to)return -IPSET_ERR_HASH_RANGE ; } - ipn = ip; -do { - ipn =ip_set_range_to_cidr (ipn, ip_to, &e.cidr); - n++; - }while (ipn++ < ip_to); - -if (n >IPSET_MAX_RANGE ) -return -ERANGE ;if (retried) ip =ntohl (h->next.ip); do { + i++; e.ip = htonl(ip); + if (i > IPSET_MAX_RANGE) { + hash_net4_data_next(&h->next, &e); + return -ERANGE; + } ip = ip_set_range_to_cidr(ip, ip_to, &e.cidr); ret = adtfn(set, &e, &ext, &ext, flags); if (ret && !ip_set_eexist(ret, flags))
net/netfilter/ipset/ip_set_hash_netiface.c +6 -9
@@ -201,7 +201,7 @@ hash_netiface4_uadt(struct ip_set *set, struct nlattr *tb[],ipset_adtfn adtfn = set->variant->adt[adt];struct hash_netiface4_elem e = { .cidr =HOST_MASK , .elem =1 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 ip =0 , ip_to =0 , ipn, n =0 ; +u32 ip =0 , ip_to =0 , i =0 ;int ret;if (tb[IPSET_ATTR_LINENO ])
@@ -255,19 +255,16 @@ hash_netiface4_uadt(struct ip_set *set, struct nlattr *tb[], }else {ip_set_mask_from_to (ip, ip_to, e.cidr); } - ipn = ip; -do { - ipn =ip_set_range_to_cidr (ipn, ip_to, &e.cidr); - n++; - }while (ipn++ < ip_to); - -if (n >IPSET_MAX_RANGE ) -return -ERANGE ;if (retried) ip =ntohl (h->next.ip); do { + i++; e.ip = htonl(ip); + if (i > IPSET_MAX_RANGE) { + hash_netiface4_data_next(&h->next, &e); + return -ERANGE; + } ip = ip_set_range_to_cidr(ip, ip_to, &e.cidr); ret = adtfn(set, &e, &ext, &ext, flags);
net/netfilter/ipset/ip_set_hash_netnet.c +7 -16
@@ -162,13 +162,12 @@ static int hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_netnet4 *h = set->data; + struct hash_netnet4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_netnet4_elem e = { };struct ip_set_ext ext =IP_SET_INIT_UEXT (set);u32 ip =0 , ip_to =0 ; -u32 ip2 =0 , ip2_from =0 , ip2_to =0 , ipn; -u64 n =0 , m =0 ; +u32 ip2 =0 , ip2_from =0 , ip2_to =0 , i =0 ;int ret;if (tb[IPSET_ATTR_LINENO ])
@@ -244,19 +243,6 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[], }else {ip_set_mask_from_to (ip2_from, ip2_to, e.cidr[1 ]); } - ipn = ip; -do { - ipn =ip_set_range_to_cidr (ipn, ip_to, &e.cidr[0 ]); - n++; - }while (ipn++ < ip_to); - ipn = ip2_from; -do { - ipn =ip_set_range_to_cidr (ipn, ip2_to, &e.cidr[1 ]); - m++; - }while (ipn++ < ip2_to); - -if (n*m >IPSET_MAX_RANGE ) -return -ERANGE ;if (retried) { ip =ntohl (h->next.ip[0 ]);
@@ -269,7 +255,12 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[], e.ip[0 ] =htonl (ip); ip =ip_set_range_to_cidr (ip, ip_to, &e.cidr[0 ]); do { + i++; e.ip[1] = htonl(ip2); + if (i > IPSET_MAX_RANGE) { + hash_netnet4_data_next(&h->next, &e); + return -ERANGE; + } ip2 = ip_set_range_to_cidr(ip2, ip2_to, &e.cidr[1]); ret = adtfn(set, &e, &ext, &ext, flags); if (ret && !ip_set_eexist(ret, flags))
net/netfilter/ipset/ip_set_hash_netport.c +7 -12
@@ -153,12 +153,11 @@ static int hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[], enum ipset_adt adt, u32 *lineno, u32 flags, bool retried) { - const struct hash_netport4 *h = set->data; + struct hash_netport4 *h = set->data;ipset_adtfn adtfn = set->variant->adt[adt];struct hash_netport4_elem e = { .cidr =HOST_MASK -1 };struct ip_set_ext ext =IP_SET_INIT_UEXT (set); -u32 port, port_to, p =0 , ip =0 , ip_to =0 , ipn; -u64 n =0 ; +u32 port, port_to, p =0 , ip =0 , ip_to =0 , i =0 ;bool with_ports = false;u8 cidr;int ret;
@@ -235,14 +234,6 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[], }else {ip_set_mask_from_to (ip, ip_to, e.cidr +1 ); } - ipn = ip; -do { - ipn =ip_set_range_to_cidr (ipn, ip_to, &cidr); - n++; - }while (ipn++ < ip_to); - -if (n*(port_to - port +1 ) >IPSET_MAX_RANGE ) -return -ERANGE ;if (retried) { ip =ntohl (h->next.ip);
@@ -254,8 +245,12 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[], e.ip =htonl (ip); ip =ip_set_range_to_cidr (ip, ip_to, &cidr); e.cidr = cidr -1 ; -for (; p <= port_to; p++) { +for (; p <= port_to; p++, i++) { e.port =htons (p); +if (i >IPSET_MAX_RANGE ) { +hash_netport4_data_next (&h->next, &e); +return -ERANGE ; + } ret =adtfn (set, &e, &ext, &ext, flags);if (ret && !ip_set_eexist (ret, flags))return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 752/783 perf tools: Fix resources leak in perf_data__open_dir()
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 0a6564ebd953c4590663c9a3c99a3ea9920ade6f ]
In perf_data__open_dir(), opendir() opens the directory stream. Add missing closedir() to release it after use.
--- tools/perf/util/data.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/data.c +2 -0
@@ -127,6 +127,7 @@ int perf_data__open_dir(struct perf_data *data) file->size = st.st_size; } +closedir (dir);if (!files)return -EINVAL ;
@@ -135,6 +136,7 @@ int perf_data__open_dir(struct perf_data *data)return 0 ; out_err: +closedir (dir);close_dir (files, nr);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 753/783 drivers/net/bonding/bond_3ad: return when theres no aggregator
In reply to Greg Kroah-HartmanFrom: Daniil Tatianin <[email protected]>
[ Upstream commit 9c807965483f42df1d053b7436eedd6cf28ece6f ]
Otherwise we would dereference a NULL aggregator pointer when calling __set_agg_ports_ready on the line below.
Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
--- drivers/net/bonding/bond_3ad.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_3ad.c +1 -0
@@ -1520,6 +1520,7 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)slave_err (bond->dev, port->slave->dev,"Port %d did not find a suitable aggregator\n" , port->actor_port_number); +return ; } }/* if all aggregator's ports are READY_N == TRUE, set ready=TRUE
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 754/783 usb: rndis_host: Secure rndis_query check against int overflow
In reply to Greg Kroah-HartmanFrom: Szymon Heidrich <[email protected]>
[ Upstream commit c7dd13805f8b8fc1ce3b6d40f6aff47e66b72ad2 ]
Variables off and len typed as uint32 in rndis_query function are controlled by incoming RNDIS response message thus their value may be manipulated. Setting off to a unexpectetly large value will cause the sum with len and 8 to overflow and pass the implemented validation step. Consequently the response pointer will be referring to a location past the expected buffer boundaries allowing information leakage e.g. via RNDIS_OID_802_3_PERMANENT_ADDRESS OID.
--- drivers/net/usb/rndis_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/rndis_host.c +2 -1
@@ -255,7 +255,8 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, off =le32_to_cpu (u.get_c->offset); len =le32_to_cpu (u.get_c->len); -if (unlikely ((8 + off + len) >CONTROL_BUFFER_SIZE )) +if (unlikely ((off >CONTROL_BUFFER_SIZE -8 ) || + (len >CONTROL_BUFFER_SIZE -8 - off))) goto response_error;if (*reply_len !=-1 && len != *reply_len)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 755/783 drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 3792fc508c095abd84b10ceae12bd773e61fdc36 ]
Call intel_vgpu_unpin_mm() on this error path.
--- drivers/gpu/drm/i915/gvt/scheduler.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gvt/scheduler.c +1 -0
@@ -647,6 +647,7 @@ intel_vgpu_shadow_mm_pin(struct intel_vgpu_workload *workload)if (workload->shadow_mm->type !=INTEL_GVT_MM_PPGTT || !workload->shadow_mm->ppgtt_mm.shadowed) { +intel_vgpu_unpin_mm (workload->shadow_mm);gvt_vgpu_err ("workload shadow ppgtt isn't ready\n" );return -EINVAL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 756/783 caif: fix memory leak in cfctrl_linkup_request()
In reply to Greg Kroah-HartmanFrom: Zhengchao Shao <[email protected]>
[ Upstream commit fe69230f05897b3de758427b574fc98025dfc907 ]
When linktype is unknown or kzalloc failed in cfctrl_linkup_request(), pkt is not released. Add release process to error path.
--- net/caif/cfctrl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/caif/cfctrl.c +5 -1
@@ -269,11 +269,15 @@ int cfctrl_linkup_request(struct cflayer *layer,default :pr_warn ("Request setup of bad link type = %d\n" , param->linktype); +cfpkt_destroy (pkt);return -EINVAL ; } req =kzalloc (sizeof (*req),GFP_KERNEL ); -if (!req) +if (!req) { +cfpkt_destroy (pkt);return -ENOMEM ; + } + req->client_layer = user_layer; req->cmd =CFCTRL_CMD_LINK_SETUP ; req->param = *param;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 757/783 udf: Fix extension of the last extent in the file
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
[ Upstream commit 83c7423d1eb6806d13c521d1002cc1a012111719 ]
When extending the last extent in the file within the last block, we wrongly computed the length of the last extent. This is mostly a cosmetical problem since the extent does not contain any data and the length will be fixed up by following operations but still.
--- fs/udf/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/udf/inode.c +1 -1
@@ -599,7 +599,7 @@ static void udf_do_extend_final_block(struct inode *inode,*/ if (new_elen <= (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ))return ; - added_bytes = (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ) - new_elen; + added_bytes = new_elen - (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ); last_ext->extLength += added_bytes;UDF_I (inode)->i_lenExtents += added_bytes;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 758/783 ASoC: Intel: bytcr_rt5640: Add quirk for the Advantech MICA-071 tablet
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit a1dec9d70b6ad97087b60b81d2492134a84208c6 ]
The Advantech MICA-071 tablet deviates from the defaults for a non CR Bay Trail based tablet in several ways:
1. It uses an analog MIC on IN3 rather then using DMIC1
2. It only has 1 speaker
3. It needs the OVCD current threshold to be set to 1500uA instead of the default 2000uA to reliable differentiate between headphones vs headsets
Add a quirk with these settings for this tablet.
--- sound/soc/intel/boards/bytcr_rt5640.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/intel/boards/bytcr_rt5640.c +15 -0
@@ -430,6 +430,21 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_SSP0_AIF1 | BYT_RT5640_MCLK_EN), }, + { +/* Advantech MICA-071 */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Advantech" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"), + }, +/* OVCD Th = 1500uA to reliable detect head-phones vs -set */ + .driver_data = (void *)(BYT_RT5640_IN3_MAP | +BYT_RT5640_JD_SRC_JD2_IN4N | +BYT_RT5640_OVCD_TH_1500UA | +BYT_RT5640_OVCD_SF_0P75 | +BYT_RT5640_MONO_SPEAKER | +BYT_RT5640_DIFF_MIC | + BYT_RT5640_MCLK_EN), + }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ARCHOS"),
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 759/783 nvme: fix multipath crash caused by flush request when blktrace is enabled
In reply to Greg Kroah-HartmanFrom: Yanjun Zhang <[email protected]>
[ Upstream commit 3659fb5ac29a5e6102bebe494ac789fd47fb78f4 ]
The flush request initialized by blk_kick_flush has NULL bio, and it may be dealt with nvme_end_req during io completion. When blktrace is enabled, nvme_trace_bio_complete with multipath activated trying to access NULL pointer bio from flush request results in the following crash:
[ 2517.831677] BUG: kernel NULL pointer dereference, address: 000000000000001a [ 2517.835213] #PF: supervisor read access in kernel mode [ 2517.838724] #PF: error_code(0x0000) - not-present page [ 2517.842222] PGD 7b2d51067 P4D 0 [ 2517.845684] Oops: 0000 [#1] SMP NOPTI [ 2517.849125] CPU: 2 PID: 732 Comm: kworker/2:1H Kdump: loaded Tainted: G S 5.15.67-0.cl9.x86_64 #1 [ 2517.852723] Hardware name: XFUSION 2288H V6/BC13MBSBC, BIOS 1.13 07/27/2022 [ 2517.856358] Workqueue: nvme_tcp_wq nvme_tcp_io_work [nvme_tcp] [ 2517.859993] RIP: 0010:blk_add_trace_bio_complete+0x6/0x30 [ 2517.863628] Code: 1f 44 00 00 48 8b 46 08 31 c9 ba 04 00 10 00 48 8b 80 50 03 00 00 48 8b 78 50 e9 e5 fe ff ff 0f 1f 44 00 00 41 54 49 89 f4 55 <0f> b6 7a 1a 48 89 d5 e8 3e 1c 2b 00 48 89 ee 4c 89 e7 5d 89 c1 ba [ 2517.871269] RSP: 0018:ff7f6a008d9dbcd0 EFLAGS: 00010286 [ 2517.875081] RAX: ff3d5b4be00b1d50 RBX: 0000000002040002 RCX: ff3d5b0a270f2000 [ 2517.878966] RDX: 0000000000000000 RSI: ff3d5b0b021fb9f8 RDI: 0000000000000000 [ 2517.882849] RBP: ff3d5b0b96a6fa00 R08: 0000000000000001 R09: 0000000000000000 [ 2517.886718] R10: 000000000000000c R11: 000000000000000c R12: ff3d5b0b021fb9f8 [ 2517.890575] R13: 0000000002000000 R14: ff3d5b0b021fb1b0 R15: 0000000000000018 [ 2517.894434] FS: 0000000000000000(0000) GS:ff3d5b42bfc80000(0000) knlGS:0000000000000000 [ 2517.898299] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2517.902157] CR2: 000000000000001a CR3: 00000004f023e005 CR4: 0000000000771ee0 [ 2517.906053] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2517.909930] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2517.913761] PKRU: 55555554 [ 2517.917558] Call Trace: [ 2517.921294] <TASK> [ 2517.924982] nvme_complete_rq+0x1c3/0x1e0 [nvme_core] [ 2517.928715] nvme_tcp_recv_pdu+0x4d7/0x540 [nvme_tcp] [ 2517.932442] nvme_tcp_recv_skb+0x4f/0x240 [nvme_tcp] [ 2517.936137] ? nvme_tcp_recv_pdu+0x540/0x540 [nvme_tcp] [ 2517.939830] tcp_read_sock+0x9c/0x260 [ 2517.943486] nvme_tcp_try_recv+0x65/0xa0 [nvme_tcp] [ 2517.947173] nvme_tcp_io_work+0x64/0x90 [nvme_tcp] [ 2517.950834] process_one_work+0x1e8/0x390 [ 2517.954473] worker_thread+0x53/0x3c0 [ 2517.958069] ? process_one_work+0x390/0x390 [ 2517.961655] kthread+0x10c/0x130 [ 2517.965211] ? set_kthread_struct+0x40/0x40 [ 2517.968760] ret_from_fork+0x1f/0x30 [ 2517.972285] </TASK>
To avoid this situation, add a NULL check for req->bio before calling trace_block_bio_complete.
--- drivers/nvme/host/nvme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/nvme.h +1 -1
@@ -749,7 +749,7 @@ static inline void nvme_trace_bio_complete(struct request *req, {struct nvme_ns *ns = req->q->queuedata; -if (req->cmd_flags &REQ_NVME_MPATH ) +if ((req->cmd_flags &REQ_NVME_MPATH ) && req->bio)trace_block_bio_complete (ns->head->disk->queue, req->bio); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 760/783 x86/bugs: Flush IBP in ib_prctl_set()
In reply to Greg Kroah-HartmanFrom: Rodrigo Branco <[email protected]>
commit a664ec9158eeddd75121d39c9a0758016097fa96 upstream.
We missed the window between the TIF flag update and the next reschedule.
--- arch/x86/kernel/cpu/bugs.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/bugs.c +2 -0
@@ -1896,6 +1896,8 @@ static int ib_prctl_set(struct task_struif (ctrl ==PR_SPEC_FORCE_DISABLE )task_set_spec_ib_force_disable (task);task_update_spec_tif (task); +if (task == current) +indirect_branch_prediction_barrier ();break ;default :return -ERANGE ;
Greg Kroah-Hartman
maintainerPATCH 761/783 nfsd: fix handling of readdir in v4root vs. mount upcall timeout
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
commit cad853374d85fe678d721512cecfabd7636e51f3 upstream.
If v4 READDIR operation hits a mountpoint and gets back an error, then it will include that entry in the reply and set RDATTR_ERROR for it to the error.
That's fine for "normal" exported filesystems, but on the v4root, we need to be more careful to only expose the existence of dentries that lead to exports.
If the mountd upcall times out while checking to see whether a mountpoint on the v4root is exported, then we have no recourse other than to fail the whole operation.
--- fs/nfsd/nfs4xdr.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fs/nfsd/nfs4xdr.c +11 -0
@@ -3405,6 +3405,17 @@ nfsd4_encode_dirent(void *ccdv, const chcase nfserr_noent:xdr_truncate_encode (xdr, start_offset); goto skip_entry; +case nfserr_jukebox: +/* +* The pseudoroot should only display dentries that lead to +* exports. If we get EJUKEBOX here, then we can't tell whether +* this entry should be included. Just fail the whole READDIR +* with NFS4ERR_DELAY in that case, and hope that the situation +* will resolve itself by the client's next attempt. +*/ +if (cd->rd_fhp->fh_export->ex_flags &NFSEXP_V4ROOT ) + goto fail; + fallthrough;default :/* * If the client requested the RDATTR_ERROR attribute,
Greg Kroah-Hartman
maintainerPATCH 762/783 fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB
In reply to Greg Kroah-HartmanFrom: Paul Menzel <[email protected]>
commit f685dd7a8025f2554f73748cfdb8143a21fb92c7 upstream.
Commit 62d89a7d49af ("video: fbdev: matroxfb: set maxvram of vbG200eW to the same as vbG200 to avoid black screen") accidently decreases the maximum memory size for the Matrox G200eW (102b:0532) from 8 MB to 1 MB by missing one zero. This caused the driver initialization to fail with the messages below, as the minimum required VRAM size is 2 MB:
[ 9.436420] matroxfb: Matrox MGA-G200eW (PCI) detected
[ 9.444502] matroxfb: cannot determine memory size
[ 9.449316] matroxfb: probe of 0000:0a:03.0 failed with error -1So, add the missing 0 to make it the intended 16 MB. Successfully tested on the Dell PowerEdge R910/0KYD3D, BIOS 2.10.0 08/29/2013, that the warning is gone.
While at it, add a leading 0 to the maxdisplayable entry, so it’s aligned properly. The value could probably also be increased from 8 MB to 16 MB, as the G200 uses the same values, but I have not checked any datasheet.
Note, matroxfb is obsolete and superseded by the maintained DRM driver mga200, which is used by default on most systems where both drivers are available. Therefore, on most systems it was only a cosmetic issue.
--- drivers/video/fbdev/matrox/matroxfb_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/matrox/matroxfb_base.c +2 -2
@@ -1377,8 +1377,8 @@ static struct video_board vbG200 = { .lowlevel = &matrox_G100 };static struct video_board vbG200eW = { - .maxvram =0x100000 , - .maxdisplayable =0x800000 , + .maxvram =0x1000000 , + .maxdisplayable =0x0800000 , .accelID =FB_ACCEL_MATROX_MGAG200 , .lowlevel = &matrox_G100 };
Greg Kroah-Hartman
maintainerPATCH 763/783 riscv: uaccess: fix type of 0 variable on error in get_user()
In reply to Greg Kroah-HartmanFrom: Ben Dooks <[email protected]>
commit b9b916aee6715cd7f3318af6dc360c4729417b94 upstream.
If the get_user(x, ptr) has x as a pointer, then the setting of (x) = 0 is going to produce the following sparse warning, so fix this by forcing the type of 'x' when access_ok() fails.
fs/aio.c:2073:21: warning: Using plain integer as NULL pointer
--- arch/riscv/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/uaccess.h +1 -1
@@ -216,7 +216,7 @@ do { \might_fault (); \access_ok (__p,sizeof (*__p)) ? \__get_user ((x), __p) : \ - ((x) =0 , -EFAULT ); \ + ((x) = (__force __typeof__(x))0, -EFAULT); \ })#define __put_user_asm (insn, x, ptr, err) \
Greg Kroah-Hartman
maintainerPATCH 764/783 drm/i915/gvt: fix gvt debugfs destroy
In reply to Greg Kroah-HartmanFrom: Zhenyu Wang <[email protected]>
commit c4b850d1f448a901fbf4f7f36dec38c84009b489 upstream.
When gvt debug fs is destroyed, need to have a sane check if drm minor's debugfs root is still available or not, otherwise in case like device remove through unbinding, drm minor's debugfs directory has already been removed, then intel_gvt_debugfs_clean() would act upon dangling pointer like below oops.
i915 0000:00:02.0: Direct firmware load for i915/gvt/vid_0x8086_did_0x1926_rid_0x0a.golden_hw_state failed with error -2 i915 0000:00:02.0: MDEV: Registered
Console: switching to colour dummy device 80x25
i915 0000:00:02.0: MDEV: Unregistering
BUG: kernel NULL pointer dereference, address: 00000000000000a0 PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 2 PID: 2486 Comm: gfx-unbind.sh Tainted: G I 6.1.0-rc8+ #15 Hardware name: Dell Inc. XPS 13 9350/0JXC1H, BIOS 1.13.0 02/10/2020 RIP: 0010:down_write+0x1f/0x90 Code: 1d ff ff 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 53 48 89 fb e8 62 c0 ff ff bf 01 00 00 00 e8 28 5e 31 ff 31 c0 ba 01 00 00 00 <f0> 48 0f b1 13 75 33 65 48 8b 04 25 c0 bd 01 00 48 89 43 08 bf 01 RSP: 0018:ffff9eb3036ffcc8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000000000a0 RCX: ffffff8100000000 RDX: 0000000000000001 RSI: 0000000000000064 RDI: ffffffffa48787a8 RBP: ffff9eb3036ffd30 R08: ffffeb1fc45a0608 R09: ffffeb1fc45a05c0 R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000 R13: ffff91acc33fa328 R14: ffff91acc033f080 R15: ffff91acced533e0 FS: 00007f6947bba740(0000) GS:ffff91ae36d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000a0 CR3: 00000001133a2002 CR4: 00000000003706e0 Call Trace: <TASK> simple_recursive_removal+0x9f/0x2a0 ? start_creating.part.0+0x120/0x120 ? _raw_spin_lock+0x13/0x40 debugfs_remove+0x40/0x60 intel_gvt_debugfs_clean+0x15/0x30 [kvmgt] intel_gvt_clean_device+0x49/0xe0 [kvmgt] intel_gvt_driver_remove+0x2f/0xb0 i915_driver_remove+0xa4/0xf0 i915_pci_remove+0x1a/0x30 pci_device_remove+0x33/0xa0 device_release_driver_internal+0x1b2/0x230 unbind_store+0xe0/0x110 kernfs_fop_write_iter+0x11b/0x1f0 vfs_write+0x203/0x3d0 ksys_write+0x63/0xe0 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6947cb5190 Code: 40 00 48 8b 15 71 9c 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d 51 24 0e 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89 RSP: 002b:00007ffcbac45a28 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f6947cb5190 RDX: 000000000000000d RSI: 0000555e35c866a0 RDI: 0000000000000001 RBP: 0000555e35c866a0 R08: 0000000000000002 R09: 0000555e358cb97c R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000001 R13: 000000000000000d R14: 0000000000000000 R15: 0000555e358cb8e0 </TASK> Modules linked in: kvmgt CR2: 00000000000000a0 ---[ end trace 0000000000000000 ]---
--- drivers/gpu/drm/i915/gvt/debugfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +6 -2
@@ -199,6 +199,10 @@ void intel_gvt_debugfs_init(struct intel*/ void intel_gvt_debugfs_clean (struct intel_gvt *gvt) { -debugfs_remove_recursive (gvt->debugfs_root); - gvt->debugfs_root =NULL ; +struct drm_minor *minor = gvt->gt->i915->drm.primary; + +if (minor->debugfs_root) { +debugfs_remove_recursive (gvt->debugfs_root); + gvt->debugfs_root =NULL ; + } }
Greg Kroah-Hartman
maintainerPATCH 765/783 drm/i915/gvt: fix vgpu debugfs clean in remove
In reply to Greg Kroah-HartmanFrom: Zhenyu Wang <[email protected]>
commit 704f3384f322b40ba24d958473edfb1c9750c8fd upstream.
Check carefully on root debugfs available when destroying vgpu, e.g in remove case drm minor's debugfs root might already be destroyed, which led to kernel oops like below.
Console: switching to colour dummy device 80x25
i915 0000:00:02.0: MDEV: Unregisteringintel_vgpu_mdev b1338b2d-a709-4c23-b766-cc436c36cdf0: Removing from iommu group 14
BUG: kernel NULL pointer dereference, address: 0000000000000150 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP CPU: 3 PID: 1046 Comm: driverctl Not tainted 6.1.0-rc2+ #6 Hardware name: HP HP ProDesk 600 G3 MT/829D, BIOS P02 Ver. 02.44 09/13/2022 RIP: 0010:__lock_acquire+0x5e2/0x1f90 Code: 87 ad 09 00 00 39 05 e1 1e cc 02 0f 82 f1 09 00 00 ba 01 00 00 00 48 83 c4 48 89 d0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ff <48> 81 3f 60 9e c2 b6 45 0f 45 f8 83 fe 01 0f 87 55 fa ff ff 89 f0 RSP: 0018:ffff9f770274f948 EFLAGS: 00010046 RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000150 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 R10: ffff8895d1173300 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000150 R14: 0000000000000000 R15: 0000000000000000 FS: 00007fc9b2ba0740(0000) GS:ffff889cdfcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000150 CR3: 000000010fd93005 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> lock_acquire+0xbf/0x2b0 ? simple_recursive_removal+0xa5/0x2b0 ? lock_release+0x13d/0x2d0 down_write+0x2a/0xd0 ? simple_recursive_removal+0xa5/0x2b0 simple_recursive_removal+0xa5/0x2b0 ? start_creating.part.0+0x110/0x110 ? _raw_spin_unlock+0x29/0x40 debugfs_remove+0x40/0x60 intel_gvt_debugfs_remove_vgpu+0x15/0x30 [kvmgt] intel_gvt_destroy_vgpu+0x60/0x100 [kvmgt] intel_vgpu_release_dev+0xe/0x20 [kvmgt] device_release+0x30/0x80 kobject_put+0x79/0x1b0 device_release_driver_internal+0x1b8/0x230 bus_remove_device+0xec/0x160 device_del+0x189/0x400 ? up_write+0x9c/0x1b0 ? mdev_device_remove_common+0x60/0x60 [mdev] mdev_device_remove_common+0x22/0x60 [mdev] mdev_device_remove_cb+0x17/0x20 [mdev] device_for_each_child+0x56/0x80 mdev_unregister_parent+0x5a/0x81 [mdev] intel_gvt_clean_device+0x2d/0xe0 [kvmgt] intel_gvt_driver_remove+0x2e/0xb0 [i915] i915_driver_remove+0xac/0x100 [i915] i915_pci_remove+0x1a/0x30 [i915] pci_device_remove+0x31/0xa0 device_release_driver_internal+0x1b8/0x230 unbind_store+0xd8/0x100 kernfs_fop_write_iter+0x156/0x210 vfs_write+0x236/0x4a0 ksys_write+0x61/0xd0 do_syscall_64+0x55/0x80 ? find_held_lock+0x2b/0x80 ? lock_release+0x13d/0x2d0 ? up_read+0x17/0x20 ? lock_is_held_type+0xe3/0x140 ? asm_exc_page_fault+0x22/0x30 ? lockdep_hardirqs_on+0x7d/0x100 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fc9b2c9e0c4 Code: 15 71 7d 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 80 3d 3d 05 0e 00 00 74 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 48 89 54 24 18 48 RSP: 002b:00007ffec29c81c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007fc9b2c9e0c4 RDX: 000000000000000d RSI: 0000559f8b5f48a0 RDI: 0000000000000001 RBP: 0000559f8b5f48a0 R08: 0000559f8b5f3540 R09: 00007fc9b2d76d30 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000d R13: 00007fc9b2d77780 R14: 000000000000000d R15: 00007fc9b2d72a00 </TASK> Modules linked in: sunrpc intel_rapl_msr intel_rapl_common intel_pmc_core_pltdrv intel_pmc_core intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel ee1004 igbvf rapl vfat fat intel_cstate intel_uncore pktcdvd i2c_i801 pcspkr wmi_bmof i2c_smbus acpi_pad vfio_pci vfio_pci_core vfio_virqfd zram fuse dm_multipath kvmgt mdev vfio_iommu_type1 vfio kvm irqbypass i915 nvme e1000e igb nvme_core crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic serio_raw ghash_clmulni_intel sha512_ssse3 dca drm_buddy intel_gtt video wmi drm_display_helper ttm CR2: 0000000000000150 ---[ end trace 0000000000000000 ]---
--- drivers/gpu/drm/i915/gvt/debugfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gvt/debugfs.c +7 -2
@@ -175,8 +175,13 @@ void intel_gvt_debugfs_add_vgpu(struct i*/ void intel_gvt_debugfs_remove_vgpu (struct intel_vgpu *vgpu) { -debugfs_remove_recursive (vgpu->debugfs); - vgpu->debugfs =NULL ; +struct intel_gvt *gvt = vgpu->gvt; +struct drm_minor *minor = gvt->gt->i915->drm.primary; + +if (minor->debugfs_root && gvt->debugfs_root) { +debugfs_remove_recursive (vgpu->debugfs); + vgpu->debugfs =NULL ; + } }/**
Greg Kroah-Hartman
maintainerPATCH 766/783 ext4: dont allow journal inode to have encrypt flag
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 105c78e12468413e426625831faa7db4284e1fec upstream.
Mounting a filesystem whose journal inode has the encrypt flag causes a NULL dereference in fscrypt_limit_io_blocks() when the 'inlinecrypt' mount option is used.
The problem is that when jbd2_journal_init_inode() calls bmap(), it eventually finds its way into ext4_iomap_begin(), which calls fscrypt_limit_io_blocks(). fscrypt_limit_io_blocks() requires that if the inode is encrypted, then its encryption key must already be set up. That's not the case here, since the journal inode is never "opened" like a normal file would be. Hence the crash.
A reproducer is:
mkfs.ext4 -F /dev/vdb
debugfs -w /dev/vdb -R "set_inode_field <8> flags 0x80808" mount /dev/vdb /mnt -o inlinecrypt
To fix this, make ext4 consider journal inodes with the encrypt flag to be invalid. (Note, maybe other flags should be rejected on the journal inode too. For now, this is just the minimal fix for the above issue.)
I've marked this as fixing the commit that introduced the call to fscrypt_limit_io_blocks(), since that's what made an actual crash start being possible. But this fix could be applied to any version of ext4 that supports the encrypt feature.
--- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
@@ -5262,7 +5262,7 @@ static struct inode *ext4_get_journal_injbd_debug (2 ,"Journal inode found at %p: %lld bytes\n" , journal_inode, journal_inode->i_size); -if (!S_ISREG (journal_inode->i_mode)) { +if (!S_ISREG (journal_inode->i_mode) ||IS_ENCRYPTED (journal_inode)) {ext4_msg (sb,KERN_ERR ,"invalid journal inode" );iput (journal_inode);return NULL ;
Greg Kroah-Hartman
maintainerPATCH 767/783 selftests: set the BUILD variable to absolute path
In reply to Greg Kroah-HartmanFrom: Muhammad Usama Anjum <[email protected]>
commit 5ad51ab618de5d05f4e692ebabeb6fe6289aaa57 upstream.
The build of kselftests fails if relative path is specified through KBUILD_OUTPUT or O=<path> method. BUILD variable is used to determine the path of the output objects. When make is run from other directories with relative paths, the exact path of the build objects is ambiguous and build fails.
make[1]: Entering directory '/home/usama/repos/kernel/linux_mainline2/tools/testing/selftests/alsa'
gcc mixer-test.c -L/usr/lib/x86_64-linux-gnu -lasound -o build/kselftest/alsa/mixer-test
/usr/bin/ld: cannot open output file build/kselftest/alsa/mixer-test
Set the BUILD variable to the absolute path of the output directory. Make the logic readable and easy to follow. Use spaces instead of tabs for indentation as if with tab indentation is considered recipe in make.
--- tools/testing/selftests/Makefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
tools/testing/selftests/Makefile +17 -9
@@ -103,19 +103,27 @@ ifdef building_out_of_srctree override LDFLAGS = endif -ifneq ($(O),) - BUILD := $(O)/kselftest +top_srcdir ?= ../../.. + +ifeq ("$(origin O)", "command line") + KBUILD_OUTPUT := $(O) +endif + +ifneq ($(KBUILD_OUTPUT),) + # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot + # expand a shell special character '~'. We use a somewhat tedious way here. + abs_objtree := $(shell cd $(top_srcdir) && mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && pwd) + $(if $(abs_objtree),, \ + $(error failed to create output directory "$(KBUILD_OUTPUT)")) + # $(realpath ...) resolves symlinks + abs_objtree := $(realpath $(abs_objtree)) + BUILD := $(abs_objtree)/kselftest else - ifneq ($(KBUILD_OUTPUT),) - BUILD := $(KBUILD_OUTPUT)/kselftest - else - BUILD := $(shell pwd) - DEFAULT_INSTALL_HDR_PATH := 1 - endif + BUILD := $(CURDIR) + DEFAULT_INSTALL_HDR_PATH := 1 endif # Prepare for headers install -top_srcdir ?= ../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?= $(SUBARCH) export KSFT_KHDR_INSTALL_DONE := 1
Greg Kroah-Hartman
maintainerPATCH 768/783 hfs/hfsplus: use WARN_ON for sanity check
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 55d1cbbbb29e6656c662ee8f73ba1fc4777532eb upstream.
gcc warns about a couple of instances in which a sanity check exists but the author wasn't sure how to react to it failing, which makes it look like a possible bug:
fs/hfsplus/inode.c: In function 'hfsplus_cat_read_inode':
fs/hfsplus/inode.c:503:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
503 | /* panic? */;
| ^
fs/hfsplus/inode.c:524:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
524 | /* panic? */;
| ^
fs/hfsplus/inode.c: In function 'hfsplus_cat_write_inode':
fs/hfsplus/inode.c:582:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
582 | /* panic? */;
| ^
fs/hfsplus/inode.c:608:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
608 | /* panic? */;
| ^
fs/hfs/inode.c: In function 'hfs_write_inode':
fs/hfs/inode.c:464:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
464 | /* panic? */;
| ^
fs/hfs/inode.c:485:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
485 | /* panic? */;
| ^panic() is probably not the correct choice here, but a WARN_ON seems appropriate and avoids the compile-time warning.
--- fs/hfs/inode.c | 6 ++---- fs/hfsplus/inode.c | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-)
fs/hfs/inode.c +2 -4
@@ -462,8 +462,7 @@ int hfs_write_inode(struct inode *inode, goto out;if (S_ISDIR (main_inode->i_mode)) { -if (fd.entrylength <sizeof (struct hfs_cat_dir )) -/* panic? */ ; +WARN_ON (fd.entrylength <sizeof (struct hfs_cat_dir ));hfs_bnode_read (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_dir )); if (rec.type != HFS_CDR_DIR ||
@@ -483,8 +482,7 @@ int hfs_write_inode(struct inode *inode,hfs_bnode_write (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); }else { -if (fd.entrylength <sizeof (struct hfs_cat_file )) -/* panic? */ ; +WARN_ON (fd.entrylength <sizeof (struct hfs_cat_file ));hfs_bnode_read (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); if (rec.type != HFS_CDR_FIL ||
fs/hfsplus/inode.c +4 -8
@@ -497,8 +497,7 @@ int hfsplus_cat_read_inode(struct inodeif (type ==HFSPLUS_FOLDER ) {struct hfsplus_cat_folder *folder = &entry.folder; -if (fd->entrylength <sizeof (struct hfsplus_cat_folder )) -/* panic? */ ; +WARN_ON (fd->entrylength <sizeof (struct hfsplus_cat_folder ));hfs_bnode_read (fd->bnode, &entry, fd->entryoffset,sizeof (struct hfsplus_cat_folder ));hfsplus_get_perms (inode, &folder->permissions,1 );
@@ -518,8 +517,7 @@ int hfsplus_cat_read_inode(struct inode }else if (type ==HFSPLUS_FILE ) {struct hfsplus_cat_file *file = &entry.file; -if (fd->entrylength <sizeof (struct hfsplus_cat_file )) -/* panic? */ ; +WARN_ON (fd->entrylength <sizeof (struct hfsplus_cat_file ));hfs_bnode_read (fd->bnode, &entry, fd->entryoffset,sizeof (struct hfsplus_cat_file ));
@@ -576,8 +574,7 @@ int hfsplus_cat_write_inode(struct inodeif (S_ISDIR (main_inode->i_mode)) {struct hfsplus_cat_folder *folder = &entry.folder; -if (fd.entrylength <sizeof (struct hfsplus_cat_folder )) -/* panic? */ ; +WARN_ON (fd.entrylength <sizeof (struct hfsplus_cat_folder ));hfs_bnode_read (fd.bnode, &entry, fd.entryoffset,sizeof (struct hfsplus_cat_folder ));/* simple node checks? */
@@ -602,8 +599,7 @@ int hfsplus_cat_write_inode(struct inode }else {struct hfsplus_cat_file *file = &entry.file; -if (fd.entrylength <sizeof (struct hfsplus_cat_file )) -/* panic? */ ; +WARN_ON (fd.entrylength <sizeof (struct hfsplus_cat_file ));hfs_bnode_read (fd.bnode, &entry, fd.entryoffset,sizeof (struct hfsplus_cat_file ));hfsplus_inode_write_fork (inode, &file->data_fork);
Greg Kroah-Hartman
maintainerPATCH 769/783 hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
commit cb7a95af78d29442b8294683eca4897544b8ef46 upstream.
Commit 55d1cbbbb29e ("hfs/hfsplus: use WARN_ON for sanity check") fixed a build warning by turning a comment into a WARN_ON(), but it turns out that syzbot then complains because it can trigger said warning with a corrupted hfs image.
The warning actually does warn about a bad situation, but we are much better off just handling it as the error it is. So rather than warn about us doing bad things, stop doing the bad things and return -EIO.
While at it, also fix a memory leak that was introduced by an earlier fix for a similar syzbot warning situation, and add a check for one case that historically wasn't handled at all (ie neither comment nor subsequent WARN_ON).
--- fs/hfs/inode.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
fs/hfs/inode.c +10 -5
@@ -454,15 +454,16 @@ int hfs_write_inode(struct inode *inode,/* panic? */ return -EIO ; + res = -EIO ;if (HFS_I (main_inode)->cat_key.CName.len >HFS_NAMELEN ) -return -EIO ; + goto out; fd.search_key->cat =HFS_I (main_inode)->cat_key;if (hfs_brec_find (&fd)) -/* panic? */ goto out;if (S_ISDIR (main_inode->i_mode)) { -WARN_ON (fd.entrylength <sizeof (struct hfs_cat_dir )); +if (fd.entrylength <sizeof (struct hfs_cat_dir )) + goto out;hfs_bnode_read (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_dir )); if (rec.type != HFS_CDR_DIR ||
@@ -475,6 +476,8 @@ int hfs_write_inode(struct inode *inode,hfs_bnode_write (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_dir )); }else if (HFS_IS_RSRC (inode)) { +if (fd.entrylength <sizeof (struct hfs_cat_file )) + goto out;hfs_bnode_read (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); hfs_inode_write_fork(inode, rec.file.RExtRec,
@@ -482,7 +485,8 @@ int hfs_write_inode(struct inode *inode,hfs_bnode_write (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); }else { -WARN_ON (fd.entrylength <sizeof (struct hfs_cat_file )); +if (fd.entrylength <sizeof (struct hfs_cat_file )) + goto out;hfs_bnode_read (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); if (rec.type != HFS_CDR_FIL ||
@@ -499,9 +503,10 @@ int hfs_write_inode(struct inode *inode,hfs_bnode_write (fd.bnode, &rec, fd.entryoffset,sizeof (struct hfs_cat_file )); } + res =0 ; out:hfs_find_exit (&fd); -return 0 ; +return res; } static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
Greg Kroah-Hartman
maintainerPATCH 770/783 mbcache: Avoid nesting of cache->c_list_lock under bit locks
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 5fc4cbd9fde5d4630494fd6ffc884148fb618087 upstream.
Commit 307af6c87937 ("mbcache: automatically delete entries from cache on freeing") started nesting cache->c_list_lock under the bit locks protecting hash buckets of the mbcache hash table in mb_cache_entry_create(). This causes problems for real-time kernels because there spinlocks are sleeping locks while bitlocks stay atomic. Luckily the nesting is easy to avoid by holding entry reference until the entry is added to the LRU list. This makes sure we cannot race with entry deletion.
--- fs/mbcache.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
fs/mbcache.c +10 -7
@@ -90,8 +90,14 @@ int mb_cache_entry_create(struct mb_cachreturn -ENOMEM ;INIT_LIST_HEAD (&entry->e_list); -/* Initial hash reference */ -atomic_set (&entry->e_refcnt,1 ); +/* +* We create entry with two references. One reference is kept by the +* hash table, the other reference is used to protect us from +* mb_cache_entry_delete_or_get() until the entry is fully setup. This +* avoids nesting of cache->c_list_lock into hash table bit locks which +* is problematic for RT. +*/ +atomic_set (&entry->e_refcnt,2 ); entry->e_key = key; entry->e_value = value; entry->e_flags =0 ;
@@ -107,15 +113,12 @@ int mb_cache_entry_create(struct mb_cach } }hlist_bl_add_head (&entry->e_hash_list, head); -/* -* Add entry to LRU list before it can be found by -* mb_cache_entry_delete() to avoid races -*/ +hlist_bl_unlock (head);spin_lock (&cache->c_list_lock);list_add_tail (&entry->e_list, &cache->c_list); cache->c_entry_count++;spin_unlock (&cache->c_list_lock); -hlist_bl_unlock (head); +mb_cache_entry_put (cache, entry);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 771/783 efi: random: combine bootloader provided RNG seed with RNG protocol output
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit 196dff2712ca5a2e651977bb2fe6b05474111a83 upstream.
Instead of blindly creating the EFI random seed configuration table if the RNG protocol is implemented and works, check whether such a EFI configuration table was provided by an earlier boot stage and if so, concatenate the existing and the new seeds, leaving it up to the core code to mix it in and credit it the way it sees fit.
This can be used for, e.g., systemd-boot, to pass an additional seed to Linux in a way that can be consumed by the kernel very early. In that case, the following definitions should be used to pass the seed to the EFI stub:
struct linux_efi_random_seed {
u32 size; // of the 'seed' array in bytes
u8 seed[];
};
The memory for the struct must be allocated as EFI_ACPI_RECLAIM_MEMORY pool memory, and the address of the struct in memory should be installed as a EFI configuration table using the following GUID:
LINUX_EFI_RANDOM_SEED_TABLE_GUID 1ce1e5bc-7ceb-42f2-81e5-8aadf180f57b
Note that doing so is safe even on kernels that were built without this patch applied, but the seed will simply be overwritten with a seed derived from the EFI RNG protocol, if available. The recommended seed size is 32 bytes, and seeds larger than 512 bytes are considered corrupted and ignored entirely.
In order to preserve forward secrecy, seeds from previous bootloaders are memzero'd out, and in order to preserve memory, those older seeds are also freed from memory. Freeing from memory without first memzeroing is not safe to do, as it's possible that nothing else will ever overwrite those pages used by EFI.
[ardb: incorporate Jason's followup changes to extend the maximum seed
size on the consumer end, memzero() it and drop a needless printk]
--- drivers/firmware/efi/efi.c | 4 +-- drivers/firmware/efi/libstub/efistub.h | 2 + drivers/firmware/efi/libstub/random.c | 42 ++++++++++++++++++++++++++++----- include/linux/efi.h | 2 - 4 files changed, 40 insertions(+), 10 deletions(-)
drivers/firmware/efi/efi.c +2 -2
@@ -590,7 +590,7 @@ int __init efi_config_parse_tables(const seed =early_memremap (efi_rng_seed,sizeof (*seed));if (seed !=NULL ) { - size =min (seed->size,EFI_RANDOM_SEED_SIZE ); + size =min_t (u32, seed->size,SZ_1K );// sanity check early_memunmap (seed,sizeof (*seed)); }else {pr_err ("Could not map UEFI random seed!\n" );
@@ -599,8 +599,8 @@ int __init efi_config_parse_tables(const seed =early_memremap (efi_rng_seed,sizeof (*seed) + size);if (seed !=NULL ) { -pr_notice ("seeding entropy pool\n" );add_bootloader_randomness (seed->bits, size); +memzero_explicit (seed->bits, size);early_memunmap (seed,sizeof (*seed) + size); }else {pr_err ("Could not map UEFI random seed!\n" );
drivers/firmware/efi/libstub/efistub.h +2 -0
@@ -767,6 +767,8 @@ efi_status_t efi_get_random_bytes(unsignefi_status_t efi_random_alloc (unsigned long size,unsigned long align,unsigned long *addr,unsigned long random_seed); +efi_status_t efi_random_get_seed (void ); +efi_status_t check_platform_features (void );void *get_efi_config_table (efi_guid_t guid);
drivers/firmware/efi/libstub/random.c +36 -6
76 lines not on this page · raw message
include/linux/efi.h +0 -2
@@ -1108,8 +1108,6 @@ void efi_check_for_embedded_firmwares(vostatic inline void efi_check_for_embedded_firmwares (void ) { }#endif -efi_status_t efi_random_get_seed (void ); -void efi_retrieve_tpm2_eventlog (void );/*
Greg Kroah-Hartman
maintainerPATCH 772/783 io_uring: Fix unsigned res comparison with zero in io_fixup_rw_res()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
Smatch warning: io_fixup_rw_res() warn:
unsigned 'res' is never less than zero.
Change type of 'res' from unsigned to long.
--- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
@@ -2702,7 +2702,7 @@ static bool __io_complete_rw_common(strureturn false; } -static inline int io_fixup_rw_res (struct io_kiocb *req,unsigned res) +static inline int io_fixup_rw_res (struct io_kiocb *req,long res) {struct io_async_rw *io = req->async_data;
Greg Kroah-Hartman
maintainerPATCH 773/783 parisc: Align parisc MADV_XXX constants with all other architectures
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit 71bdea6f798b425bc0003780b13e3fdecb16a010 upstream.
Adjust some MADV_XXX constants to be in sync what their values are on all other platforms. There is currently no reason to have an own numbering on parisc, but it requires workarounds in many userspace sources (e.g. glibc, qemu, ...) - which are often forgotten and thus introduce bugs and different behaviour on parisc.
A wrapper avoids an ABI breakage for existing userspace applications by translating any old values to the new ones, so this change allows us to move over all programs to the new ABI over time.
---
--- arch/parisc/include/uapi/asm/mman.h | 23 +++++++++++------------ arch/parisc/kernel/sys_parisc.c | 27 +++++++++++++++++++++++++++ arch/parisc/kernel/syscalls/syscall.tbl | 2 +- tools/arch/parisc/include/uapi/asm/mman.h | 12 ++++++------ tools/perf/bench/bench.h | 12 ------------ 5 files changed, 45 insertions(+), 31 deletions(-)
arch/parisc/include/uapi/asm/mman.h +11 -12
@@ -49,28 +49,27 @@#define MADV_DONTFORK 10/* don't inherit across fork */ #define MADV_DOFORK 11/* do inherit across fork */ -#define MADV_COLD 20/* deactivate these pages */ -#define MADV_PAGEOUT 21/* reclaim these pages */ - -#define MADV_MERGEABLE 65/* KSM may merge identical pages */ -#define MADV_UNMERGEABLE 66/* KSM may not merge identical pages */ +#define MADV_MERGEABLE 12/* KSM may merge identical pages */ +#define MADV_UNMERGEABLE 13/* KSM may not merge identical pages */ -#define MADV_HUGEPAGE 67/* Worth backing with hugepages */ -#define MADV_NOHUGEPAGE 68/* Not worth backing with hugepages */ +#define MADV_HUGEPAGE 14/* Worth backing with hugepages */ +#define MADV_NOHUGEPAGE 15/* Not worth backing with hugepages */ -#define MADV_DONTDUMP 69/* Explicity exclude from the core dump, +#define MADV_DONTDUMP 16/* Explicity exclude from the core dump, overrides the coredump filter bits */ -#define MADV_DODUMP 70/* Clear the MADV_NODUMP flag */ +#define MADV_DODUMP 17/* Clear the MADV_NODUMP flag */ -#define MADV_WIPEONFORK 71/* Zero memory on fork, child only */ -#define MADV_KEEPONFORK 72/* Undo MADV_WIPEONFORK */ +#define MADV_WIPEONFORK 18/* Zero memory on fork, child only */ +#define MADV_KEEPONFORK 19/* Undo MADV_WIPEONFORK */ + +#define MADV_COLD 20/* deactivate these pages */ +#define MADV_PAGEOUT 21/* reclaim these pages */ #define MADV_HWPOISON 100/* poison a page for testing */ #define MADV_SOFT_OFFLINE 101/* soft offline page for testing */ /* compatibility flags */ #define MAP_FILE 0 -#define MAP_VARIABLE 0#define PKEY_DISABLE_ACCESS 0x1#define PKEY_DISABLE_WRITE 0x2
arch/parisc/kernel/sys_parisc.c +27 -0
@@ -444,3 +444,30 @@ asmlinkage long parisc_inotify_init1(int flags =FIX_O_NONBLOCK (flags);return sys_inotify_init1 (flags); } + +/* +* madvise() wrapper +* +* Up to kernel v6.1 parisc has different values than all other +* platforms for the MADV_xxx flags listed below. +* To keep binary compatibility with existing userspace programs +* translate the former values to the new values. +* +* XXX: Remove this wrapper in year 2025 (or later) +*/ + +asmlinkage notrace long parisc_madvise(unsigned long start, size_t len_in, int behavior) +{ +switch (behavior) { +case 65 : behavior =MADV_MERGEABLE ;break ; +case 66 : behavior =MADV_UNMERGEABLE ;break ; +case 67 : behavior =MADV_HUGEPAGE ;break ; +case 68 : behavior =MADV_NOHUGEPAGE ;break ; +case 69 : behavior =MADV_DONTDUMP ;break ; +case 70 : behavior =MADV_DODUMP ;break ; +case 71 : behavior =MADV_WIPEONFORK ;break ; +case 72 : behavior =MADV_KEEPONFORK ;break ; + } + +return sys_madvise (start, len_in, behavior); +}
arch/parisc/kernel/syscalls/syscall.tbl +1 -1
@@ -131,7 +131,7 @@ 116 common sysinfo sys_sysinfo compat_sys_sysinfo 117 common shutdown sys_shutdown 118 common fsync sys_fsync -119 common madvise sys_madvise +119 common madvise parisc_madvise 120 common clone sys_clone_wrapper 121 common setdomainname sys_setdomainname 122 common sendfile sys_sendfile compat_sys_sendfile
tools/arch/parisc/include/uapi/asm/mman.h +6 -6
@@ -1,20 +1,20 @@/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H #define TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H -#define MADV_DODUMP 70 +#define MADV_DODUMP 17#define MADV_DOFORK 11 -#define MADV_DONTDUMP 69 +#define MADV_DONTDUMP 16#define MADV_DONTFORK 10#define MADV_DONTNEED 4#define MADV_FREE 8 -#define MADV_HUGEPAGE 67 -#define MADV_MERGEABLE 65 -#define MADV_NOHUGEPAGE 68 +#define MADV_HUGEPAGE 14 +#define MADV_MERGEABLE 12 +#define MADV_NOHUGEPAGE 15#define MADV_NORMAL 0#define MADV_RANDOM 1#define MADV_REMOVE 9#define MADV_SEQUENTIAL 2 -#define MADV_UNMERGEABLE 66 +#define MADV_UNMERGEABLE 13#define MADV_WILLNEED 3#define MAP_ANONYMOUS 0x10#define MAP_DENYWRITE 0x0800
tools/perf/bench/bench.h +0 -12
@@ -10,25 +10,13 @@ extern struct timeval bench__start, benc* The madvise transparent hugepage constants were added in glibc * 2.13. For compatibility with older versions of glibc, define these * tokens if they are not already defined. -* -* PA-RISC uses different madvise values from other architectures and -* needs to be special-cased. */ -#ifdef __hppa__ -# ifndef MADV_HUGEPAGE -# define MADV_HUGEPAGE 67 -# endif -# ifndef MADV_NOHUGEPAGE -# define MADV_NOHUGEPAGE 68 -# endif -#else # ifndef MADV_HUGEPAGE # define MADV_HUGEPAGE 14# endif # ifndef MADV_NOHUGEPAGE # define MADV_NOHUGEPAGE 15# endif -#endif int bench_numa (int argc,const char **argv);int bench_sched_messaging (int argc,const char **argv);
Greg Kroah-Hartman
maintainerPATCH 774/783 ext4: disable fast-commit of encrypted dir operations
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 0fbcb5251fc81b58969b272c4fb7374a7b922e3e upstream.
fast-commit of create, link, and unlink operations in encrypted directories is completely broken because the unencrypted filenames are being written to the fast-commit journal instead of the encrypted filenames. These operations can't be replayed, as encryption keys aren't present at journal replay time. It is also an information leak.
Until if/when we can get this working properly, make encrypted directory operations ineligible for fast-commit.
Note that fast-commit operations on encrypted regular files continue to be allowed, as they seem to work.
--- fs/ext4/fast_commit.c | 40 ++++++++++++++++++++++++---------------- fs/ext4/fast_commit.h | 1 + include/trace/events/ext4.h | 7 +++++-- 3 files changed, 30 insertions(+), 18 deletions(-)
fs/ext4/fast_commit.c +24 -16
@@ -371,25 +371,33 @@ static int __track_dentry_update(structstruct __track_dentry_update_args *dentry_update = (struct __track_dentry_update_args *)arg;struct dentry *dentry = dentry_update->dentry; -struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb); +struct inode *dir = dentry->d_parent->d_inode; +struct super_block *sb = inode->i_sb; +struct ext4_sb_info *sbi =EXT4_SB (sb);mutex_unlock (&ei->i_fc_lock); + +if (IS_ENCRYPTED (dir)) { +ext4_fc_mark_ineligible (sb,EXT4_FC_REASON_ENCRYPTED_FILENAME ); +mutex_lock (&ei->i_fc_lock); +return -EOPNOTSUPP ; + } + node =kmem_cache_alloc (ext4_fc_dentry_cachep,GFP_NOFS );if (!node) { -ext4_fc_mark_ineligible (inode->i_sb,EXT4_FC_REASON_NOMEM ); +ext4_fc_mark_ineligible (sb,EXT4_FC_REASON_NOMEM );mutex_lock (&ei->i_fc_lock);return -ENOMEM ; } node->fcd_op = dentry_update->op; - node->fcd_parent = dentry->d_parent->d_inode->i_ino; + node->fcd_parent = dir->i_ino; node->fcd_ino = inode->i_ino;if (dentry->d_name.len >DNAME_INLINE_LEN ) { node->fcd_name.name =kmalloc (dentry->d_name.len,GFP_NOFS );if (!node->fcd_name.name) {kmem_cache_free (ext4_fc_dentry_cachep, node); -ext4_fc_mark_ineligible (inode->i_sb, -EXT4_FC_REASON_NOMEM ); +ext4_fc_mark_ineligible (sb,EXT4_FC_REASON_NOMEM );mutex_lock (&ei->i_fc_lock);return -ENOMEM ; }
@@ -2142,17 +2150,17 @@ void ext4_fc_init(struct super_block *sb journal->j_fc_cleanup_callback = ext4_fc_cleanup; } -static const char *fc_ineligible_reasons[] = { -"Extended attributes changed" , -"Cross rename" , -"Journal flag changed" , -"Insufficient memory" , -"Swap boot" , -"Resize" , -"Dir renamed" , -"Falloc range op" , -"Data journalling" , -"FC Commit Failed" +static const char *const fc_ineligible_reasons[] = { + [EXT4_FC_REASON_XATTR ] ="Extended attributes changed" , + [EXT4_FC_REASON_CROSS_RENAME ] ="Cross rename" , + [EXT4_FC_REASON_JOURNAL_FLAG_CHANGE ] ="Journal flag changed" , + [EXT4_FC_REASON_NOMEM ] ="Insufficient memory" , + [EXT4_FC_REASON_SWAP_BOOT ] ="Swap boot" , + [EXT4_FC_REASON_RESIZE ] ="Resize" , + [EXT4_FC_REASON_RENAME_DIR ] ="Dir renamed" , + [EXT4_FC_REASON_FALLOC_RANGE ] ="Falloc range op" , + [EXT4_FC_REASON_INODE_JOURNAL_DATA ] ="Data journalling" , + [EXT4_FC_REASON_ENCRYPTED_FILENAME ] ="Encrypted filename" , };int ext4_fc_info_show (struct seq_file *seq,void *v)
fs/ext4/fast_commit.h +1 -0
@@ -104,6 +104,7 @@ enum {EXT4_FC_REASON_FALLOC_RANGE ,EXT4_FC_REASON_INODE_JOURNAL_DATA ,EXT4_FC_COMMIT_FAILED , +EXT4_FC_REASON_ENCRYPTED_FILENAME , EXT4_FC_REASON_MAX };
include/trace/events/ext4.h +5 -2
@@ -104,6 +104,7 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_RESIZE)TRACE_DEFINE_ENUM (EXT4_FC_REASON_RENAME_DIR );TRACE_DEFINE_ENUM (EXT4_FC_REASON_FALLOC_RANGE );TRACE_DEFINE_ENUM (EXT4_FC_REASON_INODE_JOURNAL_DATA ); +TRACE_DEFINE_ENUM (EXT4_FC_REASON_ENCRYPTED_FILENAME );TRACE_DEFINE_ENUM (EXT4_FC_REASON_MAX );#define show_fc_reason (reason) \
@@ -116,7 +117,8 @@ TRACE_DEFINE_ENUM(EXT4_FC_REASON_MAX); { EXT4_FC_REASON_RESIZE, "RESIZE"}, \ { EXT4_FC_REASON_RENAME_DIR, "RENAME_DIR"}, \ { EXT4_FC_REASON_FALLOC_RANGE, "FALLOC_RANGE"}, \ - { EXT4_FC_REASON_INODE_JOURNAL_DATA, "INODE_JOURNAL_DATA"}) + { EXT4_FC_REASON_INODE_JOURNAL_DATA, "INODE_JOURNAL_DATA"}, \ + { EXT4_FC_REASON_ENCRYPTED_FILENAME, "ENCRYPTED_FILENAME"}) TRACE_EVENT(ext4_other_inode_update_time, TP_PROTO(struct inode *inode, ino_t orig_ino),
@@ -2940,7 +2942,7 @@ TRACE_EVENT(ext4_fc_stats, ), TP_printk("dev %d,%d fc ineligible reasons:\n" - "%s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u " + "%s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u, %s:%u" "num_commits:%lu, ineligible: %lu, numblks: %lu", MAJOR(__entry->dev), MINOR(__entry->dev), FC_REASON_NAME_STAT(EXT4_FC_REASON_XATTR),
@@ -2952,6 +2954,7 @@ TRACE_EVENT(ext4_fc_stats,FC_REASON_NAME_STAT (EXT4_FC_REASON_RENAME_DIR ),FC_REASON_NAME_STAT (EXT4_FC_REASON_FALLOC_RANGE ),FC_REASON_NAME_STAT (EXT4_FC_REASON_INODE_JOURNAL_DATA ), +FC_REASON_NAME_STAT (EXT4_FC_REASON_ENCRYPTED_FILENAME ), __entry->fc_commits, __entry->fc_ineligible_commits, __entry->fc_numblks) );
Greg Kroah-Hartman
maintainerPATCH 775/783 ext4: dont set up encryption key during jbd2 transaction
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 4c0d5778385cb3618ff26a561ce41de2b7d9de70 upstream.
Commit a80f7fcf1867 ("ext4: fixup ext4_fc_track_* functions' signature") extended the scope of the transaction in ext4_unlink() too far, making it include the call to ext4_find_entry(). However, ext4_find_entry() can deadlock when called from within a transaction because it may need to set up the directory's encryption key.
Fix this by restoring the transaction to its original scope.
--- fs/ext4/ext4.h | 4 ++-- fs/ext4/fast_commit.c | 2 +- fs/ext4/namei.c | 44 ++++++++++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 23 deletions(-)
fs/ext4/ext4.h +2 -2
@@ -3486,8 +3486,8 @@ extern int ext4_handle_dirty_dirblock(haextern int ext4_ci_compare (const struct inode *parent,const struct qstr *fname,const struct qstr *entry,bool quick); -extern int __ext4_unlink (handle_t *handle,struct inode *dir,const struct qstr *d_name, -struct inode *inode); +extern int __ext4_unlink (struct inode *dir,const struct qstr *d_name, +struct inode *inode,struct dentry *dentry);extern int __ext4_link (struct inode *dir,struct inode *inode,struct dentry *dentry);
fs/ext4/fast_commit.c +1 -1
@@ -1300,7 +1300,7 @@ static int ext4_fc_replay_unlink(structreturn 0 ; } - ret =__ext4_unlink (NULL , old_parent, &entry, inode); + ret =__ext4_unlink (old_parent, &entry, inode,NULL );/* -ENOENT ok coz it might not exist anymore. */ if (ret == -ENOENT ) ret =0 ;
fs/ext4/namei.c +24 -20
96 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 776/783 fsl_lpuart: Dont enable interrupts too early
In reply to Greg Kroah-HartmanFrom: Indan Zupancic <[email protected]>
commit 401fb66a355eb0f22096cf26864324f8e63c7d78 upstream.
If an irq is pending when devm_request_irq() is called, the irq handler will cause a NULL pointer access because initialisation is not done yet.
[5.10 did not have lpuart_global_reset or anything after uart_add_one_port(), so add the remove call in cleanup manually]
--- drivers/tty/serial/fsl_lpuart.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/tty/serial/fsl_lpuart.c +10 -8
@@ -2586,6 +2586,7 @@ static int lpuart_probe(struct platform_struct device_node *np = pdev->dev.of_node;struct lpuart_port *sport;struct resource *res; +irq_handler_t handler;int ret; sport =devm_kzalloc (&pdev->dev,sizeof (*sport),GFP_KERNEL );
@@ -2658,17 +2659,12 @@ static int lpuart_probe(struct platform_if (lpuart_is_32 (sport)) { lpuart_reg.cons =LPUART32_CONSOLE ; - ret =devm_request_irq (&pdev->dev, sport->port.irq, lpuart32_int,0 , -DRIVER_NAME , sport); + handler = lpuart32_int; }else { lpuart_reg.cons =LPUART_CONSOLE ; - ret =devm_request_irq (&pdev->dev, sport->port.irq, lpuart_int,0 , -DRIVER_NAME , sport); + handler = lpuart_int; } -if (ret) - goto failed_irq_request; - ret =uart_get_rs485_mode (&sport->port);if (ret) goto failed_get_rs485;
@@ -2684,11 +2680,17 @@ static int lpuart_probe(struct platform_if (ret) goto failed_attach_port; + ret =devm_request_irq (&pdev->dev, sport->port.irq, handler,0 , +DRIVER_NAME , sport); +if (ret) + goto failed_irq_request; +return 0 ; +failed_irq_request: +uart_remove_one_port (&lpuart_reg, &sport->port); failed_get_rs485: failed_attach_port: -failed_irq_request:lpuart_disable_clks (sport);return ret; }
Greg Kroah-Hartman
maintainerPATCH 777/783 serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
In reply to Greg Kroah-HartmanFrom: Rasmus Villemoes <[email protected]>
When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in driver-specific way") got backported to 5.10.y, there known as 26a2b9c468de, some hunks were accidentally left out.
In serial_core.c, it is possible that the omission in uart_suspend_port() is harmless, but the backport did have the corresponding hunk in uart_resume_port(), it runs counter to the original commit's intention of
Skip any invocation of ->set_mctrl() if RS485 is enabled.
and it's certainly better to be aligned with upstream.
[the fsl_lpuart part of the 5.15 patch is not required on 5.10, because the code before 26a2b9c468de was incorrectly not calling uart_remove_one_port on failed_get_rs485]
--- drivers/tty/serial/serial_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/serial_core.c +2 -1
@@ -2254,7 +2254,8 @@ int uart_suspend_port(struct uart_driverspin_lock_irq (&uport->lock); ops->stop_tx (uport); - ops->set_mctrl (uport,0 ); +if (!(uport->rs485.flags &SER_RS485_ENABLED )) + ops->set_mctrl (uport,0 ); ops->stop_rx (uport);spin_unlock_irq (&uport->lock);
Greg Kroah-Hartman
maintainerPATCH 778/783 mptcp: mark ops structures as ro_after_init
In reply to Greg Kroah-HartmanFrom: Mat Martineau <[email protected]>
From: Florian Westphal <[email protected]>
commit 51fa7f8ebf0e25c7a9039fa3988a623d5f3855aa upstream.
These structures are initialised from the init hooks, so we can't make them 'const'. But no writes occur afterwards, so we can use ro_after_init.
Also, remove bogus EXPORT_SYMBOL, the only access comes from ip stack, not from kernel modules.
--- net/mptcp/subflow.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
net/mptcp/subflow.c +7 -8
@@ -360,8 +360,7 @@ do_reset: }struct request_sock_ops mptcp_subflow_request_sock_ops; -EXPORT_SYMBOL_GPL (mptcp_subflow_request_sock_ops); -static struct tcp_request_sock_ops subflow_request_sock_ipv4_ops; +static struct tcp_request_sock_ops subflow_request_sock_ipv4_ops__ro_after_init ;static int subflow_v4_conn_request (struct sock *sk,struct sk_buff *skb) {
@@ -382,9 +381,9 @@ drop: }#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) -static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops; -static struct inet_connection_sock_af_ops subflow_v6_specific; -static struct inet_connection_sock_af_ops subflow_v6m_specific; +static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops__ro_after_init ; +static struct inet_connection_sock_af_ops subflow_v6_specific__ro_after_init ; +static struct inet_connection_sock_af_ops subflow_v6m_specific__ro_after_init ;static int subflow_v6_conn_request (struct sock *sk,struct sk_buff *skb) {
@@ -636,7 +635,7 @@ dispose_child:return child; } -static struct inet_connection_sock_af_ops subflow_specific; +static struct inet_connection_sock_af_ops subflow_specific__ro_after_init ;enum mapping_status {MAPPING_OK ,
@@ -1017,7 +1016,7 @@ static void subflow_write_space(struct s } } -static struct inet_connection_sock_af_ops * +static const struct inet_connection_sock_af_ops *subflow_default_af_ops (struct sock *sk) {#if IS_ENABLED (CONFIG_MPTCP_IPV6 )
@@ -1032,7 +1031,7 @@ void mptcpv6_handle_mapped(struct sock * {struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (sk);struct inet_connection_sock *icsk =inet_csk (sk); -struct inet_connection_sock_af_ops *target; +const struct inet_connection_sock_af_ops *target; target = mapped ? &subflow_v6m_specific :subflow_default_af_ops (sk);
Greg Kroah-Hartman
maintainerPATCH 779/783 mptcp: remove MPTCP ifdef in TCP SYN cookies
In reply to Greg Kroah-HartmanFrom: Mat Martineau <[email protected]>
From: Matthieu Baerts <[email protected]>
commit 3fff88186f047627bb128d65155f42517f8e448f upstream.
To ease the maintenance, it is often recommended to avoid having #ifdef preprocessor conditions.
Here the section related to CONFIG_MPTCP was quite short but the next commit needs to add more code around. It is then cleaner to move specific MPTCP code to functions located in net/mptcp directory.
Now that mptcp_subflow_request_sock_ops structure can be static, it can also be marked as "read only after init".
--- include/net/mptcp.h | 12 ++++++++++-- net/ipv4/syncookies.c | 7 +++---- net/mptcp/subflow.c | 12 +++++++++++- 3 files changed, 24 insertions(+), 7 deletions(-)
include/net/mptcp.h +10 -2
@@ -58,8 +58,6 @@ struct mptcp_out_options { };#ifdef CONFIG_MPTCP -extern struct request_sock_ops mptcp_subflow_request_sock_ops; -void mptcp_init (void );static inline bool sk_is_mptcp (const struct sock *sk)
@@ -133,6 +131,9 @@ void mptcp_seq_show(struct seq_file *seqint mptcp_subflow_init_cookie_req (struct request_sock *req,const struct sock *sk_listener,struct sk_buff *skb); +struct request_sock *mptcp_subflow_reqsk_alloc (const struct request_sock_ops *ops, +struct sock *sk_listener, +bool attach_listener);#else static inline void mptcp_init (void )
@@ -208,6 +209,13 @@ static inline int mptcp_subflow_init_coo {return 0 ;/* TCP fallback */ } + +static inline struct request_sock *mptcp_subflow_reqsk_alloc (const struct request_sock_ops *ops, +struct sock *sk_listener, +bool attach_listener) +{ +return NULL ; +}#endif /* CONFIG_MPTCP */ #if IS_ENABLED (CONFIG_MPTCP_IPV6 )
net/ipv4/syncookies.c +3 -4
@@ -290,12 +290,11 @@ struct request_sock *cookie_tcp_reqsk_alstruct tcp_request_sock *treq;struct request_sock *req; -#ifdef CONFIG_MPTCP if (sk_is_mptcp (sk)) - ops = &mptcp_subflow_request_sock_ops; -#endif + req =mptcp_subflow_reqsk_alloc (ops, sk, false); +else + req =inet_reqsk_alloc (ops, sk, false); - req =inet_reqsk_alloc (ops, sk, false);if (!req)return NULL ;
net/mptcp/subflow.c +11 -1
@@ -359,7 +359,7 @@ do_reset:mptcp_subflow_reset (sk); } -struct request_sock_ops mptcp_subflow_request_sock_ops; +static struct request_sock_ops mptcp_subflow_request_sock_ops__ro_after_init ;static struct tcp_request_sock_ops subflow_request_sock_ipv4_ops__ro_after_init ;static int subflow_v4_conn_request (struct sock *sk,struct sk_buff *skb)
@@ -411,6 +411,16 @@ drop: }#endif +struct request_sock *mptcp_subflow_reqsk_alloc (const struct request_sock_ops *ops, +struct sock *sk_listener, +bool attach_listener) +{ + ops = &mptcp_subflow_request_sock_ops; + +return inet_reqsk_alloc (ops, sk_listener, attach_listener); +} +EXPORT_SYMBOL (mptcp_subflow_reqsk_alloc); +/* validate hmac received in third ACK */ static bool subflow_hmac_valid (const struct request_sock *req,const struct mptcp_options_received *mp_opt)
Greg Kroah-Hartman
maintainerPATCH 780/783 mptcp: dedicated request sock for subflow in v6
In reply to Greg Kroah-HartmanFrom: Mat Martineau <[email protected]>
From: Matthieu Baerts <[email protected]>
commit 34b21d1ddc8ace77a8fa35c1b1e06377209e0dae upstream.
tcp_request_sock_ops structure is specific to IPv4. It should then not be used with MPTCP subflows on top of IPv6.
For example, it contains the 'family' field, initialised to AF_INET. This 'family' field is used by TCP FastOpen code to generate the cookie but also by TCP Metrics, SELinux and SYN Cookies. Using the wrong family will not lead to crashes but displaying/using/checking wrong things.
Note that 'send_reset' callback from request_sock_ops structure is used in some error paths. It is then also important to use the correct one for IPv4 or IPv6.
The slab name can also be different in IPv4 and IPv6, it will be used when printing some log messages. The slab pointer will anyway be the same because the object size is the same for both v4 and v6. A BUILD_BUG_ON() has also been added to make sure this size is the same.
--- net/mptcp/subflow.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-)
net/mptcp/subflow.c +26 -8
@@ -359,7 +359,7 @@ do_reset:mptcp_subflow_reset (sk); } -static struct request_sock_ops mptcp_subflow_request_sock_ops__ro_after_init ; +static struct request_sock_ops mptcp_subflow_v4_request_sock_ops__ro_after_init ;static struct tcp_request_sock_ops subflow_request_sock_ipv4_ops__ro_after_init ;static int subflow_v4_conn_request (struct sock *sk,struct sk_buff *skb)
@@ -372,7 +372,7 @@ static int subflow_v4_conn_request(strucif (skb_rtable (skb)->rt_flags & (RTCF_BROADCAST |RTCF_MULTICAST )) goto drop; -return tcp_conn_request (&mptcp_subflow_request_sock_ops, +return tcp_conn_request (&mptcp_subflow_v4_request_sock_ops, &subflow_request_sock_ipv4_ops, sk, skb); drop:
@@ -381,6 +381,7 @@ drop: }#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) +static struct request_sock_ops mptcp_subflow_v6_request_sock_ops__ro_after_init ;static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops__ro_after_init ;static struct inet_connection_sock_af_ops subflow_v6_specific__ro_after_init ;static struct inet_connection_sock_af_ops subflow_v6m_specific__ro_after_init ;
@@ -402,7 +403,7 @@ static int subflow_v6_conn_request(strucreturn 0 ; } -return tcp_conn_request (&mptcp_subflow_request_sock_ops, +return tcp_conn_request (&mptcp_subflow_v6_request_sock_ops, &subflow_request_sock_ipv6_ops, sk, skb); drop:
@@ -415,7 +416,12 @@ struct request_sock *mptcp_subflow_reqsk struct sock *sk_listener, bool attach_listener) { - ops = &mptcp_subflow_request_sock_ops; +if (ops->family ==AF_INET ) + ops = &mptcp_subflow_v4_request_sock_ops; +#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) + else if (ops->family == AF_INET6) + ops = &mptcp_subflow_v6_request_sock_ops; +#endif return inet_reqsk_alloc (ops, sk_listener, attach_listener); }
@@ -1386,7 +1392,6 @@ static struct tcp_ulp_ops subflow_ulp_opstatic int subflow_ops_init (struct request_sock_ops *subflow_ops) { subflow_ops->obj_size =sizeof (struct mptcp_subflow_request_sock ); - subflow_ops->slab_name ="request_sock_subflow" ; subflow_ops->slab = kmem_cache_create(subflow_ops->slab_name, subflow_ops->obj_size, 0,
@@ -1403,9 +1408,10 @@ static int subflow_ops_init(struct requevoid __init mptcp_subflow_init (void ) { - mptcp_subflow_request_sock_ops = tcp_request_sock_ops; -if (subflow_ops_init (&mptcp_subflow_request_sock_ops) !=0 ) -panic ("MPTCP: failed to init subflow request sock ops\n" ); + mptcp_subflow_v4_request_sock_ops = tcp_request_sock_ops; + mptcp_subflow_v4_request_sock_ops.slab_name ="request_sock_subflow_v4" ; +if (subflow_ops_init (&mptcp_subflow_v4_request_sock_ops) !=0 ) +panic ("MPTCP: failed to init subflow v4 request sock ops\n" ); subflow_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops; subflow_request_sock_ipv4_ops.init_req = subflow_v4_init_req;
@@ -1416,6 +1422,18 @@ void __init mptcp_subflow_init(void) subflow_specific.sk_rx_dst_set = subflow_finish_connect;#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) +/* In struct mptcp_subflow_request_sock, we assume the TCP request sock +* structures for v4 and v6 have the same size. It should not changed in +* the future but better to make sure to be warned if it is no longer +* the case. +*/ +BUILD_BUG_ON (sizeof (struct tcp_request_sock ) !=sizeof (struct tcp6_request_sock )); + + mptcp_subflow_v6_request_sock_ops = tcp6_request_sock_ops; + mptcp_subflow_v6_request_sock_ops.slab_name ="request_sock_subflow_v6" ; +if (subflow_ops_init (&mptcp_subflow_v6_request_sock_ops) !=0 ) +panic ("MPTCP: failed to init subflow v6 request sock ops\n" ); + subflow_request_sock_ipv6_ops = tcp_request_sock_ipv6_ops; subflow_request_sock_ipv6_ops.init_req = subflow_v6_init_req;
Greg Kroah-Hartman
maintainerPATCH 781/783 mptcp: use proper req destructor for IPv6
In reply to Greg Kroah-HartmanFrom: Mat Martineau <[email protected]>
From: Matthieu Baerts <[email protected]>
commit d3295fee3c756ece33ac0d935e172e68c0a4161b upstream.
Before, only the destructor from TCP request sock in IPv4 was called even if the subflow was IPv6.
It is important to use the right destructor to avoid memory leaks with some advanced IPv6 features, e.g. when the request socks contain specific IPv6 options.
--- net/mptcp/subflow.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
net/mptcp/subflow.c +16 -3
@@ -40,7 +40,6 @@ static void subflow_req_destructor(strucsock_put ((struct sock *)subflow_req->msk);mptcp_token_destroy_request (req); - tcp_request_sock_ops.destructor (req); } static void subflow_generate_hmac(u64 key1, u64 key2, u32 nonce1, u32 nonce2,
@@ -380,6 +379,12 @@ drop:return 0 ; } +static void subflow_v4_req_destructor (struct request_sock *req) +{ +subflow_req_destructor (req); + tcp_request_sock_ops.destructor (req); +} +#if IS_ENABLED (CONFIG_MPTCP_IPV6 )static struct request_sock_ops mptcp_subflow_v6_request_sock_ops__ro_after_init ;static struct tcp_request_sock_ops subflow_request_sock_ipv6_ops__ro_after_init ;
@@ -410,6 +415,12 @@ drop:tcp_listendrop (sk);return 0 ;/* don't send reset */ } + +static void subflow_v6_req_destructor (struct request_sock *req) +{ +subflow_req_destructor (req); + tcp6_request_sock_ops.destructor (req); +}#endif struct request_sock *mptcp_subflow_reqsk_alloc(const struct request_sock_ops *ops,
@@ -1401,8 +1412,6 @@ static int subflow_ops_init(struct requeif (!subflow_ops->slab)return -ENOMEM ; - subflow_ops->destructor = subflow_req_destructor; -return 0 ; }
@@ -1410,6 +1419,8 @@ void __init mptcp_subflow_init(void) { mptcp_subflow_v4_request_sock_ops = tcp_request_sock_ops; mptcp_subflow_v4_request_sock_ops.slab_name ="request_sock_subflow_v4" ; + mptcp_subflow_v4_request_sock_ops.destructor = subflow_v4_req_destructor; +if (subflow_ops_init (&mptcp_subflow_v4_request_sock_ops) !=0 )panic ("MPTCP: failed to init subflow v4 request sock ops\n" );
@@ -1431,6 +1442,8 @@ void __init mptcp_subflow_init(void) mptcp_subflow_v6_request_sock_ops = tcp6_request_sock_ops; mptcp_subflow_v6_request_sock_ops.slab_name ="request_sock_subflow_v6" ; + mptcp_subflow_v6_request_sock_ops.destructor = subflow_v6_req_destructor; +if (subflow_ops_init (&mptcp_subflow_v6_request_sock_ops) !=0 )panic ("MPTCP: failed to init subflow v6 request sock ops\n" );
Greg Kroah-Hartman
maintainerPATCH 782/783 net: sched: disallow noqueue for qdisc classes
In reply to Greg Kroah-HartmanFrom: Frederick Lawler <[email protected]>
commit 96398560f26aa07e8f2969d73c8197e6a6d10407 upstream.
While experimenting with applying noqueue to a classful queue discipline, we discovered a NULL pointer dereference in the __dev_queue_xmit() path that generates a kernel OOPS:
# dev=enp0s5
# tc qdisc replace dev $dev root handle 1: htb default 1 # tc class add dev $dev parent 1: classid 1:1 htb rate 10mbit # tc qdisc add dev $dev parent 1:1 handle 10: noqueue # ping -I $dev -w 1 -c 1 1.1.1.1
[ 2.172856] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 2.173217] #PF: supervisor instruction fetch in kernel mode ... [ 2.178451] Call Trace: [ 2.178577] <TASK> [ 2.178686] htb_enqueue+0x1c8/0x370 [ 2.178880] dev_qdisc_enqueue+0x15/0x90 [ 2.179093] __dev_queue_xmit+0x798/0xd00 [ 2.179305] ? _raw_write_lock_bh+0xe/0x30 [ 2.179522] ? __local_bh_enable_ip+0x32/0x70 [ 2.179759] ? ___neigh_create+0x610/0x840 [ 2.179968] ? eth_header+0x21/0xc0 [ 2.180144] ip_finish_output2+0x15e/0x4f0 [ 2.180348] ? dst_output+0x30/0x30 [ 2.180525] ip_push_pending_frames+0x9d/0xb0 [ 2.180739] raw_sendmsg+0x601/0xcb0 [ 2.180916] ? _raw_spin_trylock+0xe/0x50 [ 2.181112] ? _raw_spin_unlock_irqrestore+0x16/0x30 [ 2.181354] ? get_page_from_freelist+0xcd6/0xdf0 [ 2.181594] ? sock_sendmsg+0x56/0x60 [ 2.181781] sock_sendmsg+0x56/0x60 [ 2.181958] __sys_sendto+0xf7/0x160 [ 2.182139] ? handle_mm_fault+0x6e/0x1d0 [ 2.182366] ? do_user_addr_fault+0x1e1/0x660 [ 2.182627] __x64_sys_sendto+0x1b/0x30 [ 2.182881] do_syscall_64+0x38/0x90 [ 2.183085] entry_SYSCALL_64_after_hwframe+0x63/0xcd ... [ 2.187402] </TASK>
Previously in commit d66d6c3152e8 ("net: sched: register noqueue qdisc"), NULL was set for the noqueue discipline on noqueue init so that __dev_queue_xmit() falls through for the noqueue case. This also sets a bypass of the enqueue NULL check in the register_qdisc() function for the struct noqueue_disc_ops.
Classful queue disciplines make it past the NULL check in __dev_queue_xmit() because the discipline is set to htb (in this case), and then in the call to __dev_xmit_skb(), it calls into htb_enqueue() which grabs a leaf node for a class and then calls qdisc_enqueue() by passing in a queue discipline which assumes ->enqueue() is not set to NULL.
Fix this by not allowing classes to be assigned to the noqueue discipline. Linux TC Notes states that classes cannot be set to the noqueue discipline. [1] Let's enforce that here.
Links:
1. https://linux-tc-notes.sourceforge.net/tc/doc/sch_noqueue.txt
--- net/sched/sch_api.c | 5 +++++ 1 file changed, 5 insertions(+)
net/sched/sch_api.c +5 -0
@@ -1114,6 +1114,11 @@ skip:return -ENOENT ; } +if (new && new->ops == &noqueue_qdisc_ops) { +NL_SET_ERR_MSG (extack,"Cannot assign noqueue to a class" ); +return -EINVAL ; + } + err = cops->graft (parent, cl, new, &old, extack);if (err)return err;
Greg Kroah-Hartman
maintainerPATCH 783/783 net/ulp: prevent ULP without clone op from entering the LISTEN status
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
commit 2c02d41d71f90a5168391b6a5f2954112ba2307c upstream.
When an ULP-enabled socket enters the LISTEN status, the listener ULP data pointer is copied inside the child/accepted sockets by sk_clone_lock().
The relevant ULP can take care of de-duplicating the context pointer via the clone() operation, but only MPTCP and SMC implement such op.
Other ULPs may end-up with a double-free at socket disposal time.
We can't simply clear the ULP data at clone time, as TLS replaces the socket ops with custom ones assuming a valid TLS ULP context is available.
Instead completely prevent clone-less ULP sockets from entering the LISTEN status.
--- net/ipv4/inet_connection_sock.c | 16 +++++++++++++++- net/ipv4/tcp_ulp.c | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-)
net/ipv4/inet_connection_sock.c +15 -1
@@ -916,11 +916,25 @@ void inet_csk_prepare_forced_close(struc }EXPORT_SYMBOL (inet_csk_prepare_forced_close); +static int inet_ulp_can_listen (const struct sock *sk) +{ +const struct inet_connection_sock *icsk =inet_csk (sk); + +if (icsk->icsk_ulp_ops && !icsk->icsk_ulp_ops->clone) +return -EINVAL ; + +return 0 ; +} +int inet_csk_listen_start (struct sock *sk,int backlog) {struct inet_connection_sock *icsk =inet_csk (sk);struct inet_sock *inet =inet_sk (sk); -int err = -EADDRINUSE ; +int err; + + err =inet_ulp_can_listen (sk); +if (unlikely (err)) +return err;reqsk_queue_alloc (&icsk->icsk_accept_queue);
net/ipv4/tcp_ulp.c +4 -0
@@ -136,6 +136,10 @@ static int __tcp_set_ulp(struct sock *skif (icsk->icsk_ulp_ops) goto out_err; + err = -EINVAL ; +if (!ulp_ops->clone && sk->sk_state ==TCP_LISTEN ) + goto out_err; + err = ulp_ops->init (sk);if (err) goto out_err;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
Build results:
total: 162 pass: 162 fail: 0 Qemu test results: total: 475 pass: 475 fail: 0
Guenter
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
Tested on arm64 and x86 for 5.10.163-rc1,
Kernel repo:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Branch: linux-5.10.y
Version: 5.10.163-rc1
Commit: d33d55703c7895c3dd8793cbad6046db91df21db
Compiler: gcc version 7.3.0 (GCC)
arm64:
--------------------------------------------------------------------
Testcase Result Summary:
total: 9023
passed: 9023
failed: 0
timeout: 0
--------------------------------------------------------------------
x86:
--------------------------------------------------------------------
Testcase Result Summary:
total: 9023
passed: 9023
failed: 0
timeout: 0
--------------------------------------------------------------------
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
Build test (gcc version 11.3.1 20221127):
mips: 63 configs -> no failure
arm: 104 configs -> no failure
arm64: 3 configs -> no failurex86_64: 4 configs -> no failure alpha allmodconfig -> no failure powerpc allmodconfig -> no failure riscv allmodconfig -> no failure s390 allmodconfig -> no failure xtensa allmodconfig -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
[1]. https://openqa.qa.codethink.co.uk/tests/2628
[2]. https://openqa.qa.codethink.co.uk/tests/2633
Signature · 2 lines
Regards Sudip
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.10:
11 builds: 11 pass, 0 fail
28 boots: 28 pass, 0 fail
75 tests: 75 pass, 0 failLinux version: 5.10.163-rc1-gd33d55703c78
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.10.163-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.10.y
* git commit: d33d55703c7895c3dd8793cbad6046db91df21db
* git describe: v5.10.162-784-gd33d55703c78
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.162-784-gd33d55703c78
## Test Regressions (compared to v5.10.162)
## Metric Regressions (compared to v5.10.162)
## Test Fixes (compared to v5.10.162)
## Metric Fixes (compared to v5.10.162)
## Test result summary
total: 157841, pass: 132606, fail: 3922, skip: 20968, xfail: 345
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 151 total, 150 passed, 1 failed
* arm64: 49 total, 46 passed, 3 failed
* i386: 39 total, 37 passed, 2 failed
* mips: 31 total, 29 passed, 2 failed
* parisc: 8 total, 8 passed, 0 failed
* powerpc: 32 total, 25 passed, 7 failed
* riscv: 16 total, 14 passed, 2 failed
* s390: 16 total, 16 passed, 0 failed
* sh: 14 total, 12 passed, 2 failed
* sparc: 8 total, 8 passed, 0 failed
* x86_64: 42 total, 40 passed, 2 failed
## Test suites summary
* boot
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-open-posix-tests
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* packetdrill
* perf
* rcutorture
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my x86_64 and ARM64 test systems. No errors or regressions.
Thanks.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 16 lines · Ron Economos
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.163 release. There are 783 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 14 Jan 2023 13:53:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y and the diffstat can be found below.
Quoted 8 lines
Quoted 3 lines
thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Tested-by Ron Economos <[email protected]>
Oops, replied to the wrong e-mail. Please ignore.