5.14.10-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 158/172 ext4: flush s_error_work before journal destroy in ext4_fill_super
In reply to Greg Kroah-HartmanFrom: yangerkun <[email protected]>
commit bb9464e08309f6befe80866f5be51778ca355ee9 upstream.
The error path in ext4_fill_super forget to flush s_error_work before journal destroy, and it may trigger the follow bug since flush_stashed_error_work can run concurrently with journal destroy without any protection for sbi->s_journal.
[32031.740193] EXT4-fs (loop66): get root inode failed [32031.740484] EXT4-fs (loop66): mount failed [32031.759805] ------------[ cut here ]------------ [32031.759807] kernel BUG at fs/jbd2/transaction.c:373! [32031.760075] invalid opcode: 0000 [#1] SMP PTI [32031.760336] CPU: 5 PID: 1029268 Comm: kworker/5:1 Kdump: loaded 4.18.0 [32031.765112] Call Trace: [32031.765375] ? __switch_to_asm+0x35/0x70 [32031.765635] ? __switch_to_asm+0x41/0x70 [32031.765893] ? __switch_to_asm+0x35/0x70 [32031.766148] ? __switch_to_asm+0x41/0x70 [32031.766405] ? _cond_resched+0x15/0x40 [32031.766665] jbd2__journal_start+0xf1/0x1f0 [jbd2] [32031.766934] jbd2_journal_start+0x19/0x20 [jbd2] [32031.767218] flush_stashed_error_work+0x30/0x90 [ext4] [32031.767487] process_one_work+0x195/0x390 [32031.767747] worker_thread+0x30/0x390 [32031.768007] ? process_one_work+0x390/0x390 [32031.768265] kthread+0x10d/0x130 [32031.768521] ? kthread_flush_work_fn+0x10/0x10 [32031.768778] ret_from_fork+0x35/0x40
static int start_this_handle(...)
BUG_ON(journal->j_flags & JBD2_UNMOUNT); <---- Trigger this
Besides, after we enable fast commit, ext4_fc_replay can add work to s_error_work but return success, so the latter journal destroy in ext4_load_journal can trigger this problem too.
Fix this problem with two steps:
1. Call ext4_commit_super directly in ext4_handle_error for the case that called from ext4_fc_replay
2. Since it's hard to pair the init and flush for s_error_work, we'd better add a extras flush_work before journal destroy in ext4_fill_super
Besides, this patch will call ext4_commit_super in ext4_handle_error for any nojournal case too. But it seems safe since the reason we call schedule_work was that we should save error info to sb through journal if available. Conversely, for the nojournal case, it seems useless delay commit superblock to s_error_work.
--- fs/ext4/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ext4/super.c +4 -1
@@ -661,7 +661,7 @@ static void ext4_handle_error(struct sup* constraints, it may not be safe to do it right here so we * defer superblock flushing to a workqueue. */ -if (continue_fs) +if (continue_fs && journal)schedule_work (&EXT4_SB (sb)->s_error_work);else ext4_commit_super (sb);
@@ -5189,12 +5189,15 @@ failed_mount_wq: sbi->s_ea_block_cache =NULL ;if (sbi->s_journal) { +/* flush s_error_work before journal destroy. */ +flush_work (&sbi->s_error_work);jbd2_journal_destroy (sbi->s_journal); sbi->s_journal =NULL ; } failed_mount3a:ext4_es_unregister_shrinker (sbi); failed_mount3: +/* flush s_error_work before sbi destroy */ flush_work (&sbi->s_error_work);del_timer_sync (&sbi->s_err_report);ext4_stop_mmpd (sbi);
Greg Kroah-Hartman
maintainerPATCH 132/172 net: phy: bcm7xxx: Fixed indirect MMD operations
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit d88fd1b546ff19c8040cfaea76bf16aed1c5a0bb ]
When EEE support was added to the 28nm EPHY it was assumed that it would be able to support the standard clause 45 over clause 22 register access method. It turns out that the PHY does not support that, which is the very reason for using the indirect shadow mode 2 bank 3 access method.
Implement {read,write}_mmd to allow the standard PHY library routines pertaining to EEE querying and configuration to work correctly on these PHYs. This forces us to implement a __phy_set_clr_bits() function that does not grab the MDIO bus lock since the PHY driver's {read,write}_mmd functions are always called with that lock held.
--- drivers/net/phy/bcm7xxx.c | 114 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 4 deletions(-)
drivers/net/phy/bcm7xxx.c +110 -4
@@ -27,7 +27,12 @@#define MII_BCM7XXX_SHD_2_ADDR_CTRL 0xe#define MII_BCM7XXX_SHD_2_CTRL_STAT 0xf#define MII_BCM7XXX_SHD_2_BIAS_TRIM 0x1a +#define MII_BCM7XXX_SHD_3_PCS_CTRL 0x0 +#define MII_BCM7XXX_SHD_3_PCS_STATUS 0x1 +#define MII_BCM7XXX_SHD_3_EEE_CAP 0x2#define MII_BCM7XXX_SHD_3_AN_EEE_ADV 0x3 +#define MII_BCM7XXX_SHD_3_EEE_LP 0x4 +#define MII_BCM7XXX_SHD_3_EEE_WK_ERR 0x5#define MII_BCM7XXX_SHD_3_PCS_CTRL_2 0x6#define MII_BCM7XXX_PCS_CTRL_2_DEF 0x4400#define MII_BCM7XXX_SHD_3_AN_STAT 0xb
@@ -216,25 +221,37 @@ static int bcm7xxx_28nm_resume(struct phy_device *phydev)return genphy_config_aneg (phydev); } -static int phy_set_clr_bits (struct phy_device *dev,int location, -int set_mask,int clr_mask) +static int __phy_set_clr_bits (struct phy_device *dev,int location, +int set_mask,int clr_mask) {int v, ret; - v =phy_read (dev, location); + v =__phy_read (dev, location);if (v <0 )return v; v &= ~clr_mask; v |= set_mask; - ret =phy_write (dev, location, v); + ret =__phy_write (dev, location, v);if (ret <0 )return ret;return v; } +static int phy_set_clr_bits (struct phy_device *dev,int location, +int set_mask,int clr_mask) +{ +int ret; + +mutex_lock (&dev->mdio.bus->mdio_lock); + ret =__phy_set_clr_bits (dev, location, set_mask, clr_mask); +mutex_unlock (&dev->mdio.bus->mdio_lock); + +return ret; +} +static int bcm7xxx_28nm_ephy_01_afe_config_init (struct phy_device *phydev) {int ret;
@@ -398,6 +415,93 @@ static int bcm7xxx_28nm_ephy_config_init(struct phy_device *phydev)return bcm7xxx_28nm_ephy_apd_enable (phydev); } +#define MII_BCM7XXX_REG_INVALID 0xff + +static u8 bcm7xxx_28nm_ephy_regnum_to_shd (u16 regnum) +{ +switch (regnum) { +case MDIO_CTRL1 : +return MII_BCM7XXX_SHD_3_PCS_CTRL ; +case MDIO_STAT1 : +return MII_BCM7XXX_SHD_3_PCS_STATUS ; +case MDIO_PCS_EEE_ABLE : +return MII_BCM7XXX_SHD_3_EEE_CAP ; +case MDIO_AN_EEE_ADV : +return MII_BCM7XXX_SHD_3_AN_EEE_ADV ; +case MDIO_AN_EEE_LPABLE : +return MII_BCM7XXX_SHD_3_EEE_LP ; +case MDIO_PCS_EEE_WK_ERR : +return MII_BCM7XXX_SHD_3_EEE_WK_ERR ; +default : +return MII_BCM7XXX_REG_INVALID ; + } +} + +static bool bcm7xxx_28nm_ephy_dev_valid (int devnum) +{ +return devnum ==MDIO_MMD_AN || devnum ==MDIO_MMD_PCS ; +} + +static int bcm7xxx_28nm_ephy_read_mmd (struct phy_device *phydev, +int devnum,u16 regnum) +{ +u8 shd =bcm7xxx_28nm_ephy_regnum_to_shd (regnum); +int ret; + +if (!bcm7xxx_28nm_ephy_dev_valid (devnum) || + shd ==MII_BCM7XXX_REG_INVALID ) +return -EOPNOTSUPP ; + +/* set shadow mode 2 */ + ret =__phy_set_clr_bits (phydev,MII_BCM7XXX_TEST , +MII_BCM7XXX_SHD_MODE_2 ,0 ); +if (ret <0 ) +return ret; + +/* Access the desired shadow register address */ + ret =__phy_write (phydev,MII_BCM7XXX_SHD_2_ADDR_CTRL , shd); +if (ret <0 ) + goto reset_shadow_mode; + + ret =__phy_read (phydev,MII_BCM7XXX_SHD_2_CTRL_STAT ); + +reset_shadow_mode: +/* reset shadow mode 2 */ +__phy_set_clr_bits (phydev,MII_BCM7XXX_TEST ,0 , +MII_BCM7XXX_SHD_MODE_2 ); +return ret; +} + +static int bcm7xxx_28nm_ephy_write_mmd (struct phy_device *phydev, +int devnum,u16 regnum,u16 val) +{ +u8 shd =bcm7xxx_28nm_ephy_regnum_to_shd (regnum); +int ret; + +if (!bcm7xxx_28nm_ephy_dev_valid (devnum) || + shd ==MII_BCM7XXX_REG_INVALID ) +return -EOPNOTSUPP ; + +/* set shadow mode 2 */ + ret =__phy_set_clr_bits (phydev,MII_BCM7XXX_TEST , +MII_BCM7XXX_SHD_MODE_2 ,0 ); +if (ret <0 ) +return ret; + +/* Access the desired shadow register address */ + ret =__phy_write (phydev,MII_BCM7XXX_SHD_2_ADDR_CTRL , shd); +if (ret <0 ) + goto reset_shadow_mode; + +/* Write the desired value in the shadow register */ +__phy_write (phydev,MII_BCM7XXX_SHD_2_CTRL_STAT , val); + +reset_shadow_mode: +/* reset shadow mode 2 */ +return __phy_set_clr_bits (phydev,MII_BCM7XXX_TEST ,0 , +MII_BCM7XXX_SHD_MODE_2 ); +} +static int bcm7xxx_28nm_ephy_resume (struct phy_device *phydev) {int ret;
@@ -595,6 +699,8 @@ static void bcm7xxx_28nm_remove(struct phy_device *phydev) .get_stats = bcm7xxx_28nm_get_phy_stats, \ .probe = bcm7xxx_28nm_probe, \ .remove = bcm7xxx_28nm_remove, \ + .read_mmd = bcm7xxx_28nm_ephy_read_mmd, \ + .write_mmd = bcm7xxx_28nm_ephy_write_mmd, \ }#define BCM7XXX_40NM_EPHY (_oui, _name) \
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 159/172 HID: u2fzero: ignore incomplete packets without data
In reply to Greg Kroah-HartmanFrom: Andrej Shadura <[email protected]>
commit 22d65765f211cc83186fd8b87521159f354c0da9 upstream.
Since the actual_length calculation is performed unsigned, packets shorter than 7 bytes (e.g. packets without data or otherwise truncated) or non-received packets ("zero" bytes) can cause buffer overflow.
--- drivers/hid/hid-u2fzero.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-u2fzero.c +3 -1
@@ -198,7 +198,9 @@ static int u2fzero_rng_read(struct hwrng } ret =u2fzero_recv (dev, &req, &resp); -if (ret <0 ) + +/* ignore errors or packets without data */ + if (ret < offsetof(struct u2f_hid_msg, init.data))return 0 ;/* only take the minimum amount of data it is safe to take */
Greg Kroah-Hartman
maintainerPATCH 160/172 net: udp: annotate data race around udp_sk(sk)->corkflag
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit a9f5970767d11eadc805d5283f202612c7ba1f59 upstream.
up->corkflag field can be read or written without any lock. Annotate accesses to avoid possible syzbot/KCSAN reports.
--- net/ipv4/udp.c | 10 +++++----- net/ipv6/udp.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
net/ipv4/udp.c +5 -5
@@ -1053,7 +1053,7 @@ int udp_sendmsg(struct sock *sk, struct__be16 dport;u8 tos;int err, is_udplite =IS_UDPLITE (sk); -int corkreq = up->corkflag || msg->msg_flags&MSG_MORE ; +int corkreq =READ_ONCE (up->corkflag) || msg->msg_flags&MSG_MORE ;int (*getfrag)(void *,char *,int ,int ,int ,struct sk_buff *);struct sk_buff *skb;struct ip_options_data opt_copy;
@@ -1361,7 +1361,7 @@ int udp_sendpage(struct sock *sk, struct } up->len += size; -if (!(up->corkflag || (flags&MSG_MORE ))) +if (!(READ_ONCE (up->corkflag) || (flags&MSG_MORE ))) ret =udp_push_pending_frames (sk);if (!ret) ret = size;
@@ -2662,9 +2662,9 @@ int udp_lib_setsockopt(struct sock *sk,switch (optname) {case UDP_CORK :if (val !=0 ) { - up->corkflag =1 ; +WRITE_ONCE (up->corkflag,1 ); }else { - up->corkflag =0 ; +WRITE_ONCE (up->corkflag,0 );lock_sock (sk);push_pending_frames (sk);release_sock (sk);
@@ -2787,7 +2787,7 @@ int udp_lib_getsockopt(struct sock *sk,switch (optname) {case UDP_CORK : - val = up->corkflag; + val =READ_ONCE (up->corkflag);break ;case UDP_ENCAP :
net/ipv6/udp.c +1 -1
@@ -1303,7 +1303,7 @@ int udpv6_sendmsg(struct sock *sk, strucint addr_len = msg->msg_namelen;bool connected = false;int ulen = len; -int corkreq = up->corkflag || msg->msg_flags&MSG_MORE ; +int corkreq =READ_ONCE (up->corkflag) || msg->msg_flags&MSG_MORE ;int err;int is_udplite =IS_UDPLITE (sk);int (*getfrag)(void *,char *,int ,int ,int ,struct sk_buff *);
Greg Kroah-Hartman
maintainerPATCH 161/172 NIOS2: setup.c: drop unused variable dram_start
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
commit 9523b33cc31cf8ce703f8facee9fd16cba36d5ad upstream.
This is a nuisance when CONFIG_WERROR is set, so drop the variable declaration since the code that used it was removed.
../arch/nios2/kernel/setup.c: In function 'setup_arch':../arch/nios2/kernel/setup.c:152:13: warning: unused variable 'dram_start' [-Wunused-variable]
152 | int dram_start;
--- arch/nios2/kernel/setup.c | 2 -- 1 file changed, 2 deletions(-)
arch/nios2/kernel/setup.c +0 -2
@@ -149,8 +149,6 @@ static void __init find_limits(unsignedvoid __init setup_arch (char **cmdline_p) { -int dram_start; -console_verbose (); memory_start =memblock_start_of_DRAM ();
Greg Kroah-Hartman
maintainerPATCH 162/172 usb: hso: remove the bailout parameter
In reply to Greg Kroah-HartmanFrom: Dongliang Mu <[email protected]>
commit dcb713d53e2eadf42b878c12a471e74dc6ed3145 upstream.
There are two invocation sites of hso_free_net_device. After refactoring hso_create_net_device, this parameter is useless. Remove the bailout in the hso_free_net_device and change the invocation sites of this function.
[Backport this cleanup patch to 5.10 and 5.14 in order to keep the codebase consistent with the 4.14/4.19/5.4 patchseries]
--- drivers/net/usb/hso.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/usb/hso.c +3 -3
@@ -2353,7 +2353,7 @@ static int remove_net_device(struct hso_ }/* Frees our network device */ -static void hso_free_net_device (struct hso_device *hso_dev,bool bailout) +static void hso_free_net_device (struct hso_device *hso_dev) {int i;struct hso_net *hso_net =dev2net (hso_dev);
@@ -2376,7 +2376,7 @@ static void hso_free_net_device(struct hkfree (hso_net->mux_bulk_tx_buf); hso_net->mux_bulk_tx_buf =NULL ; -if (hso_net->net && !bailout) +if (hso_net->net)free_netdev (hso_net->net);kfree (hso_dev);
@@ -3136,7 +3136,7 @@ static void hso_free_interface(struct usrfkill_unregister (rfk);rfkill_destroy (rfk); } -hso_free_net_device (network_table[i], false); +hso_free_net_device (network_table[i]); } } }
Greg Kroah-Hartman
maintainerPATCH 133/172 net: introduce and use lock_sock_fast_nested()
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
[ Upstream commit 49054556289e8787501630b7c7a9d407da02e296 ]
Syzkaller reported a false positive deadlock involving the nl socket lock and the subflow socket lock:
MPTCP: kernel_bind error, err=-98
============================================
WARNING: possible recursive locking detected
5.15.0-rc1-syzkaller #0 Not tainted
--------------------------------------------
syz-executor998/6520 is trying to acquire lock:ffff8880795718a0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x267/0x7b0 net/mptcp/protocol.c:2738
but task is already holding lock:ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1612 [inline] ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x23/0x7b0 net/mptcp/protocol.c:2720
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
---- lock(k-sk_lock-AF_INET);
lock(k-sk_lock-AF_INET);
*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by syz-executor998/6520:
#0: ffffffff8d176c50 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802 #1: ffffffff8d176d08 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8d176d08 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x3e0/0x580 net/netlink/genetlink.c:790 #2: ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1612 [inline] #2: ffff8880787c8c60 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: mptcp_close+0x23/0x7b0 net/mptcp/protocol.c:2720
stack backtrace: CPU: 1 PID: 6520 Comm: syz-executor998 Not tainted 5.15.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline] check_deadlock kernel/locking/lockdep.c:2987 [inline] validate_chain kernel/locking/lockdep.c:3776 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 lock_sock_fast+0x36/0x100 net/core/sock.c:3229 mptcp_close+0x267/0x7b0 net/mptcp/protocol.c:2738 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 __sock_release net/socket.c:649 [inline] sock_release+0x87/0x1b0 net/socket.c:677 mptcp_pm_nl_create_listen_socket+0x238/0x2c0 net/mptcp/pm_netlink.c:900 mptcp_nl_cmd_add_addr+0x359/0x930 net/mptcp/pm_netlink.c:1170 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 sock_no_sendpage+0x101/0x150 net/core/sock.c:2980 kernel_sendpage.part.0+0x1a0/0x340 net/socket.c:3504 kernel_sendpage net/socket.c:3501 [inline] sock_sendpage+0xe5/0x140 net/socket.c:1003 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x43e/0x8a0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xae9/0x1240 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1314 [inline] __se_sys_sendfile64 fs/read_write.c:1300 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1300 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f215cb69969 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc96bb3868 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f215cbad072 RCX: 00007f215cb69969 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 0000000000000000 R08: 00007ffc96bb3a08 R09: 00007ffc96bb3a08 R10: 0000000100000002 R11: 0000000000000246 R12: 00007ffc96bb387c R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
the problem originates from uncorrect lock annotation in the mptcp code and is only visible since commit 2dcb96bacce3 ("net: core: Correct the sock::sk_lock.owned lockdep annotations"), but is present since the port-based endpoint support initial implementation.
This patch addresses the issue introducing a nested variant of lock_sock_fast() and using it in the relevant code path.
--- include/net/sock.h | 31 ++++++++++++++++++++++++++++++- net/core/sock.c | 17 ++--------------- net/mptcp/protocol.c | 2 +- 3 files changed, 33 insertions(+), 17 deletions(-)
include/net/sock.h +30 -1
@@ -1624,7 +1624,36 @@ void release_sock(struct sock *sk); SINGLE_DEPTH_NESTING)#define bh_unlock_sock (__sk) spin_unlock(&((__sk)->sk_lock.slock)) -bool lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock); +bool __lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock); + +/** +* lock_sock_fast - fast version of lock_sock +* @sk: socket +* +* This version should be used for very small section, where process wont block +* return false if fast path is taken: +* +* sk_lock.slock locked, owned = 0, BH disabled +* +* return true if slow path is taken: +* +* sk_lock.slock unlocked, owned = 1, BH enabled +*/ +static inline bool lock_sock_fast (struct sock *sk) +{ +/* The sk_lock has mutex_lock() semantics here. */ +mutex_acquire (&sk->sk_lock.dep_map,0 ,0 , _RET_IP_); + +return __lock_sock_fast (sk); +} + +/* fast socket lock variant for caller already holding a [different] socket lock */ +static inline bool lock_sock_fast_nested (struct sock *sk) +{ +mutex_acquire (&sk->sk_lock.dep_map,SINGLE_DEPTH_NESTING ,0 , _RET_IP_); + +return __lock_sock_fast (sk); +}/** * unlock_sock_fast - complement of lock_sock_fast
net/core/sock.c +2 -15
@@ -3191,20 +3191,7 @@ void release_sock(struct sock *sk) }EXPORT_SYMBOL (release_sock); -/** -* lock_sock_fast - fast version of lock_sock -* @sk: socket -* -* This version should be used for very small section, where process wont block -* return false if fast path is taken: -* -* sk_lock.slock locked, owned = 0, BH disabled -* -* return true if slow path is taken: -* -* sk_lock.slock unlocked, owned = 1, BH enabled -*/ -bool lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock) +bool __lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock) {might_sleep ();spin_lock_bh (&sk->sk_lock.slock);
@@ -3226,7 +3213,7 @@ bool lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock)local_bh_enable ();return true; } -EXPORT_SYMBOL (lock_sock_fast); +EXPORT_SYMBOL (__lock_sock_fast);int sock_gettstamp (struct socket *sock,void __user *userstamp,bool timeval,bool time32)
net/mptcp/protocol.c +1 -1
@@ -2622,7 +2622,7 @@ static void mptcp_close(struct sock *sk, long timeout)inet_csk (sk)->icsk_mtup.probe_timestamp = tcp_jiffies32;mptcp_for_each_subflow (mptcp_sk (sk), subflow) {struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -bool slow =lock_sock_fast (ssk); +bool slow =lock_sock_fast_nested (ssk);sock_orphan (ssk);unlock_sock_fast (ssk, slow);
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 163/172 HID: betop: fix slab-out-of-bounds Write in betop_probe
In reply to Greg Kroah-HartmanFrom: F.A.Sulaiman <[email protected]>
commit 1e4ce418b1cb1a810256b5fb3fd33d22d1325993 upstream.
Syzbot reported slab-out-of-bounds Write bug in hid-betopff driver. The problem is the driver assumes the device must have an input report but some malicious devices violate this assumption.
So this patch checks hid_device's input is non empty before it's been used.
--- drivers/hid/hid-betopff.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/hid/hid-betopff.c +10 -3
@@ -56,15 +56,22 @@ static int betopff_init(struct hid_devic {struct betopff_device *betopff;struct hid_report *report; -struct hid_input *hidinput = - list_first_entry(&hid->inputs, struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int field_count =0 ;int error;int i, j; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output reports found\n" );return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 134/172 net: sched: flower: protect fl_walk() with rcu
In reply to Greg Kroah-HartmanFrom: Vlad Buslov <[email protected]>
[ Upstream commit d5ef190693a7d76c5c192d108e8dec48307b46ee ]
Patch that refactored fl_walk() to use idr_for_each_entry_continue_ul() also removed rcu protection of individual filters which causes following use-after-free when filter is deleted concurrently. Fix fl_walk() to obtain rcu read lock while iterating and taking the filter reference and temporary release the lock while calling arg->fn() callback that can sleep.
KASAN trace:
[ 352.773640] ================================================================== [ 352.775041] BUG: KASAN: use-after-free in fl_walk+0x159/0x240 [cls_flower] [ 352.776304] Read of size 4 at addr ffff8881c8251480 by task tc/2987
[ 352.777862] CPU: 3 PID: 2987 Comm: tc Not tainted 5.15.0-rc2+ #2 [ 352.778980] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 352.781022] Call Trace: [ 352.781573] dump_stack_lvl+0x46/0x5a [ 352.782332] print_address_description.constprop.0+0x1f/0x140 [ 352.783400] ? fl_walk+0x159/0x240 [cls_flower] [ 352.784292] ? fl_walk+0x159/0x240 [cls_flower] [ 352.785138] kasan_report.cold+0x83/0xdf [ 352.785851] ? fl_walk+0x159/0x240 [cls_flower] [ 352.786587] kasan_check_range+0x145/0x1a0 [ 352.787337] fl_walk+0x159/0x240 [cls_flower] [ 352.788163] ? fl_put+0x10/0x10 [cls_flower] [ 352.789007] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.790102] tcf_chain_dump+0x231/0x450 [ 352.790878] ? tcf_chain_tp_delete_empty+0x170/0x170 [ 352.791833] ? __might_sleep+0x2e/0xc0 [ 352.792594] ? tfilter_notify+0x170/0x170 [ 352.793400] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.794477] tc_dump_tfilter+0x385/0x4b0 [ 352.795262] ? tc_new_tfilter+0x1180/0x1180 [ 352.796103] ? __mod_node_page_state+0x1f/0xc0 [ 352.796974] ? __build_skb_around+0x10e/0x130 [ 352.797826] netlink_dump+0x2c0/0x560 [ 352.798563] ? netlink_getsockopt+0x430/0x430 [ 352.799433] ? __mutex_unlock_slowpath.constprop.0+0x220/0x220 [ 352.800542] __netlink_dump_start+0x356/0x440 [ 352.801397] rtnetlink_rcv_msg+0x3ff/0x550 [ 352.802190] ? tc_new_tfilter+0x1180/0x1180 [ 352.802872] ? rtnl_calcit.isra.0+0x1f0/0x1f0 [ 352.803668] ? tc_new_tfilter+0x1180/0x1180 [ 352.804344] ? _copy_from_iter_nocache+0x800/0x800 [ 352.805202] ? kasan_set_track+0x1c/0x30 [ 352.805900] netlink_rcv_skb+0xc6/0x1f0 [ 352.806587] ? rht_deferred_worker+0x6b0/0x6b0 [ 352.807455] ? rtnl_calcit.isra.0+0x1f0/0x1f0 [ 352.808324] ? netlink_ack+0x4d0/0x4d0 [ 352.809086] ? netlink_deliver_tap+0x62/0x3d0 [ 352.809951] netlink_unicast+0x353/0x480 [ 352.810744] ? netlink_attachskb+0x430/0x430 [ 352.811586] ? __alloc_skb+0xd7/0x200 [ 352.812349] netlink_sendmsg+0x396/0x680 [ 352.813132] ? netlink_unicast+0x480/0x480 [ 352.813952] ? __import_iovec+0x192/0x210 [ 352.814759] ? netlink_unicast+0x480/0x480 [ 352.815580] sock_sendmsg+0x6c/0x80 [ 352.816299] ____sys_sendmsg+0x3a5/0x3c0 [ 352.817096] ? kernel_sendmsg+0x30/0x30 [ 352.817873] ? __ia32_sys_recvmmsg+0x150/0x150 [ 352.818753] ___sys_sendmsg+0xd8/0x140 [ 352.819518] ? sendmsg_copy_msghdr+0x110/0x110 [ 352.820402] ? ___sys_recvmsg+0xf4/0x1a0 [ 352.821110] ? __copy_msghdr_from_user+0x260/0x260 [ 352.821934] ? _raw_spin_lock+0x81/0xd0 [ 352.822680] ? __handle_mm_fault+0xef3/0x1b20 [ 352.823549] ? rb_insert_color+0x2a/0x270 [ 352.824373] ? copy_page_range+0x16b0/0x16b0 [ 352.825209] ? perf_event_update_userpage+0x2d0/0x2d0 [ 352.826190] ? __fget_light+0xd9/0xf0 [ 352.826941] __sys_sendmsg+0xb3/0x130 [ 352.827613] ? __sys_sendmsg_sock+0x20/0x20 [ 352.828377] ? do_user_addr_fault+0x2c5/0x8a0 [ 352.829184] ? fpregs_assert_state_consistent+0x52/0x60 [ 352.830001] ? exit_to_user_mode_prepare+0x32/0x160 [ 352.830845] do_syscall_64+0x35/0x80 [ 352.831445] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 352.832331] RIP: 0033:0x7f7bee973c17 [ 352.833078] Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 352.836202] RSP: 002b:00007ffcbb368e28 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 352.837524] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7bee973c17 [ 352.838715] RDX: 0000000000000000 RSI: 00007ffcbb368e50 RDI: 0000000000000003 [ 352.839838] RBP: 00007ffcbb36d090 R08: 00000000cea96d79 R09: 00007f7beea34a40 [ 352.841021] R10: 00000000004059bb R11: 0000000000000246 R12: 000000000046563f [ 352.842208] R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffcbb36d088
[ 352.843784] Allocated by task 2960: [ 352.844451] kasan_save_stack+0x1b/0x40 [ 352.845173] __kasan_kmalloc+0x7c/0x90 [ 352.845873] fl_change+0x282/0x22db [cls_flower] [ 352.846696] tc_new_tfilter+0x6cf/0x1180 [ 352.847493] rtnetlink_rcv_msg+0x471/0x550 [ 352.848323] netlink_rcv_skb+0xc6/0x1f0 [ 352.849097] netlink_unicast+0x353/0x480 [ 352.849886] netlink_sendmsg+0x396/0x680 [ 352.850678] sock_sendmsg+0x6c/0x80 [ 352.851398] ____sys_sendmsg+0x3a5/0x3c0 [ 352.852202] ___sys_sendmsg+0xd8/0x140 [ 352.852967] __sys_sendmsg+0xb3/0x130 [ 352.853718] do_syscall_64+0x35/0x80 [ 352.854457] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 352.855830] Freed by task 7: [ 352.856421] kasan_save_stack+0x1b/0x40 [ 352.857139] kasan_set_track+0x1c/0x30 [ 352.857854] kasan_set_free_info+0x20/0x30 [ 352.858609] __kasan_slab_free+0xed/0x130 [ 352.859348] kfree+0xa7/0x3c0 [ 352.859951] process_one_work+0x44d/0x780 [ 352.860685] worker_thread+0x2e2/0x7e0 [ 352.861390] kthread+0x1f4/0x220 [ 352.862022] ret_from_fork+0x1f/0x30
[ 352.862955] Last potentially related work creation: [ 352.863758] kasan_save_stack+0x1b/0x40 [ 352.864378] kasan_record_aux_stack+0xab/0xc0 [ 352.865028] insert_work+0x30/0x160 [ 352.865617] __queue_work+0x351/0x670 [ 352.866261] rcu_work_rcufn+0x30/0x40 [ 352.866917] rcu_core+0x3b2/0xdb0 [ 352.867561] __do_softirq+0xf6/0x386
[ 352.868708] Second to last potentially related work creation: [ 352.869779] kasan_save_stack+0x1b/0x40 [ 352.870560] kasan_record_aux_stack+0xab/0xc0 [ 352.871426] call_rcu+0x5f/0x5c0 [ 352.872108] queue_rcu_work+0x44/0x50 [ 352.872855] __fl_put+0x17c/0x240 [cls_flower] [ 352.873733] fl_delete+0xc7/0x100 [cls_flower] [ 352.874607] tc_del_tfilter+0x510/0xb30 [ 352.886085] rtnetlink_rcv_msg+0x471/0x550 [ 352.886875] netlink_rcv_skb+0xc6/0x1f0 [ 352.887636] netlink_unicast+0x353/0x480 [ 352.888285] netlink_sendmsg+0x396/0x680 [ 352.888942] sock_sendmsg+0x6c/0x80 [ 352.889583] ____sys_sendmsg+0x3a5/0x3c0 [ 352.890311] ___sys_sendmsg+0xd8/0x140 [ 352.891019] __sys_sendmsg+0xb3/0x130 [ 352.891716] do_syscall_64+0x35/0x80 [ 352.892395] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 352.893666] The buggy address belongs to the object at ffff8881c8251000
which belongs to the cache kmalloc-2k of size 2048
[ 352.895696] The buggy address is located 1152 bytes inside of
2048-byte region [ffff8881c8251000, ffff8881c8251800)
[ 352.897640] The buggy address belongs to the page:
[ 352.898492] page:00000000213bac35 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c8250
[ 352.900110] head:00000000213bac35 order:3 compound_mapcount:0 compound_pincount:0
[ 352.901541] flags: 0x2ffff800010200(slab|head|node=0|zone=2|lastcpupid=0x1ffff)
[ 352.902908] raw: 002ffff800010200 0000000000000000 dead000000000122 ffff888100042f00
[ 352.904391] raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
[ 352.905861] page dumped because: kasan: bad access detected[ 352.907323] Memory state around the buggy address: [ 352.908218] ffff8881c8251380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.909471] ffff8881c8251400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.910735] >ffff8881c8251480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.912012] ^ [ 352.912642] ffff8881c8251500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.913919] ffff8881c8251580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 352.915185] ==================================================================
--- net/sched/cls_flower.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/sched/cls_flower.c +6 -0
@@ -2188,18 +2188,24 @@ static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg, arg->count = arg->skip; +rcu_read_lock ();idr_for_each_entry_continue_ul (&head->handle_idr, f, tmp, id) {/* don't return filters that are being deleted */ if (!refcount_inc_not_zero (&f->refcnt))continue ; +rcu_read_unlock (); +if (arg->fn (tp, f, arg) <0 ) {__fl_put (f); arg->stop =1 ; +rcu_read_lock ();break ; }__fl_put (f); arg->count++; +rcu_read_lock (); } +rcu_read_unlock (); arg->cookie = id; }
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 135/172 net: stmmac: fix EEE init issue when paired with EEE capable PHYs
In reply to Greg Kroah-HartmanFrom: Wong Vee Khee <[email protected]>
[ Upstream commit 656ed8b015f19bf3f6e6b3ddd9a4bb4aa5ca73e1 ]
When STMMAC is paired with Energy-Efficient Ethernet(EEE) capable PHY, and the PHY is advertising EEE by default, we need to enable EEE on the xPCS side too, instead of having user to manually trigger the enabling config via ethtool.
Fixed this by adding xpcs_config_eee() call in stmmac_eee_init().
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 -0
@@ -486,6 +486,10 @@ bool stmmac_eee_init(struct stmmac_priv *priv)timer_setup (&priv->eee_ctrl_timer, stmmac_eee_ctrl_timer,0 );stmmac_set_eee_timer (priv, priv->hw,STMMAC_DEFAULT_LIT_LS , eee_tw_timer); +if (priv->hw->xpcs) +xpcs_config_eee (priv->hw->xpcs, + priv->plat->mult_fact_100ns, + true); }if (priv->plat->has_gmac4 && priv->tx_lpi_timer <=STMMAC_ET_MAX ) {
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 136/172 af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 35306eb23814444bd4021f8a1c3047d3cb0c8b2b ]
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs to be used whenever these fields are read or written.
Jann also pointed out that l2cap_sock_get_peer_pid_cb() is currently reading sk->sk_peer_pid which makes no sense, as this field
is only possibly set by AF_UNIX sockets.
We will have to clean this in a separate patch.
This could be done by reverting b48596d1dc25 "Bluetooth: L2CAP: Add get_peer_pid callback" or implementing what was truly expected.
--- include/net/sock.h | 2 ++ net/core/sock.c | 32 ++++++++++++++++++++++++++------ net/unix/af_unix.c | 34 ++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 12 deletions(-)
include/net/sock.h +2 -0
@@ -487,8 +487,10 @@ struct sock {u8 sk_prefer_busy_poll;u16 sk_busy_poll_budget;#endif +spinlock_t sk_peer_lock;struct pid *sk_peer_pid;const struct cred *sk_peer_cred; +long sk_rcvtimeo;ktime_t sk_stamp;#if BITS_PER_LONG ==32
net/core/sock.c +26 -6
@@ -1366,6 +1366,16 @@ int sock_setsockopt(struct socket *sock, int level, int optname, }EXPORT_SYMBOL (sock_setsockopt); +static const struct cred *sk_get_peer_cred (struct sock *sk) +{ +const struct cred *cred; + +spin_lock (&sk->sk_peer_lock); + cred =get_cred (sk->sk_peer_cred); +spin_unlock (&sk->sk_peer_lock); + +return cred; +}static void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred)
@@ -1542,7 +1552,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname,struct ucred peercred;if (len >sizeof (peercred)) len =sizeof (peercred); + +spin_lock (&sk->sk_peer_lock);cred_to_ucred (sk->sk_peer_pid, sk->sk_peer_cred, &peercred); +spin_unlock (&sk->sk_peer_lock); +if (copy_to_user (optval, &peercred, len))return -EFAULT ; goto lenout;
@@ -1550,20 +1564,23 @@ int sock_getsockopt(struct socket *sock, int level, int optname,case SO_PEERGROUPS : { +const struct cred *cred;int ret, n; -if (!sk->sk_peer_cred) + cred =sk_get_peer_cred (sk); +if (!cred)return -ENODATA ; - n = sk->sk_peer_cred->group_info->ngroups; + n = cred->group_info->ngroups;if (len < n *sizeof (gid_t)) { len = n *sizeof (gid_t); +put_cred (cred);return put_user (len, optlen) ? -EFAULT : -ERANGE ; } len = n *sizeof (gid_t); - ret =groups_to_user ((gid_t __user *)optval, - sk->sk_peer_cred->group_info); + ret =groups_to_user ((gid_t __user *)optval, cred->group_info); +put_cred (cred);if (ret)return ret; goto lenout;
@@ -1921,9 +1938,10 @@ static void __sk_destruct(struct rcu_head *head) sk->sk_frag.page =NULL ; } -if (sk->sk_peer_cred) -put_cred (sk->sk_peer_cred); +/* We do not need to acquire sk->sk_peer_lock, we are the last user. */ +put_cred (sk->sk_peer_cred);put_pid (sk->sk_peer_pid); +if (likely (sk->sk_net_refcnt))put_net (sock_net (sk));sk_prot_free (sk->sk_prot_creator, sk);
@@ -3124,6 +3142,8 @@ void sock_init_data(struct socket *sock, struct sock *sk) sk->sk_peer_pid =NULL ; sk->sk_peer_cred =NULL ; +spin_lock_init (&sk->sk_peer_lock); + sk->sk_write_pending =0 ; sk->sk_rcvlowat =1 ; sk->sk_rcvtimeo =MAX_SCHEDULE_TIMEOUT ;
net/unix/af_unix.c +28 -6
@@ -600,20 +600,42 @@ static void unix_release_sock(struct sock *sk, int embrion)static void init_peercred (struct sock *sk) { -put_pid (sk->sk_peer_pid); -if (sk->sk_peer_cred) -put_cred (sk->sk_peer_cred); +const struct cred *old_cred; +struct pid *old_pid; + +spin_lock (&sk->sk_peer_lock); + old_pid = sk->sk_peer_pid; + old_cred = sk->sk_peer_cred; sk->sk_peer_pid =get_pid (task_tgid (current)); sk->sk_peer_cred =get_current_cred (); +spin_unlock (&sk->sk_peer_lock); + +put_pid (old_pid); +put_cred (old_cred); }static void copy_peercred (struct sock *sk,struct sock *peersk) { -put_pid (sk->sk_peer_pid); -if (sk->sk_peer_cred) -put_cred (sk->sk_peer_cred); +const struct cred *old_cred; +struct pid *old_pid; + +if (sk < peersk) { +spin_lock (&sk->sk_peer_lock); +spin_lock_nested (&peersk->sk_peer_lock,SINGLE_DEPTH_NESTING ); + }else { +spin_lock (&peersk->sk_peer_lock); +spin_lock_nested (&sk->sk_peer_lock,SINGLE_DEPTH_NESTING ); + } + old_pid = sk->sk_peer_pid; + old_cred = sk->sk_peer_cred; sk->sk_peer_pid =get_pid (peersk->sk_peer_pid); sk->sk_peer_cred =get_cred (peersk->sk_peer_cred); + +spin_unlock (&sk->sk_peer_lock); +spin_unlock (&peersk->sk_peer_lock); + +put_pid (old_pid); +put_cred (old_cred); }static int unix_listen (struct socket *sock,int backlog)
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 137/172 objtool: Teach get_alt_entry() about more relocation types
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
[ Upstream commit 24ff652573754fe4c03213ebd26b17e86842feb3 ]
Occasionally objtool encounters symbol (as opposed to section) relocations in .altinstructions. Typically they are the alternatives written by elf_add_alternative() as encountered on a noinstr validation run on vmlinux after having already ran objtool on the individual .o files.
Basically this is the counterpart of commit 44f6a7c0755d ("objtool:
Fix seg fault with Clang non-section symbols"), because when these new assemblers (binutils now also does this) strip the section symbols, elf_add_reloc_to_insn() is forced to emit symbol based relocations.
As such, teach get_alt_entry() about different relocation types.
--- tools/objtool/special.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-)
tools/objtool/special.c +25 -7
@@ -58,6 +58,24 @@ void __weak arch_handle_alternative(unsigned short feature, struct special_alt * { } +static bool reloc2sec_off (struct reloc *reloc,struct section **sec,unsigned long *off) +{ +switch (reloc->sym->type) { +case STT_FUNC : + *sec = reloc->sym->sec; + *off = reloc->sym->offset + reloc->addend; +return true; + +case STT_SECTION : + *sec = reloc->sym->sec; + *off = reloc->addend; +return true; + +default : +return false; + } +} +static int get_alt_entry (struct elf *elf,struct special_entry *entry,struct section *sec,int idx,struct special_alt *alt)
@@ -91,15 +109,12 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,WARN_FUNC ("can't find orig reloc" , sec, offset + entry->orig);return -1 ; } -if (orig_reloc->sym->type !=STT_SECTION ) { -WARN_FUNC ("don't know how to handle non-section reloc symbol %s" , +if (!reloc2sec_off (orig_reloc, &alt->orig_sec, &alt->orig_off)) { +WARN_FUNC ("don't know how to handle reloc symbol type: %s" , sec, offset + entry->orig, orig_reloc->sym->name);return -1 ; } - alt->orig_sec = orig_reloc->sym->sec; - alt->orig_off = orig_reloc->addend; -if (!entry->group || alt->new_len) { new_reloc =find_reloc_by_dest (elf, sec, offset + entry->new);if (!new_reloc) {
@@ -116,8 +131,11 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,if (arch_is_retpoline (new_reloc->sym))return 1 ; - alt->new_sec = new_reloc->sym->sec; - alt->new_off = (unsigned int )new_reloc->addend; +if (!reloc2sec_off (new_reloc, &alt->new_sec, &alt->new_off)) { +WARN_FUNC ("don't know how to handle reloc symbol type: %s" , + sec, offset + entry->new, new_reloc->sym->name); +return -1 ; + }/* _ASM_EXTABLE_EX hack */ if (alt->new_off >=0x7ffffff0 )
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 129/172 net: hns3: reconstruct function hns3_self_test
In reply to Greg Kroah-HartmanFrom: Peng Li <[email protected]>
[ Upstream commit 4c8dab1c709c5a715bce14efdb8f4e889d86aa04 ]
This patch reconstructs function hns3_self_test to reduce the code cycle complexity and make code more concise.
--- .../ethernet/hisilicon/hns3/hns3_ethtool.c | 101 +++++++++++------- 1 file changed, 64 insertions(+), 37 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +64 -37
@@ -312,33 +312,8 @@ static int hns3_lp_run_test(struct net_device *ndev, enum hnae3_loop mode)return ret_val; } -/** -* hns3_self_test - self test -* @ndev: net device -* @eth_test: test cmd -* @data: test result -*/ -static void hns3_self_test (struct net_device *ndev, -struct ethtool_test *eth_test,u64 *data) +static void hns3_set_selftest_param (struct hnae3_handle *h,int (*st_param)[2 ]) { -struct hns3_nic_priv *priv =netdev_priv (ndev); -struct hnae3_handle *h = priv->ae_handle; -int st_param[HNS3_SELF_TEST_TYPE_NUM ][2 ]; -bool if_running =netif_running (ndev); -int test_index =0 ; -u32 i; - -if (hns3_nic_resetting (ndev)) { -netdev_err (ndev,"dev resetting!" ); -return ; - } - -/* Only do offline selftest, or pass by default */ -if (eth_test->flags !=ETH_TEST_FL_OFFLINE ) -return ; - -netif_dbg (h, drv, ndev,"self test start" ); - st_param[HNAE3_LOOP_APP ][0 ] =HNAE3_LOOP_APP ; st_param[HNAE3_LOOP_APP ][1 ] = h->flags &HNAE3_SUPPORT_APP_LOOPBACK ;
@@ -355,6 +330,18 @@ static void hns3_self_test(struct net_device *ndev, st_param[HNAE3_LOOP_PHY ][0 ] =HNAE3_LOOP_PHY ; st_param[HNAE3_LOOP_PHY ][1 ] = h->flags &HNAE3_SUPPORT_PHY_LOOPBACK ; +} + +static void hns3_selftest_prepare (struct net_device *ndev, +bool if_running,int (*st_param)[2 ]) +{ +struct hns3_nic_priv *priv =netdev_priv (ndev); +struct hnae3_handle *h = priv->ae_handle; + +if (netif_msg_ifdown (h)) +netdev_info (ndev,"self test start\n" ); + +hns3_set_selftest_param (h, st_param);if (if_running) ndev->netdev_ops->ndo_stop (ndev);
@@ -373,6 +360,35 @@ static void hns3_self_test(struct net_device *ndev, h->ae_algo->ops->halt_autoneg (h, true);set_bit (HNS3_NIC_STATE_TESTING , &priv->state); +} + +static void hns3_selftest_restore (struct net_device *ndev,bool if_running) +{ +struct hns3_nic_priv *priv =netdev_priv (ndev); +struct hnae3_handle *h = priv->ae_handle; + +clear_bit (HNS3_NIC_STATE_TESTING , &priv->state); + +if (h->ae_algo->ops->halt_autoneg) + h->ae_algo->ops->halt_autoneg (h, false); + +#if IS_ENABLED (CONFIG_VLAN_8021Q ) +if (h->ae_algo->ops->enable_vlan_filter) + h->ae_algo->ops->enable_vlan_filter (h, true); +#endif + +if (if_running) + ndev->netdev_ops->ndo_open (ndev); + +if (netif_msg_ifdown (h)) +netdev_info (ndev,"self test end\n" ); +} + +static void hns3_do_selftest (struct net_device *ndev,int (*st_param)[2 ], +struct ethtool_test *eth_test,u64 *data) +{ +int test_index =0 ; +u32 i;for (i =0 ; i <HNS3_SELF_TEST_TYPE_NUM ; i++) {enum hnae3_loop loop_type = (enum hnae3_loop )st_param[i][0 ];
@@ -391,21 +407,32 @@ static void hns3_self_test(struct net_device *ndev, test_index++; } +} -clear_bit (HNS3_NIC_STATE_TESTING , &priv->state); - -if (h->ae_algo->ops->halt_autoneg) - h->ae_algo->ops->halt_autoneg (h, false); +/** +* hns3_nic_self_test - self test +* @ndev: net device +* @eth_test: test cmd +* @data: test result +*/ +static void hns3_self_test (struct net_device *ndev, +struct ethtool_test *eth_test,u64 *data) +{ +int st_param[HNS3_SELF_TEST_TYPE_NUM ][2 ]; +bool if_running =netif_running (ndev); -#if IS_ENABLED (CONFIG_VLAN_8021Q ) -if (h->ae_algo->ops->enable_vlan_filter) - h->ae_algo->ops->enable_vlan_filter (h, true); -#endif +if (hns3_nic_resetting (ndev)) { +netdev_err (ndev,"dev resetting!" ); +return ; + } -if (if_running) - ndev->netdev_ops->ndo_open (ndev); +/* Only do offline selftest, or pass by default */ +if (eth_test->flags !=ETH_TEST_FL_OFFLINE ) +return ; -netif_dbg (h, drv, ndev,"self test end\n" ); +hns3_selftest_prepare (ndev, if_running, st_param); +hns3_do_selftest (ndev, st_param, eth_test, data); +hns3_selftest_restore (ndev, if_running); } static void hns3_update_limit_promisc_mode(struct net_device *netdev,
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 138/172 perf/x86/intel: Update event constraints for ICX
In reply to Greg Kroah-HartmanFrom: Kan Liang <[email protected]>
[ Upstream commit ecc2123e09f9e71ddc6c53d71e283b8ada685fe2 ]
According to the latest event list, the event encoding 0xEF is only available on the first 4 counters. Add it into the event constraints table.
--- arch/x86/events/intel/core.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/core.c +1 -0
@@ -263,6 +263,7 @@ static struct event_constraint intel_icl_event_constraints[] = {INTEL_EVENT_CONSTRAINT_RANGE (0xa8 ,0xb0 ,0xf ),INTEL_EVENT_CONSTRAINT_RANGE (0xb7 ,0xbd ,0xf ),INTEL_EVENT_CONSTRAINT_RANGE (0xd0 ,0xe6 ,0xf ), +INTEL_EVENT_CONSTRAINT (0xef ,0xf ),INTEL_EVENT_CONSTRAINT_RANGE (0xf0 ,0xf4 ,0xf ), EVENT_CONSTRAINT_END };
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerPATCH 165/172 mm: dont allow oversized kvmalloc() calls
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
commit 7661809d493b426e979f39ab512e3adf41fbcc69 upstream.
'kvmalloc()' is a convenience function for people who want to do a kmalloc() but fall back on vmalloc() if there aren't enough physically contiguous pages, or if the allocation is larger than what kmalloc() supports.
However, let's make sure it doesn't get _too_ easy to do crazy things with it. In particular, don't allow big allocations that could be due to integer overflow or underflow. So make sure the allocation size fits in an 'int', to protect against trivial integer conversion issues.
--- mm/util.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/util.c +4 -0
@@ -593,6 +593,10 @@ void *kvmalloc_node(size_t size, gfp_t fif (ret || size <=PAGE_SIZE )return ret; +/* Don't even allow crazy sizes */ +if (WARN_ON_ONCE (size >INT_MAX )) +return NULL ; +return __vmalloc_node (size,1 , flags, node,__builtin_return_address (0 )); }
Greg Kroah-Hartman
maintainerPATCH 166/172 HID: usbhid: free raw_report buffers in usbhid_stop
In reply to Greg Kroah-HartmanFrom: Anirudh Rayabharam <[email protected]>
commit f7744fa16b96da57187dc8e5634152d3b63d72de upstream.
Free the unsent raw_report buffers when the device is removed.
Fixes a memory leak reported by syzbot at:
https://syzkaller.appspot.com/bug?id=7b4fa7cb1a7c2d3342a2a8a6c53371c8c418ab47
--- drivers/hid/usbhid/hid-core.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/hid/usbhid/hid-core.c +12 -1
@@ -505,7 +505,7 @@ static void hid_ctrl(struct urb *urb)if (unplug) { usbhid->ctrltail = usbhid->ctrlhead; - }else { + }else if (usbhid->ctrlhead != usbhid->ctrltail) { usbhid->ctrltail = (usbhid->ctrltail +1 ) & (HID_CONTROL_FIFO_SIZE -1 ); if (usbhid->ctrlhead != usbhid->ctrltail &&
@@ -1223,9 +1223,20 @@ static void usbhid_stop(struct hid_devicmutex_lock (&usbhid->mutex);clear_bit (HID_STARTED , &usbhid->iofl); +spin_lock_irq (&usbhid->lock);/* Sync with error and led handlers */ set_bit (HID_DISCONNECTED , &usbhid->iofl); +while (usbhid->ctrltail != usbhid->ctrlhead) { +if (usbhid->ctrl[usbhid->ctrltail].dir ==USB_DIR_OUT ) { +kfree (usbhid->ctrl[usbhid->ctrltail].raw_report); + usbhid->ctrl[usbhid->ctrltail].raw_report =NULL ; + } + + usbhid->ctrltail = (usbhid->ctrltail +1 ) & + (HID_CONTROL_FIFO_SIZE -1 ); + }spin_unlock_irq (&usbhid->lock); +usb_kill_urb (usbhid->urbin);usb_kill_urb (usbhid->urbout);usb_kill_urb (usbhid->urbctrl);
Greg Kroah-Hartman
maintainerPATCH 167/172 crypto: aesni - xts_crypt() return if walk.nbytes is 0
In reply to Greg Kroah-HartmanFrom: Shreyansh Chouhan <[email protected]>
commit 72ff2bf04db2a48840df93a461b7115900f46c05 upstream.
xts_crypt() code doesn't call kernel_fpu_end() after calling kernel_fpu_begin() if walk.nbytes is 0. The correct behavior should be not calling kernel_fpu_begin() if walk.nbytes is 0.
--- arch/x86/crypto/aesni-intel_glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -849,7 +849,7 @@ static int xts_crypt(struct skcipher_reqreturn -EINVAL ; err =skcipher_walk_virt (&walk, req, false); -if (err) +if (!walk.nbytes)return err;if (unlikely (tail >0 && walk.nbytes < walk.total)) {
Greg Kroah-Hartman
maintainerPATCH 171/172 netfilter: nf_tables: Fix oversized kvmalloc() calls
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
commit 45928afe94a094bcda9af858b96673d59bc4a0e9 upstream.
The commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") limits the max allocatable memory via kvmalloc() to MAX_INT.
--- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
@@ -4336,7 +4336,7 @@ static int nf_tables_newset(struct sk_buif (ops->privsize !=NULL ) size = ops->privsize (nla, &desc); alloc_size =sizeof (*set) + size + udlen; -if (alloc_size < size) +if (alloc_size < size || alloc_size >INT_MAX )return -ENOMEM ; set =kvzalloc (alloc_size,GFP_KERNEL );if (!set)
Greg Kroah-Hartman
maintainerPATCH 164/172 netfilter: ipset: Fix oversized kvmalloc() calls
In reply to Greg Kroah-HartmanFrom: Jozsef Kadlecsik <[email protected]>
commit 7bbc3d385bd813077acaf0e6fdb2a86a901f5382 upstream.
The commit
commit 7661809d493b426e979f39ab512e3adf41fbcc69
Author: Linus Torvalds <[email protected]> Date: Wed Jul 14 09:45:49 2021 -0700
mm: don't allow oversized kvmalloc() calls
limits the max allocatable memory via kvmalloc() to MAX_INT. Apply the same limit in ipset.
--- net/netfilter/ipset/ip_set_hash_gen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/ipset/ip_set_hash_gen.h +2 -2
@@ -130,11 +130,11 @@ htable_size(u8 hbits) {size_t hsize; -/* We must fit both into u32 in jhash and size_t */ +/* We must fit both into u32 in jhash and INT_MAX in kvmalloc_node() */ if (hbits >31 )return 0 ; hsize =jhash_size (hbits); -if ((((size_t )-1 ) -sizeof (struct htable )) /sizeof (struct hbucket *) +if ((INT_MAX -sizeof (struct htable )) /sizeof (struct hbucket *) < hsize)return 0 ;
Greg Kroah-Hartman
maintainerPATCH 172/172 drivers: net: mhi: fix error path in mhi_net_newlink
In reply to Greg Kroah-HartmanFrom: Daniele Palmas <[email protected]>
commit 4526fe74c3c5095cc55931a3a6fb4932f9e06002 upstream.
Fix double free_netdev when mhi_prepare_for_transfer fails.
--- drivers/net/mhi/net.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/mhi/net.c +2 -4
@@ -337,7 +337,7 @@ static int mhi_net_newlink(void *ctxt, s/* Start MHI channels */ err =mhi_prepare_for_transfer (mhi_dev);if (err) - goto out_err; +return err;/* Number of transfer descriptors determines size of the queue */ mhi_netdev->rx_queue_sz =mhi_get_free_desc_count (mhi_dev,DMA_FROM_DEVICE );
@@ -347,7 +347,7 @@ static int mhi_net_newlink(void *ctxt, selse err =register_netdev (ndev);if (err) - goto out_err; +return err;if (mhi_netdev->proto) { err = mhi_netdev->proto->init (mhi_netdev);
@@ -359,8 +359,6 @@ static int mhi_net_newlink(void *ctxt, s out_err_proto:unregister_netdevice (ndev); -out_err: -free_netdev (ndev);return err; }
Greg Kroah-Hartman
maintainerPATCH 170/172 netfilter: conntrack: serialize hash resizes and cleanups
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit e9edc188fc76499b0b9bd60364084037f6d03773 upstream.
Syzbot was able to trigger the following warning [1]
No repro found by syzbot yet but I was able to trigger similar issue by having 2 scripts running in parallel, changing conntrack hash sizes, and:
for j in seq 1 1000 ; do unshare -n /bin/true >/dev/null ; done
It would take more than 5 minutes for net_namespace structures to be cleaned up.
This is because nf_ct_iterate_cleanup() has to restart everytime a resize happened.
By adding a mutex, we can serialize hash resizes and cleanups and also make get_next_corpse() faster by skipping over empty buckets.
Even without resizes in the picture, this patch considerably speeds up network namespace dismantles.
[1]
INFO: task syz-executor.0:8312 can't die for more than 144 seconds.
task:syz-executor.0 state:R running task stack:25672 pid: 8312 ppid: 6573 flags:0x00004006
Call Trace:
context_switch kernel/sched/core.c:4955 [inline]
__schedule+0x940/0x26f0 kernel/sched/core.c:6236
preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6408
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:35
__local_bh_enable_ip+0x109/0x120 kernel/softirq.c:390
local_bh_enable include/linux/bottom_half.h:32 [inline]
get_next_corpse net/netfilter/nf_conntrack_core.c:2252 [inline]
nf_ct_iterate_cleanup+0x15a/0x450 net/netfilter/nf_conntrack_core.c:2275
nf_conntrack_cleanup_net_list+0x14c/0x4f0 net/netfilter/nf_conntrack_core.c:2469
ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171
setup_net+0x639/0xa30 net/core/net_namespace.c:349
copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x445/0x920 kernel/fork.c:3128
__do_sys_unshare kernel/fork.c:3202 [inline]
__se_sys_unshare kernel/fork.c:3200 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3200
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f63da68e739
RSP: 002b:00007f63d7c05188 EFLAGS: 00000246 ORIG_RAX: 0000000000000110
RAX: ffffffffffffffda RBX: 00007f63da792f80 RCX: 00007f63da68e739
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000
RBP: 00007f63da6e8cc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f63da792f80
R13: 00007fff50b75d3f R14: 00007f63d7c05300 R15: 0000000000022000
Showing all locks held in the system:
1 lock held by khungtaskd/27:
#0: ffffffff8b980020 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6446
2 locks held by kworker/u4:2/153:
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline]
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:634 [inline]
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:661 [inline]
#0: ffff888010c69138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2268
#1: ffffc9000140fdb0 ((kfence_timer).work){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2272
1 lock held by systemd-udevd/2970:
1 lock held by in:imklog/6258:
#0: ffff88807f970ff0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:990
3 locks held by kworker/1:6/8158:
1 lock held by syz-executor.0/8312:
2 locks held by kworker/u4:13/9320:
1 lock held by syz-executor.5/10178:
1 lock held by syz-executor.4/10217:--- net/netfilter/nf_conntrack_core.c | 70 ++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 33 deletions(-)
net/netfilter/nf_conntrack_core.c +37 -33
@@ -75,6 +75,9 @@ static __read_mostly struct kmem_cache *static DEFINE_SPINLOCK (nf_conntrack_locks_all_lock);static __read_mostly bool nf_conntrack_locks_all; +/* serialize hash resizes and nf_ct_iterate_cleanup */ +static DEFINE_MUTEX (nf_conntrack_mutex); +#define GC_SCAN_INTERVAL (120u * HZ)#define GC_SCAN_MAX_DURATION msecs_to_jiffies(10)
@@ -2192,28 +2195,31 @@ get_next_corpse(int (*iter)(struct nf_cospinlock_t *lockp;for (; *bucket < nf_conntrack_htable_size; (*bucket)++) { +struct hlist_nulls_head *hslot = &nf_conntrack_hash[*bucket]; + +if (hlist_nulls_empty (hslot)) +continue ; + lockp = &nf_conntrack_locks[*bucket %CONNTRACK_LOCKS ];local_bh_disable ();nf_conntrack_lock (lockp); -if (*bucket < nf_conntrack_htable_size) { -hlist_nulls_for_each_entry (h, n, &nf_conntrack_hash[*bucket], hnnode) { -if (NF_CT_DIRECTION (h) !=IP_CT_DIR_REPLY ) -continue ; -/* All nf_conn objects are added to hash table twice, one -* for original direction tuple, once for the reply tuple. -* -* Exception: In the IPS_NAT_CLASH case, only the reply -* tuple is added (the original tuple already existed for -* a different object). -* -* We only need to call the iterator once for each -* conntrack, so we just use the 'reply' direction -* tuple while iterating. -*/ - ct =nf_ct_tuplehash_to_ctrack (h); -if (iter (ct, data)) - goto found; - } +hlist_nulls_for_each_entry (h, n, hslot, hnnode) { +if (NF_CT_DIRECTION (h) !=IP_CT_DIR_REPLY ) +continue ; +/* All nf_conn objects are added to hash table twice, one +* for original direction tuple, once for the reply tuple. +* +* Exception: In the IPS_NAT_CLASH case, only the reply +* tuple is added (the original tuple already existed for +* a different object). +* +* We only need to call the iterator once for each +* conntrack, so we just use the 'reply' direction +* tuple while iterating. +*/ + ct =nf_ct_tuplehash_to_ctrack (h); +if (iter (ct, data)) + goto found; }spin_unlock (lockp);local_bh_enable ();
@@ -2231,26 +2237,20 @@ found:static void nf_ct_iterate_cleanup (int (*iter)(struct nf_conn *i,void *data),void *data,u32 portid,int report) { -unsigned int bucket =0 , sequence; +unsigned int bucket =0 ;struct nf_conn *ct;might_sleep (); -for (;;) { - sequence =read_seqcount_begin (&nf_conntrack_generation); - -while ((ct =get_next_corpse (iter, data, &bucket)) !=NULL ) { -/* Time to push up daises... */ +mutex_lock (&nf_conntrack_mutex); +while ((ct =get_next_corpse (iter, data, &bucket)) !=NULL ) { +/* Time to push up daises... */ -nf_ct_delete (ct, portid, report); -nf_ct_put (ct); -cond_resched (); - } - -if (!read_seqcount_retry (&nf_conntrack_generation, sequence)) -break ; - bucket =0 ; +nf_ct_delete (ct, portid, report); +nf_ct_put (ct); +cond_resched (); } +mutex_unlock (&nf_conntrack_mutex); }struct iter_data {
@@ -2486,8 +2486,10 @@ int nf_conntrack_hash_resize(unsigned inif (!hash)return -ENOMEM ; +mutex_lock (&nf_conntrack_mutex); old_size = nf_conntrack_htable_size;if (old_size == hashsize) { +mutex_unlock (&nf_conntrack_mutex);kvfree (hash);return 0 ; }
@@ -2523,6 +2525,8 @@ int nf_conntrack_hash_resize(unsigned innf_conntrack_all_unlock ();local_bh_enable (); +mutex_unlock (&nf_conntrack_mutex); +synchronize_net ();kvfree (old_hash);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 168/172 net: mdiobus: Fix memory leak in __mdiobus_register
In reply to Greg Kroah-HartmanFrom: Yanfei Xu <[email protected]>
commit ab609f25d19858513919369ff3d9a63c02cd9e2e upstream.
Once device_register() failed, we should call put_device() to decrement reference count for cleanup. Or it will cause memory leak.
BUG: memory leak
unreferenced object 0xffff888114032e00 (size 256):
comm "kworker/1:3", pid 2960, jiffies 4294943572 (age 15.920s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 08 2e 03 14 81 88 ff ff ................
08 2e 03 14 81 88 ff ff 90 76 65 82 ff ff ff ff .........ve.....
backtrace:
[<ffffffff8265cfab>] kmalloc include/linux/slab.h:591 [inline]
[<ffffffff8265cfab>] kzalloc include/linux/slab.h:721 [inline]
[<ffffffff8265cfab>] device_private_init drivers/base/core.c:3203 [inline]
[<ffffffff8265cfab>] device_add+0x89b/0xdf0 drivers/base/core.c:3253
[<ffffffff828dd643>] __mdiobus_register+0xc3/0x450 drivers/net/phy/mdio_bus.c:537
[<ffffffff828cb835>] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87
[<ffffffff82b92a00>] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline]
[<ffffffff82b92a00>] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786
[<ffffffff82baa33f>] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745
[<ffffffff82c36e17>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82661d17>] call_driver_probe drivers/base/dd.c:517 [inline]
[<ffffffff82661d17>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
[<ffffffff826620bc>] really_probe drivers/base/dd.c:558 [inline]
[<ffffffff826620bc>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751
[<ffffffff826621ba>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781
[<ffffffff82662a26>] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898
[<ffffffff8265eca7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
[<ffffffff826625a2>] __device_attach+0x122/0x260 drivers/base/dd.c:969
[<ffffffff82660916>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487
[<ffffffff8265cd0b>] device_add+0x5fb/0xdf0 drivers/base/core.c:3359
[<ffffffff82c343b9>] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2170
[<ffffffff82c4473c>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
BUG: memory leak
unreferenced object 0xffff888116f06900 (size 32):
comm "kworker/0:2", pid 2670, jiffies 4294944448 (age 7.160s)
hex dump (first 32 bytes):
75 73 62 2d 30 30 31 3a 30 30 33 00 00 00 00 00 usb-001:003.....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff81484516>] kstrdup+0x36/0x70 mm/util.c:60
[<ffffffff814845a3>] kstrdup_const+0x53/0x80 mm/util.c:83
[<ffffffff82296ba2>] kvasprintf_const+0xc2/0x110 lib/kasprintf.c:48
[<ffffffff82358d4b>] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289
[<ffffffff826575f3>] dev_set_name+0x63/0x90 drivers/base/core.c:3147
[<ffffffff828dd63b>] __mdiobus_register+0xbb/0x450 drivers/net/phy/mdio_bus.c:535
[<ffffffff828cb835>] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87
[<ffffffff82b92a00>] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline]
[<ffffffff82b92a00>] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786
[<ffffffff82baa33f>] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745
[<ffffffff82c36e17>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82661d17>] call_driver_probe drivers/base/dd.c:517 [inline]
[<ffffffff82661d17>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
[<ffffffff826620bc>] really_probe drivers/base/dd.c:558 [inline]
[<ffffffff826620bc>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751
[<ffffffff826621ba>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781
[<ffffffff82662a26>] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898
[<ffffffff8265eca7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
[<ffffffff826625a2>] __device_attach+0x122/0x260 drivers/base/dd.c:969--- drivers/net/phy/mdio_bus.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/phy/mdio_bus.c +1 -0
@@ -541,6 +541,7 @@ int __mdiobus_register(struct mii_bus *b err =device_register (&bus->dev);if (err) {pr_err ("mii_bus %s failed to register\n" , bus->id); +put_device (&bus->dev);return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 169/172 KVM: x86: Handle SRCU initialization failure during page track init
In reply to Greg Kroah-HartmanFrom: Haimin Zhang <[email protected]>
commit eb7511bf9182292ef1df1082d23039e856d1ddfb upstream.
Check the return of init_srcu_struct(), which can fail due to OOM, when initializing the page track mechanism. Lack of checking leads to a NULL pointer deref found by a modified syzkaller.
Message-Id: <[email protected]>
--- arch/x86/include/asm/kvm_page_track.h | 2 +- arch/x86/kvm/mmu/page_track.c | 4 ++-- arch/x86/kvm/x86.c | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-)
arch/x86/include/asm/kvm_page_track.h +1 -1
@@ -46,7 +46,7 @@ struct kvm_page_track_notifier_node { struct kvm_page_track_notifier_node *node); }; -void kvm_page_track_init (struct kvm *kvm); +int kvm_page_track_init (struct kvm *kvm);void kvm_page_track_cleanup (struct kvm *kvm);void kvm_page_track_free_memslot (struct kvm_memory_slot *slot);
arch/x86/kvm/mmu/page_track.c +2 -2
@@ -163,13 +163,13 @@ void kvm_page_track_cleanup(struct kvm *cleanup_srcu_struct (&head->track_srcu); } -void kvm_page_track_init (struct kvm *kvm) +int kvm_page_track_init (struct kvm *kvm) {struct kvm_page_track_notifier_head *head; head = &kvm->arch.track_notifier_head; -init_srcu_struct (&head->track_srcu);INIT_HLIST_HEAD (&head->track_notifier_list); +return init_srcu_struct (&head->track_srcu); }/*
arch/x86/kvm/x86.c +6 -1
@@ -11093,9 +11093,15 @@ void kvm_arch_free_vm(struct kvm *kvm)int kvm_arch_init_vm (struct kvm *kvm,unsigned long type) { +int ret; +if (type)return -EINVAL ; + ret =kvm_page_track_init (kvm); +if (ret) +return ret; +INIT_HLIST_HEAD (&kvm->arch.mask_notifier_list);INIT_LIST_HEAD (&kvm->arch.active_mmu_pages);INIT_LIST_HEAD (&kvm->arch.zapped_obsolete_pages);
@@ -11128,7 +11134,6 @@ int kvm_arch_init_vm(struct kvm *kvm, unkvm_apicv_init (kvm);kvm_hv_init_vm (kvm); -kvm_page_track_init (kvm);kvm_mmu_init_vm (kvm);return static_call (kvm_x86_vm_init)(kvm);
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 10 lines · Pavel Machek
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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
Sorry, I replied to wrong email. We are not actually testing 5.14.
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.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
5.14.10-rc1 Successfully Compiled and booted on my Raspberry PI 4b (8g) (bcm2711)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.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 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels:
Similar to other comments., this commit:
net: mdiobus: Fix memory leak in __mdiobus_register
has since been reverted upstream. Thanks!
Signature · 1 line
Florian
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +0000. Anything received after that time might be too late.
Build results:
total: 154 pass: 154 fail: 0 Qemu test results: total: 480 pass: 480 fail: 0
Guenter
Quoted 6 lines · Guenter Roeck
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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.
Quoted 9 lines
Quoted 3 lines
Responses should be made by Wed, 06 Oct 2021 12:50:17 +0000. Anything received after that time might be too late.
Build results:
total: 154 pass: 154 fail: 0 Qemu test results: total: 480 pass: 480 fail: 0
I spoke too early. A large number of boot tests report the following warning tracebacks in this rc.
Guenter
====================================
WARNING: ip/134 still has locks held! 5.14.10-rc1-00173-gcda15f9c69e0 #1 Not tainted
------------------------------------
1 lock held by ip/134:
#0: c17acf0c (sk_lock-AF_INET){+.+.}-{0:0}, at: 0xc17c561c
stack backtrace: CPU: 0 PID: 134 Comm: ip Not tainted 5.14.10-rc1-00173-gcda15f9c69e0 #1 Call trace: [<(ptrval)>] dump_stack+0x34/0x48 [<(ptrval)>] debug_check_no_locks_held+0xc8/0xd0 [<(ptrval)>] do_exit+0x6a8/0xc2c [<(ptrval)>] do_group_exit+0x68/0x114 [<(ptrval)>] __wake_up_parent+0x0/0x34 [<(ptrval)>] _syscall_return+0x0/0x4
=========================
WARNING: held lock freed!
5.14.10-rc1-00173-gcda15f9c69e0 #1 Not tainted
-------------------------
ip/182 is freeing memory 9000000002400040-90000000024006bf, with a lock still held there! 9000000002400160 (sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x28/0x118 2 locks held by ip/182:
#0: 90000000036a0280 (&sb->s_type->i_mutex_key#4){+.+.}-{3:3}, at: __sock_release+0x34/0xd8 #1: 9000000002400160 (sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x28/0x118
stack backtrace:
CPU: 0 PID: 182 Comm: ip Not tainted 5.14.10-rc1-00173-gcda15f9c69e0 #1
Stack : 0000000000000000 0000000000000000 0000000000000008 627881c1d8d1d123
90000000021453c0 0000000000000000 90000000026cbb58 ffffffff80f3b950
ffffffff81088f80 0000000000000001 90000000026cb9a8 0000000000000000
0000000000000000 0000000000000010 ffffffff8071ee00 0000000000000000
0000000000000000 ffffffff81060000 0000000000000001 ffffffff80f3b950
9000000002ab2940 000000001000a4e0 000000007fe10f68 ffffffffffffffff
0000000000000000 0000000000000000 ffffffff807a51a0 0000000000052798
ffffffff81220000 90000000026c8000 90000000026cbb50 0000000000000000
ffffffff80c7b6f0 0000000000000000 90000000026cbc88 ffffffff8121e440
00000000000000b6 0000000000000000 ffffffff8010b304 627881c1d8d1d123
...
Call Trace:
[<ffffffff8010b304>] show_stack+0x3c/0x120
[<ffffffff80c7b6f0>] dump_stack_lvl+0xa0/0xec
[<ffffffff801a8228>] debug_check_no_locks_freed+0x168/0x1a0
[<ffffffff802d679c>] kmem_cache_free.part.0+0xf4/0x2b8
[<ffffffff809eb5d0>] __sk_destruct+0x150/0x230
[<ffffffff80b22094>] inet_release+0x4c/0x88
[<ffffffff809e2744>] __sock_release+0x44/0xd8
[<ffffffff809e27ec>] sock_close+0x14/0x28
[<ffffffff802e4d84>] __fput+0xac/0x2d8
[<ffffffff80163500>] task_work_run+0x90/0xf0
[<ffffffff8010a6e8>] do_notify_resume+0x348/0x360
[<ffffffff801039e8>] work_notifysig+0x10/0x18Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
Regression found on arm.
following kernel BUG reported on stable-rc linux-5.14.y while booting BeagleBoard X15 device.
metadata:
git branch: linux-5.14.y
git repo: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
git commit: cda15f9c69e08480d4308d0e5c62bd44324a9ff0
git describe: v5.14.9-173-gcda15f9c69e0
make_kernelversion: 5.14.10-rc1
kernel-config: https://builds.tuxbuild.com/1z2ozt5ntwqausJUkOMJ8zBgRqi/config
Kernel crash:
--------------
[ 6.457366] kernel BUG at kernel/cpu.c:1065! [ 6.461669] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 6.466827] Modules linked in: [ 6.469909] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.14.10-rc1 #1 [ 6.476318] Hardware name: Generic DRA74X (Flattened Device Tree) [ 6.482452] PC is at cpuhp_report_idle_dead+0x74/0x78 [ 6.487518] LR is at do_idle+0x108/0x310 [ 6.491485] pc : [<c035a700>] lr : [<c03a3cc0>] psr: 20000093 [ 6.497772] sp : c2101ee0 ip : c2101f00 fp : c2101efc [ 6.503051] r10: 00000000 r9 : c2100000 r8 : 00000000 [ 6.508300] r7 : c2108fe4 r6 : eeb04414 r5 : 2ca71000 r4 : c2093414 [ 6.514862] r3 : c2101ee0 r2 : 00000000 r1 : 000000e0 r0 : 00000000 [ 6.521423] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 6.528686] Control: 10c5387d Table: 8020406a DAC: 00000051 [ 6.534454] Register r0 information: NULL pointer [ 6.539215] Register r1 information: non-paged memory [ 6.544281] Register r2 information: NULL pointer [ 6.549011] Register r3 information: non-slab/vmalloc memory [ 6.554718] Register r4 information: non-slab/vmalloc memory [ 6.560424] Register r5 information: non-paged memory [ 6.565490] Register r6 information: non-slab/vmalloc memory [ 6.571197] Register r7 information: non-slab/vmalloc memory [ 6.576904] Register r8 information: NULL pointer [ 6.581634] Register r9 information: non-slab/vmalloc memory [ 6.587310] Register r10 information: NULL pointer [ 6.592132] Register r11 information: non-slab/vmalloc memory [ 6.597930] Register r12 information: non-slab/vmalloc memory [ 6.603698] Process swapper/0 (pid: 0, stack limit = 0x(ptrval)) [ 6.609741] Stack: (0xc2101ee0 to 0xc2102000) [ 6.614135] 1ee0: 00000000 c2100000 c2108f90 c2108fe4 c2101f44 c2101f00 c03a3cc0 c035a698 [ 6.622375] 1f00: c210e0c0 00000002 c2101f00 c209f0f0 c2100000 5a76ee47 c2101f3c 000000e0 [ 6.630584] 1f20: c2101f58 00000002 c2108f40 00000000 c2100000 10c5387d c2101f54 c2101f48 [ 6.638824] 1f40: c03a4334 c03a3bc4 c2101f84 c2101f58 c1556b84 c03a4318 00000000 00000000 [ 6.647033] 1f60: c1556a88 c2101f70 c0322004 c239e068 c1fd7a80 ffffffff c2101f94 c2101f88 [ 6.655273] 1f80: c1f00af0 c15569c0 c2101ff4 c2101f98 c1f012a0 c1f00ae4 ffffffff ffffffff [ 6.663482] 1fa0: 00000000 c1f00640 00000000 00000000 00000000 00000000 00000000 c1fd7a80 [ 6.671722] 1fc0: 5a73e04d 00000000 00000000 c1f00330 00000051 10c0387d 00000000 8ffda000 [ 6.679931] 1fe0: 412fc0f2 10c5387d 00000000 c2101ff8 00000000 c1f00b78 00000000 00000000 [ 6.688140] Backtrace: [ 6.690612] [<c035a68c>] (cpuhp_report_idle_dead) from [<c03a3cc0>] (do_idle+0x108/0x310) [ 6.698852] r7:c2108fe4 r6:c2108f90 r5:c2100000 r4:00000000 [ 6.704559] [<c03a3bb8>] (do_idle) from [<c03a4334>] (cpu_startup_entry+0x28/0x2c) [ 6.712188] r10:10c5387d r9:c2100000 r8:00000000 r7:c2108f40 r6:00000002 r5:c2101f58 [ 6.720031] r4:000000e0 [ 6.722595] [<c03a430c>] (cpu_startup_entry) from [<c1556b84>] (rest_init+0x1d0/0x2fc) [ 6.730560] [<c15569b4>] (rest_init) from [<c1f00af0>] (arch_call_rest_init+0x18/0x1c) [ 6.738555] r6:ffffffff r5:c1fd7a80 r4:c239e068 [ 6.743194] [<c1f00ad8>] (arch_call_rest_init) from [<c1f012a0>] (start_kernel+0x734/0x780) [ 6.751586] [<c1f00b6c>] (start_kernel) from [<00000000>] (0x0) [ 6.757568] r10:10c5387d r9:412fc0f2 r8:8ffda000 r7:00000000 r6:10c0387d r5:00000051 [ 6.765441] r4:c1f00330 [ 6.767974] Code: e34c1035 e3a03000 eb039b62 e89da8f0 (e7f001f2) [ 6.774108] ---[ end trace 8e1c46209559ca84 ]---
ref:
https://lkft.validation.linaro.org/scheduler/job/3659621#L2841
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
Regression found on i386 and x86.
following kernel warning reported on stable-rc linux-5.14.y while booting x86.
metadata:
git branch: linux-5.14.y
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git commit: cda15f9c69e08480d4308d0e5c62bd44324a9ff0
git describe: v5.14.9-173-gcda15f9c69e0
make_kernelversion: 5.14.10-rc1
kernel-config:
http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/intel-corei7-64/lkft/linux-stable-rc-5.14/36/config
Kernel crash:
--------------
[ 22.356755] =========================
[ 22.360414] WARNING: held lock freed!
[ 22.364071] 5.14.10-rc1 #1 Not tainted
[ 22.367824] -------------------------
[ 22.371489] systemd-network/341 is freeing memory
ffff9d21cbea0000-ffff9d21cbea06bf, with a lock still held there!
[ 22.381828] ffff9d21cbea0120 (sk_lock-AF_INET){+.+.}-{0:0}, at:
sk_common_release+0x21/0x100
[ 22.384624] igb 0000:02:00.0 eno2: renamed from eth1
[ 22.390260] 2 locks held by systemd-network/341:
[ 22.390261] #0: ffff9d21c406eb10
(&sb->s_type->i_mutex_key#6){+.+.}-{3:3}, at: __sock_release+0x32/0xc0
[ 22.390267] #1: ffff9d21cbea0120 (sk_lock-AF_INET){+.+.}-{0:0},
at: sk_common_release+0x21/0x100
[ 22.390272]
[ 22.390272] stack backtrace:
[ 22.390273] CPU: 2 PID: 341 Comm: systemd-network Not tainted 5.14.10-rc1 #1
[ 22.390275] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS
2.0b 07/27/2017
[ 22.390276] Call Trace:
[ 22.390278] dump_stack_lvl+0x49/0x5e
[ 22.390281] dump_stack+0x10/0x12
[ 22.390283] debug_check_no_locks_freed+0x111/0x120
[ 22.390286] slab_free_freelist_hook+0x119/0x1d0
[ 22.390289] kmem_cache_free+0x102/0x540
[ 22.390291] ? __sk_destruct+0x145/0x210
[ 22.390294] __sk_destruct+0x145/0x210
[ 22.390296] sk_destruct+0x48/0x50
[ 22.409489] ata_id (348) used greatest stack depth: 11952 bytes left
[ 22.418194] __sk_free+0x2f/0xc0
[ 22.418198] sk_free+0x26/0x40
[ 22.418200] sk_common_release+0xa9/0x100
[ 22.487567] udp_lib_close+0x9/0x10
[ 22.491057] inet_release+0x44/0x80
[ 22.494542] __sock_release+0x42/0xc0
[ 22.498209] sock_close+0x18/0x20
[ 22.501525] __fput+0xb5/0x260
[ 22.504578] ____fput+0xe/0x10
[ 22.507636] task_work_run+0x6f/0xc0
[ 22.511216] exit_to_user_mode_prepare+0x1f6/0x200
[ 22.515999] syscall_exit_to_user_mode+0x1d/0x50
[ 22.520610] do_syscall_64+0x67/0x80
[ 22.524190] ? irqentry_exit+0x75/0x80
[ 22.527940] ? exc_page_fault+0x6c/0x200
[ 22.531859] ? asm_exc_page_fault+0x8/0x30
[ 22.535950] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 22.541002] RIP: 0033:0x7f52fe67e641
[ 22.544580] Code: f7 d8 64 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f
1f 84 00 00 00 00 00 66 90 8b 05 aa cd 20 00 85 c0 75 16 b8 03 00 00
00 0f 05 <48> 3d 00 f0 ff ff 77 3f c3 66 0f 1f 44 00 00 53 89 fb 48 83
ec 10
[ 22.563318] RSP: 002b:00007ffe31761878 EFLAGS: 00000246 ORIG_RAX:
0000000000000003
[ 22.570884] RAX: 0000000000000000 RBX: 0000000000000010 RCX: 00007f52fe67e641
[ 22.578007] RDX: 00000000000073b0 RSI: 0000000000000000 RDI: 0000000000000010
[ 22.585130] RBP: 00007f52feed8338 R08: 000055893cf103c3 R09: 0000000000000078
[ 22.592253] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
[ 22.599379] R13: 00007ffe317618c0 R14: 0000000000000000 R15: 00007ffe31762a60ref:
https://lkft.validation.linaro.org/scheduler/job/3658919#L1477
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 95 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
Regression found on i386 and x86.
following kernel warning reported on stable-rc linux-5.14.y while booting x86.metadata:
git branch: linux-5.14.y
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git commit:cda15f9c69e08480d4308d0e5c62bd44324a9ff0
git describe: v5.14.9-173-gcda15f9c69e0
make_kernelversion: 5.14.10-rc1
kernel-config:
http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/intel-corei7-64/lkft/linux-stable-rc-5.14/36/configKernel crash:
--------------[ 22.356755] ========================= [ 22.360414] WARNING: held lock freed! [ 22.364071] 5.14.10-rc1 #1 Not tainted [ 22.367824] ------------------------- [ 22.371489] systemd-network/341 is freeing memory ffff9d21cbea0000-ffff9d21cbea06bf, with a lock still held there! [ 22.381828] ffff9d21cbea0120 (sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x21/0x100 [ 22.384624] igb 0000:02:00.0 eno2: renamed from eth1 [ 22.390260] 2 locks held by systemd-network/341: [ 22.390261] #0: ffff9d21c406eb10 (&sb->s_type->i_mutex_key#6){+.+.}-{3:3}, at: __sock_release+0x32/0xc0 [ 22.390267] #1: ffff9d21cbea0120 (sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x21/0x100 [ 22.390272] [ 22.390272] stack backtrace: [ 22.390273] CPU: 2 PID: 341 Comm: systemd-network Not tainted 5.14.10-rc1 #1 [ 22.390275] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS 2.0b 07/27/2017 [ 22.390276] Call Trace: [ 22.390278] dump_stack_lvl+0x49/0x5e [ 22.390281] dump_stack+0x10/0x12 [ 22.390283] debug_check_no_locks_freed+0x111/0x120 [ 22.390286] slab_free_freelist_hook+0x119/0x1d0 [ 22.390289] kmem_cache_free+0x102/0x540 [ 22.390291] ? __sk_destruct+0x145/0x210 [ 22.390294] __sk_destruct+0x145/0x210 [ 22.390296] sk_destruct+0x48/0x50 [ 22.409489] ata_id (348) used greatest stack depth: 11952 bytes left [ 22.418194] __sk_free+0x2f/0xc0 [ 22.418198] sk_free+0x26/0x40 [ 22.418200] sk_common_release+0xa9/0x100 [ 22.487567] udp_lib_close+0x9/0x10 [ 22.491057] inet_release+0x44/0x80 [ 22.494542] __sock_release+0x42/0xc0 [ 22.498209] sock_close+0x18/0x20 [ 22.501525] __fput+0xb5/0x260 [ 22.504578] ____fput+0xe/0x10 [ 22.507636] task_work_run+0x6f/0xc0 [ 22.511216] exit_to_user_mode_prepare+0x1f6/0x200 [ 22.515999] syscall_exit_to_user_mode+0x1d/0x50 [ 22.520610] do_syscall_64+0x67/0x80 [ 22.524190] ? irqentry_exit+0x75/0x80 [ 22.527940] ? exc_page_fault+0x6c/0x200 [ 22.531859] ? asm_exc_page_fault+0x8/0x30 [ 22.535950] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 22.541002] RIP: 0033:0x7f52fe67e641 [ 22.544580] Code: f7 d8 64 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 8b 05 aa cd 20 00 85 c0 75 16 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3f c3 66 0f 1f 44 00 00 53 89 fb 48 83 ec 10 [ 22.563318] RSP: 002b:00007ffe31761878 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 [ 22.570884] RAX: 0000000000000000 RBX: 0000000000000010 RCX: 00007f52fe67e641 [ 22.578007] RDX: 00000000000073b0 RSI: 0000000000000000 RDI: 0000000000000010 [ 22.585130] RBP: 00007f52feed8338 R08: 000055893cf103c3 R09: 0000000000000078 [ 22.592253] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 [ 22.599379] R13: 00007ffe317618c0 R14: 0000000000000000 R15: 00007ffe31762a60
Quoted 8 lines
ref:
https://lkft.validation.linaro.org/scheduler/job/3658919#L1477Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Any chance at bisection?
Greg Kroah-Hartman
maintainerQuoted 107 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.14.10 release. There are 172 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 Wed, 06 Oct 2021 12:50:17 +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.14.10-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.14.y
and the diffstat can be found below.thanks,
greg k-h
Regression found on arm.
following kernel BUG reported on stable-rc linux-5.14.y while booting BeagleBoard X15 device.metadata:
git branch: linux-5.14.y
git repo: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
git commit:cda15f9c69e08480d4308d0e5c62bd44324a9ff0
git describe: v5.14.9-173-gcda15f9c69e0
make_kernelversion: 5.14.10-rc1
kernel-config: https://builds.tuxbuild.com/1z2ozt5ntwqausJUkOMJ8zBgRqi/configKernel crash:
--------------[ 6.457366] kernel BUG at kernel/cpu.c:1065! [ 6.461669] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 6.466827] Modules linked in: [ 6.469909] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.14.10-rc1 #1 [ 6.476318] Hardware name: Generic DRA74X (Flattened Device Tree) [ 6.482452] PC is at cpuhp_report_idle_dead+0x74/0x78 [ 6.487518] LR is at do_idle+0x108/0x310 [ 6.491485] pc : [<c035a700>] lr : [<c03a3cc0>] psr: 20000093 [ 6.497772] sp : c2101ee0 ip : c2101f00 fp : c2101efc [ 6.503051] r10: 00000000 r9 : c2100000 r8 : 00000000 [ 6.508300] r7 : c2108fe4 r6 : eeb04414 r5 : 2ca71000 r4 : c2093414 [ 6.514862] r3 : c2101ee0 r2 : 00000000 r1 : 000000e0 r0 : 00000000 [ 6.521423] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 6.528686] Control: 10c5387d Table: 8020406a DAC: 00000051 [ 6.534454] Register r0 information: NULL pointer [ 6.539215] Register r1 information: non-paged memory [ 6.544281] Register r2 information: NULL pointer [ 6.549011] Register r3 information: non-slab/vmalloc memory [ 6.554718] Register r4 information: non-slab/vmalloc memory [ 6.560424] Register r5 information: non-paged memory [ 6.565490] Register r6 information: non-slab/vmalloc memory [ 6.571197] Register r7 information: non-slab/vmalloc memory [ 6.576904] Register r8 information: NULL pointer [ 6.581634] Register r9 information: non-slab/vmalloc memory [ 6.587310] Register r10 information: NULL pointer [ 6.592132] Register r11 information: non-slab/vmalloc memory [ 6.597930] Register r12 information: non-slab/vmalloc memory [ 6.603698] Process swapper/0 (pid: 0, stack limit = 0x(ptrval)) [ 6.609741] Stack: (0xc2101ee0 to 0xc2102000) [ 6.614135] 1ee0: 00000000 c2100000 c2108f90 c2108fe4 c2101f44 c2101f00 c03a3cc0 c035a698 [ 6.622375] 1f00: c210e0c0 00000002 c2101f00 c209f0f0 c2100000 5a76ee47 c2101f3c 000000e0 [ 6.630584] 1f20: c2101f58 00000002 c2108f40 00000000 c2100000 10c5387d c2101f54 c2101f48 [ 6.638824] 1f40: c03a4334 c03a3bc4 c2101f84 c2101f58 c1556b84 c03a4318 00000000 00000000 [ 6.647033] 1f60: c1556a88 c2101f70 c0322004 c239e068 c1fd7a80 ffffffff c2101f94 c2101f88 [ 6.655273] 1f80: c1f00af0 c15569c0 c2101ff4 c2101f98 c1f012a0 c1f00ae4 ffffffff ffffffff [ 6.663482] 1fa0: 00000000 c1f00640 00000000 00000000 00000000 00000000 00000000 c1fd7a80 [ 6.671722] 1fc0: 5a73e04d 00000000 00000000 c1f00330 00000051 10c0387d 00000000 8ffda000 [ 6.679931] 1fe0: 412fc0f2 10c5387d 00000000 c2101ff8 00000000 c1f00b78 00000000 00000000 [ 6.688140] Backtrace: [ 6.690612] [<c035a68c>] (cpuhp_report_idle_dead) from [<c03a3cc0>] (do_idle+0x108/0x310) [ 6.698852] r7:c2108fe4 r6:c2108f90 r5:c2100000 r4:00000000 [ 6.704559] [<c03a3bb8>] (do_idle) from [<c03a4334>] (cpu_startup_entry+0x28/0x2c) [ 6.712188] r10:10c5387d r9:c2100000 r8:00000000 r7:c2108f40 r6:00000002 r5:c2101f58 [ 6.720031] r4:000000e0 [ 6.722595] [<c03a430c>] (cpu_startup_entry) from [<c1556b84>] (rest_init+0x1d0/0x2fc) [ 6.730560] [<c15569b4>] (rest_init) from [<c1f00af0>] (arch_call_rest_init+0x18/0x1c) [ 6.738555] r6:ffffffff r5:c1fd7a80 r4:c239e068 [ 6.743194] [<c1f00ad8>] (arch_call_rest_init) from [<c1f012a0>] (start_kernel+0x734/0x780) [ 6.751586] [<c1f00b6c>] (start_kernel) from [<00000000>] (0x0) [ 6.757568] r10:10c5387d r9:412fc0f2 r8:8ffda000 r7:00000000 r6:10c0387d r5:00000051 [ 6.765441] r4:c1f00330 [ 6.767974] Code: e34c1035 e3a03000 eb039b62 e89da8f0 (e7f001f2) [ 6.774108] ---[ end trace 8e1c46209559ca84 ]---
Quoted 8 lines
ref:
https://lkft.validation.linaro.org/scheduler/job/3659621#L2841Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Any chance at bisection?