Re: netbsd crashes when using fat filesys

2024-05-04 Thread xuser

using -o rump is the fix thank you.

On Fri, 3 May 2024, Martin Husemann wrote:


On Fri, May 03, 2024 at 12:20:45PM +0200, Riccardo Mottola wrote:

still it would be nice to understand what changes Solaris was doing which
disturb NetBSD.


Yes (but it sounds like it is a bug Solaris).


I don't think NetBSD should crash...


Only if the file system passes a fsck_msdos(8). Which we don't know.
For random USB sticks we recommend the "-o rump" mount option.

Martin





Re: netbsd crashes when using fat filesys

2024-05-04 Thread xuser

I tried netbsd 10 and it does not crash.

On Fri, 3 May 2024, Riccardo Mottola wrote:


Hi "xuser",

xuser wrote:

Yes it is that netbsd will crash on driver errors
And I found the problem it was that solaris autofs driver would mount an 
LBA fat 32 as CHS fat32
And so disabling automount support in solaris fixed it. 


still it would be nice to understand what changes Solaris was doing which 
disturb NetBSD.

I don't think NetBSD should crash...

Riccardo





Re: netbsd crashes when using fat filesys

2024-05-04 Thread xuser

Yes it is a bug is solaris
And fsck_msdos will fix the problem


On Fri, 3 May 2024, Martin Husemann wrote:


On Fri, May 03, 2024 at 12:20:45PM +0200, Riccardo Mottola wrote:

still it would be nice to understand what changes Solaris was doing which
disturb NetBSD.


Yes (but it sounds like it is a bug Solaris).


I don't think NetBSD should crash...


Only if the file system passes a fsck_msdos(8). Which we don't know.
For random USB sticks we recommend the "-o rump" mount option.

Martin





Re: netbsd crashes when using fat filesys

2024-05-03 Thread Martin Husemann
On Fri, May 03, 2024 at 12:20:45PM +0200, Riccardo Mottola wrote:
> still it would be nice to understand what changes Solaris was doing which
> disturb NetBSD.

Yes (but it sounds like it is a bug Solaris).

> I don't think NetBSD should crash...

Only if the file system passes a fsck_msdos(8). Which we don't know.
For random USB sticks we recommend the "-o rump" mount option.

Martin


Re: netbsd crashes when using fat filesys

2024-05-03 Thread Riccardo Mottola

Hi Martin,

Martin Husemann wrote:

  - the original issue reported here is*something else*  mangling/breaking
a FAT file system and NetBSD not dealing with the result. This can
either be a bug in Solaris or in NetBSD's interpration of the FAT
file system format - we just don't know (yet).

An image of a file system in broken state is absolutely required here
to debug the issue.

If the OP can't provide such an image, we need a*working recipe*  how
to reproduce the issue, plus someone with a Solaris 10 installation
to create the broken image, plus someone to debug the result.
Currently we have neither the recipe nor someone with Solaris 10 installed
willing to help.


I have here locally a Solaris 8 and Solaris 10 box - both sparc64, 
however no easy way mount stuff since they are servers. I think there 
are hard-to-access USBs in the back, if they can mount USB keys, I could 
try to reproduce. Never tried.
It would be best if NetBSD could e.g. just refuse to mount, dive a 
system log and warn with fsck or try to be smart otherwise, not crash!


Riccardo


Re: netbsd crashes when using fat filesys

2024-05-03 Thread Riccardo Mottola

Hi "xuser",

xuser wrote:

Yes it is that netbsd will crash on driver errors
And I found the problem it was that solaris autofs driver would mount 
an LBA fat 32 as CHS fat32
And so disabling automount support in solaris fixed it. 


still it would be nice to understand what changes Solaris was doing 
which disturb NetBSD.

I don't think NetBSD should crash...

Riccardo


Re: netbsd crashes when using fat filesys

2024-05-03 Thread Rhialto
On Thu 02 May 2024 at 21:19:30 -, Michael van Elst wrote:
> I can repeat this with rump, but not with the kernel filesystem.
> After my suggested change, rump no longer crashes.
> 
> N.B. the code change is in /usr/lib/librumpfs_msdos.so.0.0.

Ah yes after I posted the previous, I thought that maybe the change
would not necessarily be in the executable. I tried with a chroot (I
have one around for testing X) and indeed, I now see the same as you.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert
\X/ There is no AI. There is just someone else's work.   --I. Rose


signature.asc
Description: PGP signature


Re: netbsd crashes when using fat filesys

2024-05-02 Thread xuser

Yes it is that netbsd will crash on driver errors
And I found the problem it was that solaris autofs driver would mount an 
LBA fat 32 as CHS fat32

And so disabling automount support in solaris fixed it.
Thank you.

On Thu, 2 May 2024, Martin Husemann wrote:


On Thu, May 02, 2024 at 08:12:06PM +0200, Martin Husemann wrote:

On Thu, May 02, 2024 at 08:04:28PM +0200, Rhialto wrote:

I filed http://gnats.netbsd.org/58146 for it.


Why do you think those issue are related? Sounds very unlikely to me.


To ellaborate on this:

- the original issue reported here is *something else* mangling/breaking
  a FAT file system and NetBSD not dealing with the result. This can
  either be a bug in Solaris or in NetBSD's interpration of the FAT
  file system format - we just don't know (yet).

  An image of a file system in broken state is absolutely required here
  to debug the issue.

  If the OP can't provide such an image, we need a *working recipe* how
  to reproduce the issue, plus someone with a Solaris 10 installation
  to create the broken image, plus someone to debug the result.
  Currently we have neither the recipe nor someone with Solaris 10 installed
  willing to help.

- PR 58146 looks like a NetBSD local locking issue/race condition. The
  file system image you offered probably will not be helpfull, we need
  to do carefull reading of the relevant locking paths in the code.


Martin





Re: netbsd crashes when using fat filesys

2024-05-02 Thread Michael van Elst
rhia...@falu.nl (Rhialto) writes:

>$ sudo ./rump_msdos -o rw -o rump ./efi.img /tmp/t
>rump_msdos: "./efi.img" is a relative path.
>rump_msdos: using "/mnt/scratch/scratch/tmp/xcrash/efi.img" instead.
>[   1.000] entropy: ready

>terminal 2:

>$ cd /tmp/t
>$ ls -l
>total 4
>drwxr-xr-x  1 rhialto  wheel  4096 Apr 21  2021 efi/
>-rwxr-xr-x  1 rhialto  wheel 0 May  2 22:32 file*
>$ mv file file2
>mv: rename file to file2: Device not configured


I can repeat this with rump, but not with the kernel filesystem.
After my suggested change, rump no longer crashes.

N.B. the code change is in /usr/lib/librumpfs_msdos.so.0.0.



Re: netbsd crashes when using fat filesys

2024-05-02 Thread Rhialto
On Thu 02 May 2024 at 20:10:10 -, Michael van Elst wrote:
> rhia...@falu.nl (Rhialto) writes:
> 
> >I had something similar recently when doing a rename of a file on a FAT
> >file system (in this case my /efi file system). Fortunately I had it
> >mounted with -o rump, because it was 100% repeatable.
> 
> >I filed http://gnats.netbsd.org/58146 for it.
> 
> 
> Maybe that's rump.
> 
> msdosfs:
> KASSERT(tcnp->cn_cred == cred);
> 
> genfs:  /*
>  * XXX Want a better equality test.  `tcnp->cn_cred == cred'
>  * hoses p2k because puffs transmits the creds separately and
>  * allocates distinct but equivalent structures for them.
>  */
> KASSERT(kauth_cred_uidmatch(cred, tcnp->cn_cred));
> 
> 
> Can you still repeat the crash when you change the assertion
> to match the genfs check ?

Unless I did something wrong with rebuilding rump_msdos, the problem still
exists when using that assertion instead. But the message from the assertion
failure now goes into the void. (Although that somehow also happens if I
use the original rump_msdos executable)

Here is how I tested (I used a file system in a file this time rather
than the real partition):

terminal 1:

$ ls -l efi.img  rump_msdos
-rw-r--r--  1 rhialto  wheel  134217728 May  2 22:32 efi.img
-r-xr-xr-x  1 rhialto  wheel  20776 May  2 22:29 rump_msdos*
$ sudo ./rump_msdos -o rw -o rump ./efi.img /tmp/t
rump_msdos: "./efi.img" is a relative path.
rump_msdos: using "/mnt/scratch/scratch/tmp/xcrash/efi.img" instead.
[   1.000] entropy: ready

terminal 2:

$ cd /tmp/t
$ ls -l
total 4
drwxr-xr-x  1 rhialto  wheel  4096 Apr 21  2021 efi/
-rwxr-xr-x  1 rhialto  wheel 0 May  2 22:32 file*
$ mv file file2
mv: rename file to file2: Device not configured
$ ls -l
ls: .: No such file or directory

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert
\X/ There is no AI. There is just someone else's work.   --I. Rose


signature.asc
Description: PGP signature


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Michael van Elst
rhia...@falu.nl (Rhialto) writes:

>I had something similar recently when doing a rename of a file on a FAT
>file system (in this case my /efi file system). Fortunately I had it
>mounted with -o rump, because it was 100% repeatable.

>I filed http://gnats.netbsd.org/58146 for it.


Maybe that's rump.

msdosfs:
KASSERT(tcnp->cn_cred == cred);

genfs:  /*
 * XXX Want a better equality test.  `tcnp->cn_cred == cred'
 * hoses p2k because puffs transmits the creds separately and
 * allocates distinct but equivalent structures for them.
 */
KASSERT(kauth_cred_uidmatch(cred, tcnp->cn_cred));


Can you still repeat the crash when you change the assertion
to match the genfs check ?




Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Thu, May 02, 2024 at 08:12:06PM +0200, Martin Husemann wrote:
> On Thu, May 02, 2024 at 08:04:28PM +0200, Rhialto wrote:
> > I filed http://gnats.netbsd.org/58146 for it.
> 
> Why do you think those issue are related? Sounds very unlikely to me.

To ellaborate on this:

 - the original issue reported here is *something else* mangling/breaking
   a FAT file system and NetBSD not dealing with the result. This can
   either be a bug in Solaris or in NetBSD's interpration of the FAT
   file system format - we just don't know (yet).

   An image of a file system in broken state is absolutely required here
   to debug the issue.

   If the OP can't provide such an image, we need a *working recipe* how
   to reproduce the issue, plus someone with a Solaris 10 installation
   to create the broken image, plus someone to debug the result.
   Currently we have neither the recipe nor someone with Solaris 10 installed
   willing to help.

 - PR 58146 looks like a NetBSD local locking issue/race condition. The
   file system image you offered probably will not be helpfull, we need
   to do carefull reading of the relevant locking paths in the code.


Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Thu, May 02, 2024 at 08:04:28PM +0200, Rhialto wrote:
> I filed http://gnats.netbsd.org/58146 for it.

Why do you think those issue are related? Sounds very unlikely to me.

Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Rhialto
On Thu 02 May 2024 at 11:41:13 +0200, Martin Husemann wrote:
> On Wed, May 01, 2024 at 05:08:04PM +, xuser wrote:
> > This is as much as a I can give you
> > It say some thing about invalid fats
> > i cant see much because the screen go blank
> > As for the core dump i don't have enough swap space
> 
> Can you provdie an image of a filesystem that shows this bug?
> Maybe create a new empty one (on a usb stick?) and make it bad (however
> that is done), then dump the stick's content and only after that try if
> it triggers your crash. If it does, upload the image somewhere and send
> the URL.

I had something similar recently when doing a rename of a file on a FAT
file system (in this case my /efi file system). Fortunately I had it
mounted with -o rump, because it was 100% repeatable.

I filed http://gnats.netbsd.org/58146 for it.

> Martin
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert
\X/ There is no AI. There is just someone else's work.   --I. Rose


signature.asc
Description: PGP signature


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Lucifer
there's gotta be a better way to debug this

On Thu, May 2, 2024 at 5:41 AM Martin Husemann  wrote:

> On Wed, May 01, 2024 at 05:08:04PM +, xuser wrote:
> > This is as much as a I can give you
> > It say some thing about invalid fats
> > i cant see much because the screen go blank
> > As for the core dump i don't have enough swap space
>
> Can you provdie an image of a filesystem that shows this bug?
> Maybe create a new empty one (on a usb stick?) and make it bad (however
> that is done), then dump the stick's content and only after that try if
> it triggers your crash. If it does, upload the image somewhere and send
> the URL.
>
> Thanks,
>
> Martin
>


-- 
renegade6969...@gmail.com
https://www.facebook.com/profile.php?id=61556020800880
https://twitter.com/Rose29283220654


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Wed, May 01, 2024 at 05:08:04PM +, xuser wrote:
> This is as much as a I can give you
> It say some thing about invalid fats
> i cant see much because the screen go blank
> As for the core dump i don't have enough swap space

Can you provdie an image of a filesystem that shows this bug?
Maybe create a new empty one (on a usb stick?) and make it bad (however
that is done), then dump the stick's content and only after that try if
it triggers your crash. If it does, upload the image somewhere and send
the URL.

Thanks,

Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread xuser

This is as much as a I can give you
It say some thing about invalid fats
i cant see much because the screen go blank
As for the core dump i don't have enough swap space


On Wed, 1 May 2024, Martin Husemann wrote:


On Tue, Apr 30, 2024 at 10:25:09PM +, xuser wrote:

Netbsd crashes when using fat that solaris 10 has modified.


Can you give any details (e.g. the exact kernel output from the crash),
provide a copy of the "modified" filesystem, or the kernel crash dump?

Martin





Re: netbsd crashes when using fat filesys

2024-04-30 Thread Martin Husemann
On Tue, Apr 30, 2024 at 10:25:09PM +, xuser wrote:
> Netbsd crashes when using fat that solaris 10 has modified.

Can you give any details (e.g. the exact kernel output from the crash),
provide a copy of the "modified" filesystem, or the kernel crash dump?

Martin