[Kernel-packages] [Bug 2060919] Re: cifs: Copying file to same directory results in page fault

2024-04-30 Thread Pgenest
It's ok for me too.
Tested with the new kernel and everything works as expected.
Thank you very much.

$ uname -rv
6.5.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 26 11:23:57 UTC 2024

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2060919

Title:
  cifs: Copying file to same directory results in page fault

Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Mantic:
  Fix Committed

Bug description:
  BugLink: https://bugs.launchpad.net/bugs/2060919

  [Impact]

  Copying or modifying a file to the same directory within a cifs mount
  results in a page fault, and the process that initiated the copy being
  killed. This could be cp, nautilus, etc.

  This results in the following oops:

  BUG: unable to handle page fault for address: fffe
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x) - not-present page
  PGD f45a3f067 P4D f45a3f067 PUD f45a41067 PMD 0
  Oops:  [#1] PREEMPT SMP NOPTI
  CPU: 0 PID: 28103 Comm: Thread (pooled) Tainted: P OE 6.5.0-27-generic 
#28-Ubuntu
  RIP: 0010:cifs_flush_folio+0x41/0xf0 [cifs]
  Code: 49 89 cd 31 c9 41 54 49 89 f4 48 c1 ee 0c 53 48 83 ec 08 48 8b 7f 30 44 
89 45 d4 e8 79 b3 23 f1 48 89 c3 31 c0 48 85 db 74 77 <48> 8b 13 b8 00 10 00 00 
f7 c2 00 00 01 00 74 10 0f b6 4b 51 48 d3
  RSP: 0018:aab6865ffbf8 EFLAGS: 00010282
  RAX:  RBX: fffe RCX: 
  RDX:  RSI:  RDI: 
  RBP: aab6865ffc28 R08: 0001 R09: 
  R10: 00023854 R11:  R12: 
  R13: aab6865ffc78 R14: 906675d8aed0 R15: aab6865ffc70
  FS: 7bd4d594b6c0() GS:90753f80() knlGS:
  CS: 0010 DS:  ES:  CR0: 80050033
  CR2: fffe CR3: 00017022a000 CR4: 00750ef0
  PKRU: 5554
  Call Trace:
  
  ? show_regs+0x6d/0x80
  ? __die+0x24/0x80
  ? page_fault_oops+0x99/0x1b0
  ? kernelmode_fixup_or_oops+0xb2/0x140
  ? __bad_area_nosemaphore+0x1a5/0x2c0
  ? bad_area_nosemaphore+0x16/0x30
  ? do_kern_addr_fault+0x7b/0xa0
  ? exc_page_fault+0x1a4/0x1b0
  ? asm_exc_page_fault+0x27/0x30
  ? cifs_flush_folio+0x41/0xf0 [cifs]
  ? cifs_flush_folio+0x37/0xf0 [cifs]
  cifs_remap_file_range+0x172/0x660 [cifs]
  do_clone_file_range+0x101/0x2d0
  vfs_clone_file_range+0x3f/0x150
  ioctl_file_clone+0x52/0xc0
  do_vfs_ioctl+0x68f/0x910
  ? __fget_light+0xa5/0x120
  __x64_sys_ioctl+0x7d/0xf0
  do_syscall_64+0x59/0x90
  ? kmem_cache_free+0x22/0x3e0
  ? putname+0x5b/0x80
  ? exit_to_user_mode_prepare+0x30/0xb0
  ? syscall_exit_to_user_mode+0x37/0x60
  ? do_syscall_64+0x68/0x90
  ? do_syscall_64+0x68/0x90
  ? do_syscall_64+0x68/0x90

  There is no known workaround.

  [Fix]

  The stacktrace is very similar to a regression reported to upstream
  6.1.y:

  https://lore.kernel.org/linux-
  mm/a76b370f93cb928c049b94e1fde0d2da506dfcb2.ca...@amazon.com/T/

  The thread mentions that:

  commit 7b2404a886f8b91250c31855d287e632123e1746
  Author: David Howells 
  Date: Fri Dec 1 00:22:00 2023 +
  Subject: cifs: Fix flushing, invalidation and file size with copy_file_range()
  Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7b2404a886f8b91250c31855d287e632123e1746

  introduced the issue to Debian's 6.1 kernel.

  This got backported to Ubuntu in:

  commit 3adbe2ccd8b9b8fde93e03958d6176945794d288
  Author: David Howells 
  Date: Fri Dec 1 00:22:00 2023 +
  Subject: cifs: Fix flushing, invalidation and file size with copy_file_range()

  $ git describe --contains 3adbe2ccd8b9b8fde93e03958d6176945794d288
  Ubuntu-6.5.0-20.20~107

  Which we have been using for some time now, and is not the culprit.

  Reading the regression mailing list thread, they mention that things
  work differently in 6.1:

  > Yeah.  __filemap_get_folio() works differently in v6.1.y. There it returns a
  > folio or NULL.  In 6.7 it returns a folio or a negative error code.  The 
error
  > check in cifs_flush_folio() needs to change to something like:
  >
  > folio = filemap_get_folio(inode->i_mapping, index);
  > if (!folio)
  > return -ENOMEM;
  >
  > David 

  6.1.y then got a specific patch to fix the issue in 6.1, which is:

  commit 21bb2ba4f1ac1e3a57594be62dd74e7b1401b2b1
  Author: Steve French 
  Date: Fri Jan 12 23:08:51 2024 -0600
  Subject: cifs: fix flushing folio regression for 6.1 backport
  Link: 
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/mantic/commit/?id=21bb2ba4f1ac1e3a57594be62dd74e7b1401b2b1

  $ git describe --contains 21bb2ba4f1ac1e3a57594be62dd74e7b1401b2b1
  Ubuntu-6.5.0-27.28~162

  Since the Ubuntu mantic kernel consumes both 6.1.y and 6.7.y / 6.8.y
  stable patches, this patch was applied to mantic's 6.5 kernel by
  mistake, and contains the wrong 

[Kernel-packages] [Bug 2060919] Re: Remote filesystems mounted as CIFS not working after update to Kernel "6.5.0-27-generic #28-Ubuntu" (amd64) or Kernel "6.5.0-1014-raspi #17-Ubuntu" (aarch64).

2024-04-11 Thread Pgenest
Same issue when I copy files from a Synology smb share to another directory on 
the same smb share
Issue occured after system update.


$ lsb_release -rd
No LSB modules are available.
Description:Ubuntu 23.10
Release:23.10


$ uname -a
Linux Panoramix 6.5.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar  7 
18:21:00 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux


$ cat /proc/version_signature
Ubuntu 6.5.0-27.28-generic 6.5.13



/var/log/syslog

2024-04-11T15:20:25.107768+02:00 Panoramix kernel: [ 5748.234124] BUG: unable 
to handle page fault for address: fffe
2024-04-11T15:20:25.107782+02:00 Panoramix kernel: [ 5748.234132] #PF: 
supervisor read access in kernel mode
2024-04-11T15:20:25.107784+02:00 Panoramix kernel: [ 5748.234136] #PF: 
error_code(0x) - not-present page
2024-04-11T15:20:25.107786+02:00 Panoramix kernel: [ 5748.234138] PGD 44d43f067 
P4D 44d43f067 PUD 44d441067 PMD 0 
2024-04-11T15:20:25.107788+02:00 Panoramix kernel: [ 5748.234146] Oops:  
[#1] PREEMPT SMP NOPTI
2024-04-11T15:20:25.107790+02:00 Panoramix kernel: [ 5748.234150] CPU: 10 PID: 
326370 Comm: pool-nemo Tainted: G   OE  6.5.0-27-generic #28-Ubuntu
2024-04-11T15:20:25.107792+02:00 Panoramix kernel: [ 5748.234155] Hardware 
name: Micro-Star International Co., Ltd. MS-7C56/MPG B550 GAMING PLUS 
(MS-7C56), BIOS 1.90 03/17/2022
2024-04-11T15:20:25.107794+02:00 Panoramix kernel: [ 5748.234158] RIP: 
0010:cifs_flush_folio+0x41/0xf0 [cifs]
2024-04-11T15:20:25.107809+02:00 Panoramix kernel: [ 5748.234214] Code: 49 89 
cd 31 c9 41 54 49 89 f4 48 c1 ee 0c 53 48 83 ec 08 48 8b 7f 30 44 89 45 d4 e8 
79 23 f5 e0 48 89 c3 31 c0 48 85 db 74 77 <48> 8b 13 b8 00 10 00 00 f7 c2 00 00 
01 00 74 10 0f b6 4b 51 48 d3
2024-04-11T15:20:25.107811+02:00 Panoramix kernel: [ 5748.234217] RSP: 
0018:acb394a9fc30 EFLAGS: 00010282
2024-04-11T15:20:25.107813+02:00 Panoramix kernel: [ 5748.234221] RAX: 
 RBX: fffe RCX: 
2024-04-11T15:20:25.107815+02:00 Panoramix kernel: [ 5748.234223] RDX: 
 RSI:  RDI: 
2024-04-11T15:20:25.107817+02:00 Panoramix kernel: [ 5748.234226] RBP: 
acb394a9fc60 R08: 0001 R09: 
2024-04-11T15:20:25.107819+02:00 Panoramix kernel: [ 5748.234228] R10: 
3950 R11:  R12: 
2024-04-11T15:20:25.107821+02:00 Panoramix kernel: [ 5748.234230] R13: 
acb394a9fcb0 R14: 97b687327508 R15: acb394a9fca8
2024-04-11T15:20:25.107823+02:00 Panoramix kernel: [ 5748.234233] FS:  
79a0b57f26c0() GS:97bd0dc8() knlGS:
2024-04-11T15:20:25.107825+02:00 Panoramix kernel: [ 5748.234236] CS:  0010 DS: 
 ES:  CR0: 80050033
2024-04-11T15:20:25.107826+02:00 Panoramix kernel: [ 5748.234239] CR2: 
fffe CR3: 00018f466000 CR4: 00750ee0
2024-04-11T15:20:25.107828+02:00 Panoramix kernel: [ 5748.234242] PKRU: 5554
2024-04-11T15:20:25.107830+02:00 Panoramix kernel: [ 5748.234244] Call Trace:
2024-04-11T15:20:25.107831+02:00 Panoramix kernel: [ 5748.234247]  
2024-04-11T15:20:25.107833+02:00 Panoramix kernel: [ 5748.234251]  ? 
show_regs+0x6d/0x80
2024-04-11T15:20:25.107835+02:00 Panoramix kernel: [ 5748.234258]  ? 
__die+0x24/0x80
2024-04-11T15:20:25.107837+02:00 Panoramix kernel: [ 5748.234263]  ? 
page_fault_oops+0x99/0x1b0
2024-04-11T15:20:25.107839+02:00 Panoramix kernel: [ 5748.234270]  ? 
kernelmode_fixup_or_oops+0xb2/0x140
2024-04-11T15:20:25.107841+02:00 Panoramix kernel: [ 5748.234274]  ? 
__bad_area_nosemaphore+0x1a5/0x2c0
2024-04-11T15:20:25.107843+02:00 Panoramix kernel: [ 5748.234279]  ? 
bad_area_nosemaphore+0x16/0x30
2024-04-11T15:20:25.107845+02:00 Panoramix kernel: [ 5748.234283]  ? 
do_kern_addr_fault+0x7b/0xa0
2024-04-11T15:20:25.107847+02:00 Panoramix kernel: [ 5748.234287]  ? 
exc_page_fault+0x1a4/0x1b0
2024-04-11T15:20:25.107848+02:00 Panoramix kernel: [ 5748.234293]  ? 
asm_exc_page_fault+0x27/0x30
2024-04-11T15:20:25.107850+02:00 Panoramix kernel: [ 5748.234302]  ? 
cifs_flush_folio+0x41/0xf0 [cifs]
2024-04-11T15:20:25.107851+02:00 Panoramix kernel: [ 5748.234340]  
cifs_remap_file_range+0x172/0x660 [cifs]
2024-04-11T15:20:25.107852+02:00 Panoramix kernel: [ 5748.234378]  
do_clone_file_range+0x104/0x2d0
2024-04-11T15:20:25.107854+02:00 Panoramix kernel: [ 5748.234388]  
vfs_clone_file_range+0x3f/0x150
2024-04-11T15:20:25.107864+02:00 Panoramix kernel: [ 5748.234393]  
ioctl_file_clone+0x52/0xc0
2024-04-11T15:20:25.107865+02:00 Panoramix kernel: [ 5748.234399]  
do_vfs_ioctl+0x68f/0x910
2024-04-11T15:20:25.107867+02:00 Panoramix kernel: [ 5748.234404]  ? 
srso_alias_return_thunk+0x5/0x7f
2024-04-11T15:20:25.107869+02:00 Panoramix kernel: [ 5748.234409]  ? 
__fget_light+0xa5/0x120
2024-04-11T15:20:25.107870+02:00 Panoramix kernel: [ 5748.234415]  
__x64_sys_ioctl+0x7d/0xf0
2024-04-11T15:20:25.107872+02:00 Panoramix