Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jjj #241

Closed
wants to merge 1 commit into from
Closed

jjj #241

wants to merge 1 commit into from

Conversation

barisvelioglu
Copy link

jj

jjj
jj
0day-ci pushed a commit to 0day-ci/linux that referenced this pull request Aug 22, 2016
When shutting down a session I'm seeing this hung_task message:

INFO: task kworker/u128:0:6 blocked for more than 480 seconds.
      Tainted: G            E   N  4.4.17-default+ torvalds#241
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kworker/u128:0  D ffff880237615c00     0     6      2 0x00000000
 Workqueue: fc_rport_eq fc_rport_work [libfc]
 ffff88017edd7c48 ffffffff81c11500 ffff88017edd0180 ffff88017edd8000
 ffff88035b6860a8 ffff88017edd0180 ffff88036461eac0 0000000000000000
 ffff88017edd7c60 ffffffff815db4d5 7fffffffffffffff ffff88017edd7d10
Call Trace:
 [<ffffffff815db4d5>] schedule+0x35/0x80
 [<ffffffff815dde17>] schedule_timeout+0x237/0x2d0
 [<ffffffff815dc6e3>] wait_for_completion+0xa3/0x110
 [<ffffffffa0869fb5>] target_wait_for_sess_cmds+0x45/0x190 [target_core_mod]
 [<ffffffffa03953b4>] ft_close_sess+0x24/0x30 [tcm_fc]
 [<ffffffffa03955ba>] ft_prlo+0x8a/0x95 [tcm_fc]
 [<ffffffffa066fc28>] fc_rport_work+0x3b8/0x7c0 [libfc]
 [<ffffffff810939ee>] process_one_work+0x14e/0x410
 [<ffffffff81094246>] worker_thread+0x116/0x490

Looking at the code it looks as if there is some confusion about
when to call 'wait_for_completion(&cmd->cmd_wait_comp).
The problem is that there are _two_ sections where the code
waits for 'cmd_wait_comp' completion, but the completion
is only called with 'complete', not 'complete_all'.
So we cannot have both waiting for it, doing so will lead
to a stuck wait_for_completion.

Signed-off-by: Hannes Reinecke <hare@suse.com>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Oct 31, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 8, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 9, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 9, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 25, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 30, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Dec 2, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Dec 8, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Dec 8, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Dec 10, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
masahir0y pushed a commit to masahir0y/linux that referenced this pull request Dec 12, 2016
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
laijs pushed a commit to laijs/linux that referenced this pull request Feb 13, 2017
add support for adding/removing virtio devices during runtime
keryell pushed a commit to keryell/linux that referenced this pull request Feb 27, 2017
WARNING: line over 80 characters
torvalds#241: FILE: ipc/sem.c:815:
+				semop_completed |= wake_const_ops(sma, num, wake_q);

WARNING: line over 80 characters
torvalds#250: FILE: ipc/sem.c:826:
+				semop_completed |= wake_const_ops(sma, i, wake_q);

WARNING: line over 80 characters
torvalds#282: FILE: ipc/sem.c:857:
+static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q)

WARNING: line over 80 characters
torvalds#344: FILE: ipc/sem.c:973:
+							      sops[i].sem_num, wake_q);

WARNING: Missing a blank line after declarations
torvalds#405: FILE: ipc/sem.c:1242:
+	int err, val;
+	WAKE_Q(wake_q);

WARNING: line over 80 characters
torvalds#570: FILE: ipc/sem.c:1920:
+	 * We _do_ care, nonetheless, about being awoken by a signal or spuriously.

total: 0 errors, 6 warnings, 567 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/ipc-sem-rework-task-wakeups.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
pull bot referenced this pull request in lokeshbv/linux Jan 12, 2019
If the driver is unable to create a subset of IO queues for any reason,
the read/write and polled queue sets will not match the actual allocated
hardware contexts. This leaves gaps in the CPU affinity mappings and
causes the following kernel panic after blk_mq_map_queue_type() returns
a NULL hctx.

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000198
  #PF error: [normal kernel read fault]
  PGD 0 P4D 0
  Oops: 0000 [#1] SMP
  CPU: 64 PID: 1171 Comm: kworker/u259:1 Not tainted 4.20.0+ #241
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
  Workqueue: nvme-wq nvme_scan_work [nvme_core]
  RIP: 0010:blk_mq_init_allocated_queue+0x2d9/0x440
  RSP: 0018:ffffb1bf0abc3cd0 EFLAGS: 00010286
  RAX: 000000000000001f RBX: ffff8ea744cf0718 RCX: 0000000000000000
  RDX: 0000000000000002 RSI: 000000000000007c RDI: ffffffff9109a820
  RBP: ffff8ea7565f7008 R08: 000000000000001f R09: 000000000000003f
  R10: ffffb1bf0abc3c00 R11: 0000000000000000 R12: 000000000001d008
  R13: ffff8ea7565f7008 R14: 000000000000003f R15: 0000000000000001
  FS:  0000000000000000(0000) GS:ffff8ea757200000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000198 CR3: 0000000013058000 CR4: 00000000000006e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   blk_mq_init_queue+0x35/0x60
   nvme_validate_ns+0xc6/0x7c0 [nvme_core]
   ? nvme_identify_ctrl.isra.56+0x7e/0xc0 [nvme_core]
   nvme_scan_work+0xc8/0x340 [nvme_core]
   ? __wake_up_common+0x6d/0x120
   ? try_to_wake_up+0x55/0x410
   process_one_work+0x1e9/0x3d0
   worker_thread+0x2d/0x3d0
   ? process_one_work+0x3d0/0x3d0
   kthread+0x111/0x130
   ? kthread_park+0x90/0x90
   ret_from_fork+0x1f/0x30
  Modules linked in: nvme nvme_core serio_raw
  CR2: 0000000000000198

Fix by re-running the interrupt vector setup from scratch using a reduced
count that may be successful until the created queues matches the irq
affinity plus polling queue sets.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
brauner pushed a commit to brauner/linux1 that referenced this pull request Jan 23, 2019
If the driver is unable to create a subset of IO queues for any reason,
the read/write and polled queue sets will not match the actual allocated
hardware contexts. This leaves gaps in the CPU affinity mappings and
causes the following kernel panic after blk_mq_map_queue_type() returns
a NULL hctx.

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000198
  #PF error: [normal kernel read fault]
  PGD 0 P4D 0
  Oops: 0000 [#1] SMP
  CPU: 64 PID: 1171 Comm: kworker/u259:1 Not tainted 4.20.0+ torvalds#241
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
  Workqueue: nvme-wq nvme_scan_work [nvme_core]
  RIP: 0010:blk_mq_init_allocated_queue+0x2d9/0x440
  RSP: 0018:ffffb1bf0abc3cd0 EFLAGS: 00010286
  RAX: 000000000000001f RBX: ffff8ea744cf0718 RCX: 0000000000000000
  RDX: 0000000000000002 RSI: 000000000000007c RDI: ffffffff9109a820
  RBP: ffff8ea7565f7008 R08: 000000000000001f R09: 000000000000003f
  R10: ffffb1bf0abc3c00 R11: 0000000000000000 R12: 000000000001d008
  R13: ffff8ea7565f7008 R14: 000000000000003f R15: 0000000000000001
  FS:  0000000000000000(0000) GS:ffff8ea757200000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000198 CR3: 0000000013058000 CR4: 00000000000006e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   blk_mq_init_queue+0x35/0x60
   nvme_validate_ns+0xc6/0x7c0 [nvme_core]
   ? nvme_identify_ctrl.isra.56+0x7e/0xc0 [nvme_core]
   nvme_scan_work+0xc8/0x340 [nvme_core]
   ? __wake_up_common+0x6d/0x120
   ? try_to_wake_up+0x55/0x410
   process_one_work+0x1e9/0x3d0
   worker_thread+0x2d/0x3d0
   ? process_one_work+0x3d0/0x3d0
   kthread+0x111/0x130
   ? kthread_park+0x90/0x90
   ret_from_fork+0x1f/0x30
  Modules linked in: nvme nvme_core serio_raw
  CR2: 0000000000000198

Fix by re-running the interrupt vector setup from scratch using a reduced
count that may be successful until the created queues matches the irq
affinity plus polling queue sets.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
krzk pushed a commit to krzk/linux that referenced this pull request Feb 21, 2019
If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

The following checkpatch exceptions are also fixed:

CHECK: No space is necessary after a cast
torvalds#211: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:109:
+                                             (u8 *) (&rfstate));

CHECK: No space is necessary after a cast
torvalds#241: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:277:
+                               ptmp_byte = (u8 *) (&regtoset) + index;

Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Mar 6, 2019
If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

The following checkpatch exceptions are also fixed:

CHECK: No space is necessary after a cast
torvalds#211: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:109:
+                                             (u8 *) (&rfstate));

CHECK: No space is necessary after a cast
torvalds#241: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:277:
+                               ptmp_byte = (u8 *) (&regtoset) + index;

Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
ndreys pushed a commit to ndreys/linux that referenced this pull request Mar 12, 2019
If the driver is unable to create a subset of IO queues for any reason,
the read/write and polled queue sets will not match the actual allocated
hardware contexts. This leaves gaps in the CPU affinity mappings and
causes the following kernel panic after blk_mq_map_queue_type() returns
a NULL hctx.

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000198
  #PF error: [normal kernel read fault]
  PGD 0 P4D 0
  Oops: 0000 [lunn#1] SMP
  CPU: 64 PID: 1171 Comm: kworker/u259:1 Not tainted 4.20.0+ torvalds#241
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
  Workqueue: nvme-wq nvme_scan_work [nvme_core]
  RIP: 0010:blk_mq_init_allocated_queue+0x2d9/0x440
  RSP: 0018:ffffb1bf0abc3cd0 EFLAGS: 00010286
  RAX: 000000000000001f RBX: ffff8ea744cf0718 RCX: 0000000000000000
  RDX: 0000000000000002 RSI: 000000000000007c RDI: ffffffff9109a820
  RBP: ffff8ea7565f7008 R08: 000000000000001f R09: 000000000000003f
  R10: ffffb1bf0abc3c00 R11: 0000000000000000 R12: 000000000001d008
  R13: ffff8ea7565f7008 R14: 000000000000003f R15: 0000000000000001
  FS:  0000000000000000(0000) GS:ffff8ea757200000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000198 CR3: 0000000013058000 CR4: 00000000000006e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   blk_mq_init_queue+0x35/0x60
   nvme_validate_ns+0xc6/0x7c0 [nvme_core]
   ? nvme_identify_ctrl.isra.56+0x7e/0xc0 [nvme_core]
   nvme_scan_work+0xc8/0x340 [nvme_core]
   ? __wake_up_common+0x6d/0x120
   ? try_to_wake_up+0x55/0x410
   process_one_work+0x1e9/0x3d0
   worker_thread+0x2d/0x3d0
   ? process_one_work+0x3d0/0x3d0
   kthread+0x111/0x130
   ? kthread_park+0x90/0x90
   ret_from_fork+0x1f/0x30
  Modules linked in: nvme nvme_core serio_raw
  CR2: 0000000000000198

Fix by re-running the interrupt vector setup from scratch using a reduced
count that may be successful until the created queues matches the irq
affinity plus polling queue sets.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Jun 3, 2020
In previous patch, using return -EBUSY in really_probe() instead WARN_ON()
only. The following is the partial code.

	...
	atomic_inc(&probe_count);
	pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
		 drv->bus->name, __func__, drv->name, dev_name(dev));
	if (!list_empty(&dev->devres_head)) {
		dev_crit(dev, "Resources present before probing\n");
		return -EBUSY;
	}
	...

When the devres_head is not empty, this code will return -EBUSY to prevent
resource conflict, but it forgot to balance probe_count. We can move the
increasement code below the resource checking.

	...
	pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
		 drv->bus->name, __func__, drv->name, dev_name(dev));
	if (!list_empty(&dev->devres_head)) {
		dev_crit(dev, "Resources present before probing\n");
		return -EBUSY;
	}
	atomic_inc(&probe_count);
	...

The original code will cause lots motherboard freeze in reboot/shutdown
with systemd message "Reached target Reboot" or "Reached target Shutdown"
with serial8250 platform driver. e.g. AOPEN DE6200. The conflict boot
dmesg below:

	Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
	00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 921600) is a 16550A
	00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 921600) is a 16550A
	00:05: ttyS2 at I/O 0x3e8 (irq = 5, base_baud = 921600) is a 16550A
	serial8250: ttyS3 at I/O 0x2e8 (irq = 3, base_baud = 921600) is a 16550A

Reboot/Shutdown will freeze in wait_for_device_probe(), message as
following:
	INFQ: task systemd-shutdown: 1 blocked for more than 120 seconds.
	Not tainted 5.7.0-rc7-tty-next+ torvalds#241
	"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
	Call Trace:
	  __schedule+0x3d2/0x700
	  ? printk+0x52/0x6e
	  schedule+0x4f/0xc0
	  wait_for_device_probe+0xbb/0xl40
	  ? wait_woken+0x80/0x80
	  device_shutdown+0xl5/0xle0
	  kernel_power_off+0x35/0x70
	  __do_sys_reboot+0xla0/0x220
	  ? do_sigtimedwait+0xld0/0x210
	  ? do.writev+0x6a/0xll0
	  ? do.writev+0x6a/0xll0
	  ? sigprocmask+0x6f/Oxa0
	  __64_sys_reboot+0xle/0x20
	  do_syscall_64+0x57/0xlb0

Fixes: 7c35e69 ("driver core: Print device when resources present in really_probe()")
Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Mar 12, 2021
This commit fixes the following checkpatch.pl warnings:

    WARNING: do not add new typedefs
    torvalds#118: FILE: include/rtw_mlme_ext.h:118:
    +typedef enum _RT_CHANNEL_DOMAIN {

    WARNING: do not add new typedefs
    torvalds#186: FILE: include/rtw_mlme_ext.h:186:
    +typedef enum _RT_CHANNEL_DOMAIN_2G {

    WARNING: do not add new typedefs
    torvalds#198: FILE: include/rtw_mlme_ext.h:198:
    +typedef enum _RT_CHANNEL_DOMAIN_5G {

    WARNING: do not add new typedefs
    torvalds#241: FILE: include/rtw_mlme_ext.h:241:
    +typedef struct _RT_CHANNEL_PLAN {

    WARNING: do not add new typedefs
    torvalds#246: FILE: include/rtw_mlme_ext.h:246:
    +typedef struct _RT_CHANNEL_PLAN_2G {

    WARNING: do not add new typedefs
    torvalds#251: FILE: include/rtw_mlme_ext.h:251:
    +typedef struct _RT_CHANNEL_PLAN_5G {

    WARNING: do not add new typedefs
    torvalds#256: FILE: include/rtw_mlme_ext.h:256:
    +typedef struct _RT_CHANNEL_PLAN_MAP {

    WARNING: do not add new typedefs
    torvalds#273: FILE: include/rtw_mlme_ext.h:273:
    +typedef enum _HT_IOT_PEER {

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Mar 13, 2021
This commit fixes the following checkpatch.pl warnings:

    WARNING: do not add new typedefs
    torvalds#118: FILE: include/rtw_mlme_ext.h:118:
    +typedef enum _RT_CHANNEL_DOMAIN {

    WARNING: do not add new typedefs
    torvalds#186: FILE: include/rtw_mlme_ext.h:186:
    +typedef enum _RT_CHANNEL_DOMAIN_2G {

    WARNING: do not add new typedefs
    torvalds#198: FILE: include/rtw_mlme_ext.h:198:
    +typedef enum _RT_CHANNEL_DOMAIN_5G {

    WARNING: do not add new typedefs
    torvalds#241: FILE: include/rtw_mlme_ext.h:241:
    +typedef struct _RT_CHANNEL_PLAN {

    WARNING: do not add new typedefs
    torvalds#246: FILE: include/rtw_mlme_ext.h:246:
    +typedef struct _RT_CHANNEL_PLAN_2G {

    WARNING: do not add new typedefs
    torvalds#251: FILE: include/rtw_mlme_ext.h:251:
    +typedef struct _RT_CHANNEL_PLAN_5G {

    WARNING: do not add new typedefs
    torvalds#256: FILE: include/rtw_mlme_ext.h:256:
    +typedef struct _RT_CHANNEL_PLAN_MAP {

    WARNING: do not add new typedefs
    torvalds#273: FILE: include/rtw_mlme_ext.h:273:
    +typedef enum _HT_IOT_PEER {

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
Link: https://lore.kernel.org/r/20210312082638.25512-24-marco.cesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ojeda added a commit to ojeda/linux that referenced this pull request May 1, 2021
rust: module: improve parsing and errors
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request May 20, 2022
We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478
ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000
ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ torvalds#241
Call Trace:
 dump_stack+0xbe/0xf9
 print_address_description.constprop.0+0x1e/0x220
 kasan_report.cold+0x37/0x7f
 ext4_rename_dir_prepare+0x152/0x220
 ext4_rename+0xf44/0x1ad0
 ext4_rename2+0x11c/0x170
 vfs_rename+0xa84/0x1440
 do_renameat2+0x683/0x8f0
 __x64_sys_renameat+0x53/0x60
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4_rename_dir_prepare: [2] parent_de->inode=3537895424
ext4_rename_dir_prepare: [3] dir=0xffff888124170140
ext4_rename_dir_prepare: [4] ino=2
ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872

Reason is first directory entry which 'rec_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4_get_first_dir_block'.
To solve this issue, check directory entry in 'ext4_get_first_dir_block'.

[ Trigger an ext4_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT ]

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Jun 6, 2022
commit 0be698e upstream.

We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478
ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000
ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ torvalds#241
Call Trace:
 dump_stack+0xbe/0xf9
 print_address_description.constprop.0+0x1e/0x220
 kasan_report.cold+0x37/0x7f
 ext4_rename_dir_prepare+0x152/0x220
 ext4_rename+0xf44/0x1ad0
 ext4_rename2+0x11c/0x170
 vfs_rename+0xa84/0x1440
 do_renameat2+0x683/0x8f0
 __x64_sys_renameat+0x53/0x60
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4_rename_dir_prepare: [2] parent_de->inode=3537895424
ext4_rename_dir_prepare: [3] dir=0xffff888124170140
ext4_rename_dir_prepare: [4] ino=2
ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872

Reason is first directory entry which 'rec_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4_get_first_dir_block'.
To solve this issue, check directory entry in 'ext4_get_first_dir_block'.

[ Trigger an ext4_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT ]

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Jun 6, 2022
commit 0be698e upstream.

We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478
ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000
ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ torvalds#241
Call Trace:
 dump_stack+0xbe/0xf9
 print_address_description.constprop.0+0x1e/0x220
 kasan_report.cold+0x37/0x7f
 ext4_rename_dir_prepare+0x152/0x220
 ext4_rename+0xf44/0x1ad0
 ext4_rename2+0x11c/0x170
 vfs_rename+0xa84/0x1440
 do_renameat2+0x683/0x8f0
 __x64_sys_renameat+0x53/0x60
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4_rename_dir_prepare: [2] parent_de->inode=3537895424
ext4_rename_dir_prepare: [3] dir=0xffff888124170140
ext4_rename_dir_prepare: [4] ino=2
ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872

Reason is first directory entry which 'rec_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4_get_first_dir_block'.
To solve this issue, check directory entry in 'ext4_get_first_dir_block'.

[ Trigger an ext4_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT ]

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Jun 6, 2022
commit 0be698e upstream.

We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478
ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000
ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ torvalds#241
Call Trace:
 dump_stack+0xbe/0xf9
 print_address_description.constprop.0+0x1e/0x220
 kasan_report.cold+0x37/0x7f
 ext4_rename_dir_prepare+0x152/0x220
 ext4_rename+0xf44/0x1ad0
 ext4_rename2+0x11c/0x170
 vfs_rename+0xa84/0x1440
 do_renameat2+0x683/0x8f0
 __x64_sys_renameat+0x53/0x60
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4_rename_dir_prepare: [2] parent_de->inode=3537895424
ext4_rename_dir_prepare: [3] dir=0xffff888124170140
ext4_rename_dir_prepare: [4] ino=2
ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872

Reason is first directory entry which 'rec_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4_get_first_dir_block'.
To solve this issue, check directory entry in 'ext4_get_first_dir_block'.

[ Trigger an ext4_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT ]

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Jun 6, 2022
commit 0be698e upstream.

We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478
ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000
ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ torvalds#241
Call Trace:
 dump_stack+0xbe/0xf9
 print_address_description.constprop.0+0x1e/0x220
 kasan_report.cold+0x37/0x7f
 ext4_rename_dir_prepare+0x152/0x220
 ext4_rename+0xf44/0x1ad0
 ext4_rename2+0x11c/0x170
 vfs_rename+0xa84/0x1440
 do_renameat2+0x683/0x8f0
 __x64_sys_renameat+0x53/0x60
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4_rename_dir_prepare: [2] parent_de->inode=3537895424
ext4_rename_dir_prepare: [3] dir=0xffff888124170140
ext4_rename_dir_prepare: [4] ino=2
ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872

Reason is first directory entry which 'rec_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4_get_first_dir_block'.
To solve this issue, check directory entry in 'ext4_get_first_dir_block'.

[ Trigger an ext4_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT ]

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 7, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 10, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 11, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 11, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 11, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 12, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 13, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 13, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 13, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 13, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 14, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 14, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 14, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Jul 19, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Jul 19, 2023
Add a big batch of test coverage to assert all aspects of the tcx opts
attach, detach and query API:

  # ./vmtest.sh -- ./test_progs -t tc_opts
  [...]
  torvalds#238     tc_opts_after:OK
  torvalds#239     tc_opts_append:OK
  torvalds#240     tc_opts_basic:OK
  torvalds#241     tc_opts_before:OK
  torvalds#242     tc_opts_chain_classic:OK
  torvalds#243     tc_opts_demixed:OK
  torvalds#244     tc_opts_detach:OK
  torvalds#245     tc_opts_detach_after:OK
  torvalds#246     tc_opts_detach_before:OK
  torvalds#247     tc_opts_dev_cleanup:OK
  torvalds#248     tc_opts_invalid:OK
  torvalds#249     tc_opts_mixed:OK
  torvalds#250     tc_opts_prepend:OK
  torvalds#251     tc_opts_replace:OK
  torvalds#252     tc_opts_revision:OK
  Summary: 15/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20230719140858.13224-8-daniel@iogearbox.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
borkmann added a commit to cilium/linux that referenced this pull request Aug 14, 2023
  [...]
  torvalds#234     tc_links_after:OK
  torvalds#235     tc_links_append:OK
  torvalds#236     tc_links_basic:OK
  torvalds#237     tc_links_before:OK
  torvalds#238     tc_links_chain_classic:OK
  torvalds#239     tc_links_chain_mixed:OK
  torvalds#240     tc_links_dev_cleanup:OK
  torvalds#241     tc_links_ingress:OK
  torvalds#242     tc_links_invalid:OK
  torvalds#243     tc_links_prepend:OK
  torvalds#244     tc_links_replace:OK
  torvalds#245     tc_links_revision:OK
  torvalds#246     tc_opts_after:OK
  torvalds#247     tc_opts_append:OK
  torvalds#248     tc_opts_basic:OK
  torvalds#249     tc_opts_before:OK
  torvalds#250     tc_opts_chain_classic:OK
  torvalds#251     tc_opts_chain_mixed:OK
  torvalds#252     tc_opts_delete_empty:OK
  torvalds#253     tc_opts_demixed:OK
  torvalds#254     tc_opts_detach:OK
  torvalds#255     tc_opts_detach_after:OK
  torvalds#256     tc_opts_detach_before:OK
  torvalds#257     tc_opts_dev_cleanup:OK
  torvalds#258     tc_opts_invalid:OK
  torvalds#259     tc_opts_mixed:OK
  torvalds#260     tc_opts_prepend:OK
  torvalds#261     tc_opts_replace:OK
  torvalds#262     tc_opts_revision:OK
  [...]

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit to cilium/linux that referenced this pull request Aug 14, 2023
Add several new tcx test cases to improve test coverage. This also includes
a few new tests with ingress instead of clsact qdisc, to cover the fix from
commit dc644b5 ("tcx: Fix splat in ingress_destroy upon tcx_entry_free").

  # ./test_progs -t tc
  [...]
  torvalds#234     tc_links_after:OK
  torvalds#235     tc_links_append:OK
  torvalds#236     tc_links_basic:OK
  torvalds#237     tc_links_before:OK
  torvalds#238     tc_links_chain_classic:OK
  torvalds#239     tc_links_chain_mixed:OK
  torvalds#240     tc_links_dev_cleanup:OK
  torvalds#241     tc_links_dev_mixed:OK
  torvalds#242     tc_links_ingress:OK
  torvalds#243     tc_links_invalid:OK
  torvalds#244     tc_links_prepend:OK
  torvalds#245     tc_links_replace:OK
  torvalds#246     tc_links_revision:OK
  torvalds#247     tc_opts_after:OK
  torvalds#248     tc_opts_append:OK
  torvalds#249     tc_opts_basic:OK
  torvalds#250     tc_opts_before:OK
  torvalds#251     tc_opts_chain_classic:OK
  torvalds#252     tc_opts_chain_mixed:OK
  torvalds#253     tc_opts_delete_empty:OK
  torvalds#254     tc_opts_demixed:OK
  torvalds#255     tc_opts_detach:OK
  torvalds#256     tc_opts_detach_after:OK
  torvalds#257     tc_opts_detach_before:OK
  torvalds#258     tc_opts_dev_cleanup:OK
  torvalds#259     tc_opts_invalid:OK
  torvalds#260     tc_opts_mixed:OK
  torvalds#261     tc_opts_prepend:OK
  torvalds#262     tc_opts_replace:OK
  torvalds#263     tc_opts_revision:OK
  [...]
  Summary: 44/38 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Aug 15, 2023
Add several new tcx test cases to improve test coverage. This also includes
a few new tests with ingress instead of clsact qdisc, to cover the fix from
commit dc644b5 ("tcx: Fix splat in ingress_destroy upon tcx_entry_free").

  # ./test_progs -t tc
  [...]
  torvalds#234     tc_links_after:OK
  torvalds#235     tc_links_append:OK
  torvalds#236     tc_links_basic:OK
  torvalds#237     tc_links_before:OK
  torvalds#238     tc_links_chain_classic:OK
  torvalds#239     tc_links_chain_mixed:OK
  torvalds#240     tc_links_dev_cleanup:OK
  torvalds#241     tc_links_dev_mixed:OK
  torvalds#242     tc_links_ingress:OK
  torvalds#243     tc_links_invalid:OK
  torvalds#244     tc_links_prepend:OK
  torvalds#245     tc_links_replace:OK
  torvalds#246     tc_links_revision:OK
  torvalds#247     tc_opts_after:OK
  torvalds#248     tc_opts_append:OK
  torvalds#249     tc_opts_basic:OK
  torvalds#250     tc_opts_before:OK
  torvalds#251     tc_opts_chain_classic:OK
  torvalds#252     tc_opts_chain_mixed:OK
  torvalds#253     tc_opts_delete_empty:OK
  torvalds#254     tc_opts_demixed:OK
  torvalds#255     tc_opts_detach:OK
  torvalds#256     tc_opts_detach_after:OK
  torvalds#257     tc_opts_detach_before:OK
  torvalds#258     tc_opts_dev_cleanup:OK
  torvalds#259     tc_opts_invalid:OK
  torvalds#260     tc_opts_mixed:OK
  torvalds#261     tc_opts_prepend:OK
  torvalds#262     tc_opts_replace:OK
  torvalds#263     tc_opts_revision:OK
  [...]
  Summary: 44/38 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/8699efc284b75ccdc51ddf7062fa2370330dc6c0.1692029283.git.daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant