bugdavfs2 - Bugs: bug #63771, davfs2 1.7.0 crashes when working...

 
 

bug #63771: davfs2 1.7.0 crashes when working with nginx dav module and special chars

Submitter:  None
Submitted:  Tue 07 Feb 2023 12:55:26 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  alix82
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 Nov 2024 10:56:49 AM UTC, comment #5: 

The project has been migrated to github [1]

I believe your issue is fixed by

https://github.com/alisarctl/davfs2/commit/240608e832a4d30e0f96aaa0aa651a596f9023fe

Please open an issue on github if it is not the case.

[1] https://github.com/alisarctl/davfs2

Ali Abdallah <alix82>
Group administrator
Thu 16 May 2024 06:33:29 AM UTC, comment #4: 

I have same issue when I do `ls /mnt/webdav/lost+found` with mounting webdav.

Here is a patch to fix segfault.
backup(lost+found) node would be different from webdav node.


--- a/src/cache.c
+++ b/src/cache.c
@@ -1022,7 +1022,7 @@ dav_lookup(dav_node **nodep, dav_node *parent, const char *name, uid_t uid)

         if (is_open(*nodep))
             attr_from_cache_file(*nodep);
-        else if (!is_dirty(*nodep)) {
+        else if (!is_dirty(*nodep) && !is_backup(*nodep)) {
             int ret;

             dav_props *props = NULL;


Hiroshi Shirosaki <shirosaki>
Fri 31 Mar 2023 10:27:05 AM UTC, comment #3: 

it happened again - I assume this is due to a corrupted file, which determines what belongs in lost+found and what is a regular file in cache.

cleaning the user cache files solves the problem for "some time"

Anonymous
Tue 21 Mar 2023 10:05:12 AM UTC, comment #2: 

This bug also arises, when you have files in lost+found and try to acess them:

cd lost+found/
[marc@localhost lost+found]$ ls
ls: cannot access 'dir-lost+found-xhbokx': Software caused connection abort
ls: cannot access 'dir-lost+found-rLn3pO': Transport endpoint is not connected
....

Anonymous
Mon 20 Mar 2023 11:27:21 AM UTC, comment #1: 

I can confirm this bug too. In my case I could only resolve it, by removing all cached files.

Anonymous
Tue 07 Feb 2023 12:55:26 AM UTC, original submission:  

Reproduce

1. Setup an Nginx server with dav module enabled.
2. On another server, mount the resource serving by nginx.
3. In the mounted directory, create a file contains '[', e.g.

 echo test | tee 'mounted/[test]'

4. Try to cat the content, dmesg will show a crash something like

[145885.623406] mount.davfs[82429]: segfault at 18 ip 000055ce8851c8ec sp 00007ffce9ccd540 error 4 in mount.davfs[55ce88515000+15000] likely on CPU 0 (core 0, socket 0)
[145885.623416] Code: 00 48 c7 44 24 08 00 00 00 00 48 8b 7b 20 48 8d 74 24 08 67 e8 b5 b6 00 00 85 c0 0f 85 69 ff ff ff 48 8b 7c 24 08 49 8b 5d 00 <48> 8b 47 18 48 39 43 48 74 54 48 89 43 48 48 8b 43 30 48 85 c0 74
[145885.623494] audit: type=1701 audit(1675728425.394:461): auid=972 uid=65534 gid=90 ses=5 pid=82429 comm="mount.davfs" exe="/usr/bin/mount.davfs" sig=11 res=1



The Nginx config (block)


location /dav/ {
    alias /tmp/;
    client_body_temp_path /tmp/nginx/;
    charset utf-8;
    dav_access user:rw group:rw all:rw;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    create_full_put_path on;
    autoindex on;
}


Append

I tried using this simple script as webdav server: https://gist.github.com/mickael-kerjean/f2f034bdad5e077edcbfdff649d52d68

And the above steps won't make any crashes, the file content can be normally shown.

Server OS is Ubuntu 22.04 LTS.
Client (who runs mount.davfs) OS is Arch, davfs2 installed from AUR (https://aur.archlinux.org/packages/davfs2)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by alix82 (Posted a comment)
  • -email is unavailable- added by shirosaki (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-20 alix82 StatusNone Fixed
        Assigned toNone alix82
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code