Skip to content

DLPX-92453 Cherry-pick Delphix commits of linux-kernel-generic for LTS upgrade #44

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

Merged
merged 0 commits into from
Oct 24, 2024

Conversation

palash-gandhi
Copy link
Contributor

@palash-gandhi palash-gandhi commented Oct 16, 2024

This change cherry-picks the Delphix patch set from develop onto a branch forked off of upstreams/os-upgrade. upstreams/os-upgrade currently has commits from Linux kernel 6.8, the version that ships with Ubuntu 24.04. I ran the following command to perform the cherry-pick:

$ git cherry-pick cbe07afa9fe4659c4b3e738128a6f4f040cd7ace^..8a5662e072342ad4f698afc817795d13b3020202

Here's the actual diff between upstreams/os-upgrade and os-upgrade: upstreams/os-upgrade...dlpx/pr/palash.gandhi/generic

Additional changes that were required:

build-package: https://ops-jenkins.eng-tools-prd.aws.delphixcloud.com/job/linux-pkg/job/os-upgrade/job/build-package/job/linux-kernel-generic/job/pre-push/17/console

Resulting merge conflicts

 $ git cherry-pick cbe07afa9fe4659c4b3e738128a6f4f040cd7ace^..8a5662e072342ad4f698afc817795d13b3020202
[lts e4c2d707c6f0] @@DELPHIX_PATCHSET_START@@
 Author: John Wren Kennedy <[email protected]>
 Date: Thu Apr 1 19:46:14 2021 +0000
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 delphix
Auto-merging drivers/target/iscsi/iscsi_target_login.c
Auto-merging drivers/target/iscsi/iscsi_target_nego.c
[lts 875ba2f9278c] DLPX-71852 iSCSI: journal flooded with "Unable to locate Target IQN" messages (#2)
 Author: Pavel Zakharov <[email protected]>
 Date: Tue Feb 9 11:15:55 2021 -0500
 2 files changed, 2 insertions(+), 2 deletions(-)
Auto-merging drivers/target/iscsi/iscsi_target_erl1.c
Auto-merging drivers/target/target_core_transport.c
Auto-merging include/target/target_core_fabric.h
[lts 94bace0f05e8] DLPX-72065 Aborted iSCSI command never completes after LUN reset (#4)
 Author: Pavel Zakharov <[email protected]>
 Date: Mon Mar 8 18:11:08 2021 -0500
 3 files changed, 22 insertions(+), 5 deletions(-)
Auto-merging Makefile
CONFLICT (content): Merge conflict in Makefile
CONFLICT (modify/delete): debian.hwe-5.15/dkms-versions deleted in HEAD and modified in a6ae7f761dd0 (DLPX-83442 Disable various kernel modules which we don't use (#13)).  Version a6ae7f761dd0 (DLPX-83442 Disable various kernel modules which we don't use (#13)) of debian.hwe-5.15/dkms-versions left in tree.
Auto-merging debian.master/dkms-versions
CONFLICT (content): Merge conflict in debian.master/dkms-versions
Auto-merging debian/rules.d/2-binary-arch.mk
error: could not apply a6ae7f761dd0... DLPX-83442 Disable various kernel modules which we don't use (#13)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

 $ gs
On branch lts
Cherry-pick currently in progress.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   debian.master/config/OVERRIDES
	modified:   debian/rules.d/2-binary-arch.mk

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   Makefile
	deleted by us:   debian.hwe-5.15/dkms-versions
	both modified:   debian.master/dkms-versions

 $ git cherry-pick --continue
[lts 2f7c5ee6ce92] DLPX-83442 Disable various kernel modules which we don't use (#13)
 Author: Prakash Surya <[email protected]>
 Date: Tue Nov 15 14:41:17 2022 -0800
 4 files changed, 239 insertions(+), 11 deletions(-)
 create mode 100644 debian.master/config/OVERRIDES
Auto-merging drivers/target/iscsi/iscsi_target.c
Auto-merging drivers/target/iscsi/iscsi_target_login.c
Auto-merging include/target/iscsi/iscsi_target_core.h
[lts 6ae64caff88f] DLPX-83697 iscsi target login should wait until tx/rx threads have properly started
 Author: Paul Dagnelie <[email protected]>
 Date: Mon Nov 14 13:49:55 2022 -0800
 3 files changed, 6 insertions(+)
Auto-merging fs/namespace.c
[lts c910f6e6d697] DLPX-83701 Make function mnt_add_count() traceable (#16)
 Author: Don Brady <[email protected]>
 Date: Fri Dec 9 16:21:35 2022 -0700
 1 file changed, 3 insertions(+), 2 deletions(-)
[lts f7d9bb6c7477] DLPX-84608 Remove merge commit from linux-kernel-generic
 Author: John Wren Kennedy <[email protected]>
 Date: Fri Feb 10 15:25:25 2023 -0700
 1 file changed, 1 deletion(-)
[lts 2b88ee5f6dee] DLPX-84907 CVE-2022-3628 (#21)
 Author: Prakash Surya <[email protected]>
 Date: Wed Mar 1 09:08:26 2023 -0800
 1 file changed, 1 insertion(+)
Auto-merging drivers/target/iscsi/iscsi_target_login.c
Auto-merging drivers/target/iscsi/iscsi_target_nego.c
CONFLICT (content): Merge conflict in drivers/target/iscsi/iscsi_target_nego.c
Auto-merging drivers/target/iscsi/iscsi_target_util.c
CONFLICT (content): Merge conflict in drivers/target/iscsi/iscsi_target_util.c
Auto-merging drivers/target/iscsi/iscsi_target_util.h
CONFLICT (content): Merge conflict in drivers/target/iscsi/iscsi_target_util.h
Auto-merging include/target/iscsi/iscsi_target_core.h
CONFLICT (content): Merge conflict in include/target/iscsi/iscsi_target_core.h
error: could not apply ca31ccb3fe10... DLPX-84985 target: iscsi: fix deadlock in the iSCSI login code (#22)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

 $ gs
On branch lts
Cherry-pick currently in progress.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   drivers/target/iscsi/iscsi_target_nego.c
	both modified:   drivers/target/iscsi/iscsi_target_util.c
	both modified:   drivers/target/iscsi/iscsi_target_util.h
	both modified:   include/target/iscsi/iscsi_target_core.h

 $ git cherry-pick --continue
[lts 580a47c58812] DLPX-84985 target: iscsi: fix deadlock in the iSCSI login code (#22)
 Author: Serapheim Dimitropoulos <[email protected]>
 Date: Tue Mar 7 13:37:23 2023 -0800
 1 file changed, 14 insertions(+), 3 deletions(-)
[lts a4506a5ff920] DLPX-84906 Disable frame buffer drivers (#25)
 Author: sumedhbala-delphix <[email protected]>
 Date: Tue May 9 10:23:37 2023 -0700
 1 file changed, 1 insertion(+)
[lts c90e6860459d] DLPX-86177 Azure Accelerated networking broken because Mellanox drivers absent in kernel (#26)
 Author: Palash Gandhi <[email protected]>
 Date: Tue May 23 08:13:48 2023 -0700
 1 file changed, 5 deletions(-)
Performing inexact rename detection: 100% (33794/33794), done.
[lts 1ae4baadf173] DLPX-86675 Disk quota exceeded when unpacking an upgrade image (#27)
 Author: Prakash Surya <[email protected]>
 Date: Tue Jun 27 10:37:36 2023 -0700
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename {debian.master => debian.hwe-5.15}/config/OVERRIDES (99%)
CONFLICT (modify/delete): debian.hwe-5.15/config/annotations deleted in HEAD and modified in 4b92bb96d262 (DLPX-87344 Fix kernel merge conflict with upstream).  Version 4b92bb96d262 (DLPX-87344 Fix kernel merge conflict with upstream) of debian.hwe-5.15/config/annotations left in tree.
error: could not apply 4b92bb96d262... DLPX-87344 Fix kernel merge conflict with upstream
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

 $ gs
On branch lts
Cherry-pick currently in progress.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   debian.hwe-5.15/config/annotations

 $ git rm debian.hwe-5.15/config/annotations
rm 'debian.hwe-5.15/config/annotations'

 $ git commit --allow-empty
[lts e2abab9f9861] DLPX-87344 Fix kernel merge conflict with upstream
 Author: Prakash Surya <[email protected]>
 Date: Tue Aug 15 12:23:29 2023 -0700

 $ gs
On branch lts
Cherry-pick currently in progress.
  (run "git cherry-pick --continue" to continue)
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean

$ git cherry-pick --continue
CONFLICT (modify/delete): debian.hwe-5.15/config/annotations deleted in HEAD and modified in 9273b91afa18 (DLPX-87710 upgrade from 6.0.16.0 to 15.0.0.0 failed because disk quota error (#29)).  Version 9273b91afa18 (DLPX-87710 upgrade from 6.0.16.0 to 15.0.0.0 failed because disk quota error (#29)) of debian.hwe-5.15/config/annotations left in tree.
error: could not apply 9273b91afa18... DLPX-87710 upgrade from 6.0.16.0 to 15.0.0.0 failed because disk quota error (#29)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

 $ gs
On branch lts
Cherry-pick currently in progress.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   debian.delphix/config/annotations
	deleted:    debian.hwe-5.15/config/OVERRIDES

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   debian.hwe-5.15/config/annotations

$ git rm debian.hwe-5.15/config/annotations
rm 'debian.hwe-5.15/config/annotations'

 $ gs
On branch lts
Cherry-pick currently in progress.
  (run "git cherry-pick --continue" to continue)
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   debian.delphix/config/annotations
	deleted:    debian.hwe-5.15/config/OVERRIDES

 $ git cherry-pick --continue
[lts acbf8056f273] DLPX-87710 upgrade from 6.0.16.0 to 15.0.0.0 failed because disk quota error (#29)
 Author: Palash Gandhi <[email protected]>
 Date: Wed Sep 6 20:20:02 2023 -0700
 2 files changed, 230 insertions(+), 229 deletions(-)
 create mode 100644 debian.delphix/config/annotations
 delete mode 100644 debian.hwe-5.15/config/OVERRIDES
CONFLICT (modify/delete): debian.hwe-5.15/config/annotations deleted in HEAD and modified in 2aebdf21a534 (DLPX-87970 Move Delphix annotations to linux-pkg to reduce merge conflicts (#31)).  Version 2aebdf21a534 (DLPX-87970 Move Delphix annotations to linux-pkg to reduce merge conflicts (#31)) of debian.hwe-5.15/config/annotations left in tree.
error: could not apply 2aebdf21a534... DLPX-87970 Move Delphix annotations to linux-pkg to reduce merge conflicts (#31)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

 $ gs
On branch lts
Cherry-pick currently in progress.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	deleted:    debian.delphix/config/annotations

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   debian.hwe-5.15/config/annotations

 $ git rm debian.hwe-5.15/config/annotations
rm 'debian.hwe-5.15/config/annotations'

 $ git cherry-pick --continue
[lts b19532a5b76d] DLPX-87970 Move Delphix annotations to linux-pkg to reduce merge conflicts (#31)
 Author: Palash Gandhi <[email protected]>
 Date: Tue Sep 19 08:03:17 2023 -0700
 1 file changed, 230 deletions(-)
 delete mode 100644 debian.delphix/config/annotations
Auto-merging drivers/target/iscsi/iscsi_target.c
On branch lts
Cherry-pick currently in progress.
  (run "git cherry-pick --continue" to continue)
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'

$ git commit --allow-empty
[lts 814eb1523f7c] DLPX-91889 scsi: target: iscsi: Handle abort for WRITE_PENDING cmds (#40)
 Author: Paul Dagnelie <[email protected]>
 Date: Fri Aug 9 13:57:25 2024 -0700

@palash-gandhi palash-gandhi force-pushed the dlpx/pr/palash.gandhi/generic branch 10 times, most recently from b919214 to 52c31c2 Compare October 23, 2024 18:41
@palash-gandhi palash-gandhi marked this pull request as ready for review October 23, 2024 21:33
@palash-gandhi palash-gandhi changed the title Cherry-pick Delphix commits of linux-kernel-generic for LTS upgrade DLPX-92453 Cherry-pick Delphix commits of linux-kernel-generic for LTS upgrade Oct 24, 2024
@palash-gandhi palash-gandhi merged commit 436f4ae into os-upgrade Oct 24, 2024
2 of 3 checks passed
@palash-gandhi palash-gandhi deleted the dlpx/pr/palash.gandhi/generic branch October 24, 2024 22:37
delphix-devops-bot pushed a commit that referenced this pull request Nov 10, 2024
BugLink: https://bugs.launchpad.net/bugs/2080594

commit 5d92c7c566dc76d96e0e19e481d926bbe6631c1e upstream.

If the ata_port_alloc() call in ata_host_alloc() fails,
ata_host_release() will get called.

However, the code in ata_host_release() tries to free ata_port struct
members unconditionally, which can lead to the following:

BUG: unable to handle page fault for address: 0000000000003990
PGD 0 P4D 0
Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 10 PID: 594 Comm: (udev-worker) Not tainted 6.10.0-rc5 #44
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
RIP: 0010:ata_host_release.cold+0x2f/0x6e [libata]
Code: e4 4d 63 f4 44 89 e2 48 c7 c6 90 ad 32 c0 48 c7 c7 d0 70 33 c0 49 83 c6 0e 41
RSP: 0018:ffffc90000ebb968 EFLAGS: 00010246
RAX: 0000000000000041 RBX: ffff88810fb52e78 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff88813b3218c0 RDI: ffff88813b3218c0
RBP: ffff88810fb52e40 R08: 0000000000000000 R09: 6c65725f74736f68
R10: ffffc90000ebb738 R11: 73692033203a746e R12: 0000000000000004
R13: 0000000000000000 R14: 0000000000000011 R15: 0000000000000006
FS:  00007f6cc55b9980(0000) GS:ffff88813b300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000003990 CR3: 00000001122a2000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 ? __die_body.cold+0x19/0x27
 ? page_fault_oops+0x15a/0x2f0
 ? exc_page_fault+0x7e/0x180
 ? asm_exc_page_fault+0x26/0x30
 ? ata_host_release.cold+0x2f/0x6e [libata]
 ? ata_host_release.cold+0x2f/0x6e [libata]
 release_nodes+0x35/0xb0
 devres_release_group+0x113/0x140
 ata_host_alloc+0xed/0x120 [libata]
 ata_host_alloc_pinfo+0x14/0xa0 [libata]
 ahci_init_one+0x6c9/0xd20 [ahci]

Do not access ata_port struct members unconditionally.

Fixes: 633273a ("libata-pmp: hook PMP support and enable it")
Cc: [email protected]
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
Signed-off-by: Oleksandr Tymoshenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Koichiro Den <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
delphix-devops-bot pushed a commit that referenced this pull request Feb 7, 2025
BugLink: https://bugs.launchpad.net/bugs/2076435

[ Upstream commit 5d92c7c566dc76d96e0e19e481d926bbe6631c1e ]

If the ata_port_alloc() call in ata_host_alloc() fails,
ata_host_release() will get called.

However, the code in ata_host_release() tries to free ata_port struct
members unconditionally, which can lead to the following:

BUG: unable to handle page fault for address: 0000000000003990
PGD 0 P4D 0
Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 10 PID: 594 Comm: (udev-worker) Not tainted 6.10.0-rc5 #44
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
RIP: 0010:ata_host_release.cold+0x2f/0x6e [libata]
Code: e4 4d 63 f4 44 89 e2 48 c7 c6 90 ad 32 c0 48 c7 c7 d0 70 33 c0 49 83 c6 0e 41
RSP: 0018:ffffc90000ebb968 EFLAGS: 00010246
RAX: 0000000000000041 RBX: ffff88810fb52e78 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff88813b3218c0 RDI: ffff88813b3218c0
RBP: ffff88810fb52e40 R08: 0000000000000000 R09: 6c65725f74736f68
R10: ffffc90000ebb738 R11: 73692033203a746e R12: 0000000000000004
R13: 0000000000000000 R14: 0000000000000011 R15: 0000000000000006
FS:  00007f6cc55b9980(0000) GS:ffff88813b300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000003990 CR3: 00000001122a2000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 ? __die_body.cold+0x19/0x27
 ? page_fault_oops+0x15a/0x2f0
 ? exc_page_fault+0x7e/0x180
 ? asm_exc_page_fault+0x26/0x30
 ? ata_host_release.cold+0x2f/0x6e [libata]
 ? ata_host_release.cold+0x2f/0x6e [libata]
 release_nodes+0x35/0xb0
 devres_release_group+0x113/0x140
 ata_host_alloc+0xed/0x120 [libata]
 ata_host_alloc_pinfo+0x14/0xa0 [libata]
 ahci_init_one+0x6c9/0xd20 [ahci]

Do not access ata_port struct members unconditionally.

Fixes: 633273a ("libata-pmp: hook PMP support and enable it")
Cc: [email protected]
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
Stable-dep-of: f6549f538fe0 ("ata,scsi: libata-core: Do not leak memory for ata_port struct members")
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Portia Stephens <[email protected]>
Signed-off-by: Roxana Nicolescu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants