]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 days agosmb/client: remove useless comment in mapping_table_ERRSRV
Huiwen He [Wed, 21 Jan 2026 11:49:12 +0000 (19:49 +0800)] 
smb/client: remove useless comment in mapping_table_ERRSRV

These array elements have already been defined.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: remove some literal NT error codes from ntstatus_to_dos_map
Huiwen He [Wed, 21 Jan 2026 11:49:11 +0000 (19:49 +0800)] 
smb/client: remove some literal NT error codes from ntstatus_to_dos_map

When an NT error code is not in ntstatus_to_dos_map, ntstatus_to_dos()
will return the default ERRHRD and ERRGENERAL.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_VOLUME_NOT_UPGRADED
Huiwen He [Wed, 21 Jan 2026 11:49:10 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_VOLUME_NOT_UPGRADED

See MS-ERREf 2.3.1 STATUS_VOLUME_NOT_UPGRADED.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_NO_USER_KEYS
Huiwen He [Wed, 21 Jan 2026 11:49:09 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_NO_USER_KEYS

See MS-ERREf 2.3.1 STATUS_NO_USER_KEYS.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_WRONG_EFS
Huiwen He [Wed, 21 Jan 2026 11:49:08 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_WRONG_EFS

See MS-ERREf 2.3.1 STATUS_WRONG_EFS.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_NO_EFS
Huiwen He [Wed, 21 Jan 2026 11:49:07 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_NO_EFS

See MS-ERREf 2.3.1 STATUS_NO_EFS.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_NO_RECOVERY_POLICY
Huiwen He [Wed, 21 Jan 2026 11:49:06 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_NO_RECOVERY_POLICY

See MS-ERREf 2.3.1 STATUS_NO_RECOVERY_POLICY.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_RANGE_NOT_FOUND
Huiwen He [Wed, 21 Jan 2026 11:49:05 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_RANGE_NOT_FOUND

See MS-ERREf 2.3.1 STATUS_RANGE_NOT_FOUND.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_DECRYPTION_FAILED
Huiwen He [Wed, 21 Jan 2026 11:49:04 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_DECRYPTION_FAILED

See MS-ERREf 2.3.1 STATUS_DECRYPTION_FAILED.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_ENCRYPTION_FAILED
Huiwen He [Wed, 21 Jan 2026 11:49:03 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_ENCRYPTION_FAILED

See MS-ERREf 2.3.1 STATUS_ENCRYPTION_FAILED.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_DIRECTORY_IS_A_REPARSE_POINT
Huiwen He [Wed, 21 Jan 2026 11:49:02 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_DIRECTORY_IS_A_REPARSE_POINT

See MS-ERREf 2.3.1 STATUS_DIRECTORY_IS_A_REPARSE_POINT.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_VOLUME_DISMOUNTED
Huiwen He [Wed, 21 Jan 2026 11:49:01 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_VOLUME_DISMOUNTED

See MS-ERREf 2.3.1 STATUS_VOLUME_DISMOUNTED.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT
Huiwen He [Wed, 21 Jan 2026 11:49:00 +0000 (19:49 +0800)] 
smb/client: add NT_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT

See MS-ERREf 2.3.1 STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_VARIABLE_NOT_FOUND
Huiwen He [Wed, 21 Jan 2026 11:48:59 +0000 (19:48 +0800)] 
smb/client: add NT_STATUS_VARIABLE_NOT_FOUND

See MS-ERREf 2.3.1 STATUS_VARIABLE_NOT_FOUND.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: rename ERRinvlevel to ERRunknownlevel
Huiwen He [Wed, 21 Jan 2026 11:48:58 +0000 (19:48 +0800)] 
smb/client: rename ERRinvlevel to ERRunknownlevel

See MS-CIFS 2.2.2.4 ERRunknownlevel. Keep the name consistent with the
documentation.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: add NT_STATUS_OS2_INVALID_LEVEL
Huiwen He [Wed, 21 Jan 2026 11:48:57 +0000 (19:48 +0800)] 
smb/client: add NT_STATUS_OS2_INVALID_LEVEL

See MS-CIFS 2.2.2.4 STATUS_OS2_INVALID_LEVEL.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: map NT_STATUS_INVALID_INFO_CLASS to ERRbadpipe
Huiwen He [Wed, 21 Jan 2026 11:48:56 +0000 (19:48 +0800)] 
smb/client: map NT_STATUS_INVALID_INFO_CLASS to ERRbadpipe

See MS-CIFS 2.2.2.4 STATUS_INVALID_INFO_CLASS.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: introduce KUnit test to check search result of smb2_error_map_table
ChenXiaoSong [Sun, 18 Jan 2026 09:13:13 +0000 (17:13 +0800)] 
smb/client: introduce KUnit test to check search result of smb2_error_map_table

The KUnit test are executed when cifs.ko is loaded.

Just like `fs/ext4/mballoc.c` includes `fs/ext4/mballoc-test.c`.
`smb2maperror.c` also includes `smb2maperror_test.c`, allowing KUnit
tests to access any functions and variables in `smb2maperror.c`.

The maperror_test_check_search() checks whether all elements can be
correctly found in the array.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: use bsearch() to find target in smb2_error_map_table
ChenXiaoSong [Tue, 23 Dec 2025 09:24:40 +0000 (17:24 +0800)] 
smb/client: use bsearch() to find target in smb2_error_map_table

The smb2_error_map_table array currently has 1740 elements. When searching
for the last element, the original loop-based search method requires 1740
comparisons, while binary search algorithm requires only 10 comparisons.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/linux-cifs/20260106071507.1420900-5-chenxiaosong.chenxiaosong@linux.dev/
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb/client: check whether smb2_error_map_table is sorted in ascending order
ChenXiaoSong [Wed, 24 Dec 2025 01:33:28 +0000 (09:33 +0800)] 
smb/client: check whether smb2_error_map_table is sorted in ascending order

Although the array is sorted at build time, verify the ordering again
when cifs.ko is loaded to avoid potential regressions introduced by
future script changes.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/linux-cifs/20260106071507.1420900-4-chenxiaosong.chenxiaosong@linux.dev/
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Autogenerate SMB2 error mapping table
David Howells [Tue, 23 Dec 2025 00:05:34 +0000 (00:05 +0000)] 
cifs: Autogenerate SMB2 error mapping table

Autogenerate the SMB2 status to error code mapping table, from the
smb2status.h common header, sorting it by NT status code so that it can be
searched by binary chopping. This also reduces the number of places this
list is duplicated in the source.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <stfrench@microsoft.com>
cc: ChenXiaoSong <chenxiaosong@kylinos.cn>
cc: linux-cifs@vger.kernel.org
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/linux-cifs/20260106071507.1420900-3-chenxiaosong.chenxiaosong@linux.dev/
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Label SMB2 statuses with errors
David Howells [Tue, 23 Dec 2025 00:04:01 +0000 (00:04 +0000)] 
cifs: Label SMB2 statuses with errors

Label the SMB2 status entries with error codes as a prelude to
autogenerating the mapping table.  This was done with the following script:

        #!/usr/bin/perl -w
        use strict;

        my @error_mapping_table = ();
        my %statuses = ();

        #
        # Read the status list
        #
        my $f = "fs/smb/common/smb2status.h";
        open FILE, "<$f" || die $f;
        my @contents = <FILE>;
        close FILE || die;

        my $l = 0;
        foreach (@contents) {
            $l++;
            if (m!^#define\s*([A-Za-z0-9_]+)\s+cpu_to_le32[(]([0-9a-fA-Fx]+)[)]!) {
                my $status = $1;
                my $code = $2;
                my $s;

                next if ($status =~ /^STATUS_SEVERITY/);

                if (exists($statuses{$status})) {
                    print("$f:$l: Duplicate declaration of ", $s->{status}, "\n");
                } else {
                    my %_s = (
                        status => $status,
                        code   => hex($code)
                        );
                    $statuses{$status} = \%_s;
                }
            }
        }

        #
        # Read the SMB2 status => error mapping table
        #
        $f = "fs/smb/client/smb2maperror.c";
        open(MFILE, "<$f") || die $f;
        my @maperror = <MFILE>;
        close MFILE || die;

        my $parse = 0;
        my $acc = "";
        $l = 0;
        foreach my $line (@maperror) {
            chomp $line;
            $l++;
            if ($parse == 0 &&
                $line =~ /^static const struct status_to_posix_error smb2_error_map_table/) {
                $parse = 1;
                next;
            }

            last if ($parse >= 1 && $line =~ /^[}];/);

            if ($parse == 1) {
                if ($line =~ /[\t][{].*[}],/) {
                    $acc = $line;
                    $parse = 3;
                } elsif ($line =~ /[\t][{].*/) {
                    $acc = $line;
                    $parse = 2;
                    next;
                } elsif ($line =~ m!^\s*/[*].*[*]/!) {
                    next;
                } else {
                    die "smb2maperror.c:$l: unparseable mapping element\n";
                }
            }
            if ($parse == 2) {
                if ($line =~ /.*[}],/) {
                    $acc .= $line;
                    $parse = 3;
                } else {
                    $acc .= $line;
                }
            }

            if ($parse == 3) {
                $acc =~ s/\s+//g;
                if ($acc =~ m/[{](.*)[}]/) {
                    $acc = $1;
                } else {
                    die "'$acc'";
                }
                my ($status, $error, $string) = split(/,/, $acc);

                if (exists($statuses{$status})) {
                    my $s = $statuses{$status};

                    if (exists($s->{error})) {
                        print("$f:$l: Dup mapping entry $status\n");
                    }

                    $s->{error} = $error;
                    #print $s->{code}, " => ", $error, "\n";
                } else {
                    print STDERR "$f:$l: Unknown status $status\n";
                }

                $acc = "";
                $parse = 1;
            }
        }

        #
        # Sort the error table by STATUS_* value
        #
        my @order = ();

        foreach my $status (keys(%statuses)) {
            my $s = $statuses{$status};
            push @order, $s;
            unless (exists($s->{code})) {
                print("Unknown code for ", $s->{status}, "\n")
            } else {
                #print("Code for ", $s->{status}, " is ", $s->{code}, "\n");
            }
        }

        @order = sort( { $a->{code} <=> $b->{code} } @order);

        foreach my $s (@order) {
            my $status = $s->{status};
            my $error  = $s->{error};
            my $code   = $s->{code};

            my $pad = " ";
            if (length($status) < 32) {
                my $n = 32 - length($status);
                $pad = "\t" x ((($n-1) / 8) + 1);
            }
            #printf("#define %s%scpu_to_le32(0x%08x) // -%s\n", $status, $pad, $code, $error);
            #printf("\t%s%s= 0x%08x, // -%s\n", $status, $pad, $code, $error);
        }

        #
        # Decorate the definitions
        #
        my @output = ();
        for (my $i = 0; $i <= $#contents; $i++) {
            my $line = $contents[$i];
            if ($line =~ m!^#define\s*([A-Za-z0-9_]+)\s+cpu_to_le32[(]([0-9a-fA-Fx]+)[)]!) {
                my $status = $1;
                my $code = $2;

                if ($status =~ /^STATUS_SEVERITY/) {
                    push @output, $line;
                    next;
                }

                my $pad = " ";
                if (length($status) < 40) {
                    my $n = 40 - length($status);
                    $pad = "\t" x ((($n-1) / 8) + 1);
                }

                my $s = $statuses{$1};
                my $error = "EIO";
                if (exists($s->{error})) {
                    $error = $s->{error};
                } else {
                    if (!$s->{code}) {
                        print "ZERO ", $status, "\n";
                        $error = "0";
                    } else {
                        $error = "-EIO";
                    }
                }

                #my $rev = "#define " . $status . $pad . "_S(" . $2 . ", " . $error . ")\n";
                my $rev = "#define " . $status . $pad . "cpu_to_le32(" . $2 . ") // " . $error . "\n";

                push @output, $rev;
            } else {
                push @output, $line;
            }
        }

        open FILE, ">fs/smb/common/smb2status.h" || die;
        print FILE @output;
        close FILE || die;

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <stfrench@microsoft.com>
cc: ChenXiaoSong <chenxiaosong@kylinos.cn>
cc: linux-cifs@vger.kernel.org
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/linux-cifs/20260106071507.1420900-2-chenxiaosong.chenxiaosong@linux.dev/
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Make BCC accessors conditional
David Howells [Wed, 17 Dec 2025 21:23:56 +0000 (21:23 +0000)] 
cifs: SMB1 split: Make BCC accessors conditional

Make the BCC accessor functions conditional.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: connect.c
David Howells [Wed, 17 Dec 2025 17:41:38 +0000 (17:41 +0000)] 
cifs: SMB1 split: connect.c

Split SMB1-specific connection management stuff to smb1ops.c and move
CIFSTCon() to cifssmb.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: sess.c
David Howells [Wed, 17 Dec 2025 16:14:36 +0000 (16:14 +0000)] 
cifs: SMB1 split: sess.c

Split SMB1-specific session setup stuff into smb1session.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: cifsencrypt.c
David Howells [Wed, 17 Dec 2025 15:34:08 +0000 (15:34 +0000)] 
cifs: SMB1 split: cifsencrypt.c

Split SMB1-specific message signing into smb1encrypt.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: netmisc.c
David Howells [Wed, 17 Dec 2025 15:25:59 +0000 (15:25 +0000)] 
cifs: SMB1 split: netmisc.c

Split a variety of bits from netmisc.c into other places, notably the error
table into smb1maperror.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: misc.c
David Howells [Wed, 17 Dec 2025 15:22:19 +0000 (15:22 +0000)] 
cifs: SMB1 split: misc.c

Split SMB1 bits from misc.c to smb1misc.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: cifs_debug.c
David Howells [Wed, 17 Dec 2025 12:53:23 +0000 (12:53 +0000)] 
cifs: SMB1 split: cifs_debug.c

Split SMB1 bits from cifs_debug.c to smb1debug.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Move inline funcs
David Howells [Wed, 17 Dec 2025 15:14:22 +0000 (15:14 +0000)] 
cifs: SMB1 split: Move inline funcs

Move some SMB1-specific inline funcs to smb1proto.h.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Fix cifs_dump_mids() to call ->dump_detail
David Howells [Wed, 17 Dec 2025 15:44:07 +0000 (15:44 +0000)] 
cifs: Fix cifs_dump_mids() to call ->dump_detail

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Don't return smb_hdr from cifs_{,small_}buf_get()
David Howells [Wed, 17 Dec 2025 17:47:22 +0000 (17:47 +0000)] 
cifs: SMB1 split: Don't return smb_hdr from cifs_{,small_}buf_get()

Return void* rather than struct smb_hdr* from from cifs_buf_get() and
cifs_small_buf_get() as SMB2/3 shouldn't be accessing smb_hdr.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Move BCC access functions
David Howells [Wed, 17 Dec 2025 15:09:39 +0000 (15:09 +0000)] 
cifs: SMB1 split: Move BCC access functions

Move the BCC access functions to smb1proto.h as they're only applicable to
SMB1.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Adjust #includes
David Howells [Wed, 17 Dec 2025 15:03:25 +0000 (15:03 +0000)] 
cifs: SMB1 split: Adjust #includes

Adjust the #include set after the removal of the SMB1 protocol defs from
cifspdu.h.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h
David Howells [Wed, 17 Dec 2025 13:22:00 +0000 (13:22 +0000)] 
cifs: SMB1 split: Split SMB1 protocol defs into smb1pdu.h

Split SMB1 protocol defs into smb1pdu.h.  This should perhaps go in the
common/ directory.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Add some #includes
David Howells [Wed, 17 Dec 2025 22:06:22 +0000 (22:06 +0000)] 
cifs: SMB1 split: Add some #includes

Add some #includes to make sure things continue to compile as splitting
occurs.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Move some SMB1 received PDU checking bits to smb1transport.c
David Howells [Thu, 11 Sep 2025 13:09:17 +0000 (14:09 +0100)] 
cifs: SMB1 split: Move some SMB1 received PDU checking bits to smb1transport.c

Move some SMB1 received checking bits to smb1transport.c from misc.c
so that they're with the rest of the receive handling code.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Move some SMB1 receive bits to smb1transport.c
David Howells [Wed, 10 Sep 2025 07:47:09 +0000 (08:47 +0100)] 
cifs: SMB1 split: Move some SMB1 receive bits to smb1transport.c

Move some SMB1 receive bits to smb1transport.c from smb1ops.c where they're
mixed in with unrelated code to do with encoding, decoding and processing
PDUs.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Separate out SMB1 decls into smb1proto.h
David Howells [Wed, 17 Dec 2025 09:42:22 +0000 (09:42 +0000)] 
cifs: SMB1 split: Separate out SMB1 decls into smb1proto.h

Separate out SMB1 declarations scriptedly into smb1proto.h.  Script below:

#!/usr/bin/perl -w
use strict;
unless (@ARGV) {
    die "Usage: $0 <c_file1> [<c_file2> ...]\n";
}

# Data tracking
my %funcs = (); # Func name => { func prototype }
my %headers = (); # Header filename => { header content }
my %c_files = (); # C filename => { ordered func list, header pref }
my %cmarkers = (); # C filename marker => { header filename it's in }

# Parse state
my $pathname = "-";
my $lineno = 0;

sub error(@) {
    print STDERR $pathname, ":", $lineno, ": ", @_, "\n";
    exit(1);
}

sub pad($) {
    # Reindent the function arguments to line the arguments up with the char
    # after the opening bracket on the func argument list
    my ($lines) = @_;
    return $lines if ($#{$lines} <= 0);
    my $has_empty = 0;
    for (my $i = 0; $i <= $#{$lines}; $i++) {
$lines->[$i] =~ s/^[ \t]+//;
$has_empty = 1 if ($lines->[$i] eq "");
    }

    if ($has_empty) {
my @clean = grep /.+/, @{$lines};
$lines = \@clean;
    }

    my $indlen = index($lines->[0], "(");
    return $lines if ($indlen < 0);
    my $indent = "";
    $indlen++;
    $indent .= "\t" x ($indlen / 8);
    $indent .= " " x ($indlen % 8);

    my @padded = ();
    my $acc = "";
    my $len = -$indlen;
    for (my $i = 0; $i <= $#{$lines}; $i++) {
my $argument = $lines->[$i];
my $arglen = length($argument);
my $last = ($i == $#{$lines} ? 1 : 0);

if ($i == 0 ||
    $i == 1) {
    $acc .= $argument;
    $acc .= ";" if ($last);
    $len += $arglen + $last;
    next;
}
if (!$acc) {
    $acc = $indent . $argument;
    $acc .= ";" if ($last);
    $len += $arglen + $last;
    next;
}
if ($indlen + $len + 1 + $arglen + $last > 79) {
    push @padded, $acc;
    $acc = $indent . $argument;
    $acc .= ";" if ($last);
    $len = $arglen + $last;
    next;
}

$acc .= " " . $argument;
$acc .= ";" if ($last);
$len += 1 + $arglen + $last;
    }
    push @padded, $acc if ($acc);
    return \@padded;
}

sub earliest(@) {
    my $ret = -1;
    foreach (@_) {
$ret = $_ if ($ret < 0 || ($_ >= 0 && $_ < $ret));
    }
    return $ret;
}

foreach my $file (@ARGV) {
    # Open the file for reading.
    next if $file =~ /trace[.]h$/;
    next if $file =~ /smbdirect[.][ch]$/;
    open my $fh, "<$file"
or die "Could not open file '$file'";
    $pathname = $file;
    $lineno = 0;

    my $filename;
    my @file_content = ();
    my @copy = ();

    my $state = 0;
    my $qual = "";
    my $type = "";
    my $funcname = "";
    my @funcdef = ();
    my $bracket = 0;
    my $comment = 0;
    my $smb1 = 0;
    my $header = 0;
    my $inline = 0;
    my $file_marker = "";
    my $config = "";
    my $c_file = 0;

    $filename = $pathname;
    $filename =~ s!.*/!!;

    if ($file =~ m!.h$!) {
my %new_h_file = (
    path    => $pathname,
    fname   => $filename,
    content => [],
    );
$header = \%new_h_file;
$headers{$filename} = \%new_h_file;
    } elsif ($file =~ m!.c$!) {
my %new_c_file = (
    path  => $pathname,
    fname => $filename,
    funcs => [],
    );
$c_file = \%new_c_file;
$c_files{$filename} = \%new_c_file;
    } else {
warn("Ignoring unexpected file $file\n");
next;
    }

    $smb1 = 1 if ($file =~ m!/smb1ops.c|/cifssmb.c|/cifstransport.c!);

    foreach my $line (<$fh>) {
$lineno++;
chomp($line);
push @copy, $line;
if (!$line) {
    # Blank line
    push @file_content, @copy;
    @copy = ();
    next;
}

# Handle continuation or end of block comment.  Look for C file
# prototype insertion point markers.
if ($comment) {
    if ($line =~ m![*]/!) {
if ($comment == 2 && $file_marker) {
    $cmarkers{$file_marker} = $file_marker;
    push @copy, "#C_MARKER " . $file_marker;
    $file_marker = 0;
}
$comment = 0;
    } else {
$comment++;
if ($comment == 2 && $line =~ m! [*] ([a-z][a-z_0-9]*[.][c])$!) {
    $file_marker = $1;
    print("Found file marker ", $file_marker, " in ", $filename, "\n");
}
    }
    push @file_content, @copy;
    @copy = ();
    next;
}

# Check cpp directives, particularly looking for SMB1 bits
if ($line =~ /^[#]/) {
    if ($header) {
if ($line =~ /ifdef.*(CONFIG_[A-Z0-9_])/) {
    error("multiconfig") if $config;
    $config = $1;
    $smb1++ if ($config eq "CONFIG_CIFS_ALLOW_INSECURE_LEGACY");
} elsif ($line =~ /endif/) {
    $smb1-- if ($config eq "CONFIG_CIFS_ALLOW_INSECURE_LEGACY");
    $config = "";
}
    }
    push @file_content, @copy;
    @copy = ();
    next;
}

# Exclude interference in finding func names and return types
if ($line =~ /^[{]/ ||
    $line =~ /##/ ||
    $line =~ /^[_a-z0-9A-Z]+:$/ || # goto label
    $line =~ /^do [{]/ ||
    $line =~ m!^//!) {
    push @file_content, @copy;
    @copy = ();
    next;
}

# Start of a block comment
if ($line =~ m!^/[*]!) {
    $comment = 1 unless ($line =~ m![*]/!);
    push @file_content, @copy;
    @copy = ();
    next;
}

# End of a braced section, such as a function implementation
if ($line =~ /^[}]/) {
$type = "";
$qual = "";
$funcname = "";
@funcdef = ();
push @file_content, @copy;
@copy = ();
next;
}

if ($line =~ /^typedef/) {
    $type = "";
    $qual = "";
    $funcname = "";
    @funcdef = ();
    push @file_content, @copy;
    @copy = ();
    next;
}

# Extract function qualifiers.  There may be multiple of these in more
# or less any order.  Some of them cause the func to be skipped (e.g. inline).

if ($line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)\W/ ||
    $line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)$/) {
    error("Unexpected qualifier '$1'") if ($state != 0);
    while ($line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)\W/ ||
   $line =~ /^(static|extern|inline|noinline|noinline_for_stack|__always_inline)$/) {
$qual .= " " if ($qual);
$qual .= $1;
$inline = 1 if ($1 eq "inline");
$inline = 1 if ($1 eq "__always_inline");
$line = substr($line, length($1));
$line =~ s/^\s+//;
    }
}

if ($state == 0) {
    # Extract what we assume to be the return type
    if ($line =~ /^\s/) {
push @file_content, @copy;
@copy = ();
next;
    }
    while ($line =~ /^(unsigned|signed|bool|char|short|int|long|void|const|volatile|(struct|union|enum)\s+[_a-zA-Z][_a-zA-Z0-9]*|[*]|__init|__exit|__le16|__le32|__le64|__be16|__be32|__be64)/) {
$type .= " " if $type;
$type .= $1;
$line = substr($line, length($1));
$line =~ s/^\s+//;
    }
    if ($line =~ /^struct [{]/) {
# Ignore structure definitions
$type = "";
$qual = "";
$funcname = "";
@funcdef = ();
push @file_content, @copy;
@copy = ();
next;
    }
    if (index($line, "=") >= 0) {
# Ignore assignments
$type = "";
$qual = "";
$funcname = "";
@funcdef = "";
push @file_content, @copy;
@copy = ();
next;
    }

    # Try and extract a function's type and name
    while ($line =~ /(^[_a-zA-Z][_a-zA-Z0-9]*)/) {
my $name = $1;
$line = substr($line, length($name));
next if ($line =~ /^[{]/);
$line =~ s/^\s+//;

my $ch = substr($line, 0, 1);
last if ($ch eq "[" || $ch eq ";"); # Global variables

if ($ch eq "(") {
    # Found the function name
    $state = 1;
    $line = substr($line, 1);
    $funcname = $name;
    my $tmp = $qual . $type . " " . $funcname . "(";
    $tmp =~ s/[*] /*/;
    push @funcdef, $tmp;
    $bracket = 1;
    last;
}

if ($type) {
    last if (index($line, ";") >= 0 && index($line, "(") == -1);
    error("Unexpected name '$name' after '$type'");
}

$type .= " " if $type;
$type .= $name;
if ($line =~ /^(\s*[*]+)/) {
    my $ptr = $1;
    $type .= $ptr;
    $line = substr($line, length($ptr));
}
    }
}

# Try and extract a function's argument list
my $from = 0;
if ($state == 1) {
    while (1) {
my $o = index($line, "(", $from);
my $c = index($line, ")", $from);
my $m = index($line, ",", $from);

my $b = earliest($o, $c, $m);
if ($b < 0) {
    push @funcdef, $line
unless ($line eq "");
    last;
}
my $ch = substr($line, $b, 1);

# Push the arguments separately on to the list
if ($ch eq ",") {
    push @funcdef, substr($line, 0, $b + 1);
    $line = substr($line, $b + 1);
    $from = 0;
} elsif ($ch eq "(") {
    # Handle brackets in the argument list (e.g. function
    # pointers)
    $bracket++;
    $from = $b + 1;
} elsif ($ch eq ")") {
    $bracket--;
    if ($bracket == 0) {
push @funcdef, substr($line, 0, $b + 1);
$line = substr($line, $b + 1);
$state = 2;
last;
    }
    $from = $b + 1;
}
    }
}

if ($state == 2) {
    $inline = 1 if ($qual =~ /inline/);
    #print("QUAL $qual $type $funcname $inline ", $#funcdef, "\n");
    if (!$header &&
$qual !~ /static/ &&
$funcname ne "__acquires" &&
$funcname ne "__releases" &&
$funcname ne "module_init" &&
$funcname ne "module_exit" &&
$funcname ne "module_param" &&
$funcname ne "module_param_call" &&
$funcname ne "PROC_FILE_DEFINE" &&
$funcname !~ /MODULE_/ &&
$funcname !~ /DEFINE_/) {

# Okay, we appear to have a function implementation
my $func;
my $dup = 0;

if (exists($funcs{$funcname})) {
    $func = $funcs{$funcname};
    if (exists $func->{body}) {
print("dup $funcname\n");
$dup = 1;
    }
} else {
    my %new_func = (
name => $funcname,
cond => "",
legacy => 0,
);
    $func = \%new_func;
    $funcs{$funcname} = $func;
    $func->{body} = pad(\@funcdef);
}
$func->{body} = pad(\@funcdef);
$func->{legacy} = 1 if $smb1;

if ($funcname eq "cifs_inval_name_dfs_link_error") {
    $func->{cond} = "#ifdef CONFIG_CIFS_DFS_UPCALL";
} elsif ($funcname eq "cifs_listxattr") {
    $func->{cond} = "#ifdef CONFIG_CIFS_XATTR";
}

push @{$c_file->{funcs}}, $func
    unless $dup;
    } elsif (!$header || $inline) {
# Ignore inline function implementations and other weirdies
push @file_content, @copy;
    } elsif ($header && !$inline) {
push @file_content, "#FUNCPROTO " . $funcname;

my $func;

if (exists($funcs{$funcname})) {
    $func = $funcs{$funcname};
    $func->{lineno} = $lineno;
    $func->{pathname} = $pathname;
} else {
    my %new_func = (
name => $funcname,
cond => "",
lineno => $lineno,
pathname => $pathname,
legacy => 0,
);
    $func = \%new_func;
    $funcs{$funcname} = $func;
}

$func->{legacy} = 1 if $smb1;
    }

    @funcdef = ();
    $type = "";
    $qual = "";
    $funcname = "";
    $inline = 0;
    $state = 0;
    @copy = ();
}
if ($line =~ /;/) {
    $type = "";
    $qual = "";
    $funcname = "";
    @funcdef = ();
    $state = 0;
    push @file_content, @copy;
    @copy = ();
}
    }
    close($fh);

    if ($header) {
$header->{content} = \@file_content;
    }
}

sub write_header($)
{
    my ($header) = @_;
    my $path = $header->{path};
    my $legacy = 0;

    $legacy = 1 if ($path =~ m!smb1proto[.]h!);

    my @output = ();

    foreach my $line (@{$header->{content}}) {
if ($line =~ "^[#]C_MARKER (.*)") {
    my $file_marker = $cmarkers{$1};
    my $c_file = $c_files{$file_marker};
    print("Found $line\n");
    foreach my $func (@{$c_file->{funcs}}) {
print("func ", $func->{name}, "\n");
push @output, @{$func->{body}};
    }
    next;
} elsif ($line =~ "^[#]FUNCPROTO ([_a-zA-Z0-9]+)") {
    my $funcname = $1;
    my $func = $funcs{$funcname};
    if (!$func->{body}) {
print($func->{pathname}, ":", $func->{lineno}, ": '", $funcname,
      "' dead prototype\n");
next;
    }
    if ($func->{legacy} == $legacy) {
#push @output, $line;
push @output, @{$func->{body}};
    }
} else {
    push @output, $line;
}
    }

    open my $fh, ">$path"
or die "Could not open file '$path' for writing";
    foreach my $f (@output) {
print($fh $f, "\n") or die $path;
    }
    close($fh) or die $path;
}

foreach my $h (keys(%headers)) {
    write_header($headers{$h});
}

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Create smb1proto.h for SMB1 declarations
David Howells [Wed, 17 Dec 2025 09:54:35 +0000 (09:54 +0000)] 
cifs: SMB1 split: Create smb1proto.h for SMB1 declarations

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: SMB1 split: Rename cifstransport.c
David Howells [Wed, 17 Dec 2025 16:10:05 +0000 (16:10 +0000)] 
cifs: SMB1 split: Rename cifstransport.c

Rename cifstransport.c to smb1transport.c in order to give consistent names
SMB1-specific files.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/ntlmssp.h
David Howells [Thu, 11 Dec 2025 11:50:51 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/ntlmssp.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/reparse.h
David Howells [Thu, 11 Dec 2025 11:50:51 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/reparse.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/smb2proto.h
David Howells [Thu, 11 Dec 2025 11:50:51 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/smb2proto.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifs_debug.h
David Howells [Thu, 11 Dec 2025 11:50:51 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifs_debug.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifs_swn.h
David Howells [Thu, 11 Dec 2025 11:50:50 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifs_swn.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/compress.h
David Howells [Thu, 11 Dec 2025 11:50:50 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/compress.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifs_spnego.h
David Howells [Thu, 11 Dec 2025 11:50:49 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifs_spnego.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/fs_context.h
David Howells [Thu, 11 Dec 2025 11:50:49 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/fs_context.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/fscache.h
David Howells [Thu, 11 Dec 2025 11:50:49 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/fscache.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifsglob.h
David Howells [Thu, 11 Dec 2025 11:50:49 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifsglob.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/dns_resolve.h
David Howells [Thu, 11 Dec 2025 11:50:48 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/dns_resolve.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/dfs_cache.h
David Howells [Thu, 11 Dec 2025 11:50:48 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/dfs_cache.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifsfs.h
David Howells [Thu, 11 Dec 2025 11:50:47 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifsfs.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/netlink.h
David Howells [Thu, 11 Dec 2025 11:50:46 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/netlink.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifs_unicode.h
David Howells [Thu, 11 Dec 2025 11:50:46 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifs_unicode.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cifsproto.h
David Howells [Thu, 11 Dec 2025 11:50:45 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cifsproto.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/dfs.h
David Howells [Thu, 11 Dec 2025 11:50:45 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/dfs.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Scripted clean up fs/smb/client/cached_dir.h
David Howells [Thu, 11 Dec 2025 11:50:44 +0000 (11:50 +0000)] 
cifs: Scripted clean up fs/smb/client/cached_dir.h

Remove externs, correct argument names and reformat declarations.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: add multichannel async work for CONFIG_CIFS_DFS_UPCALL=n
Henrique Carvalho [Mon, 19 Jan 2026 16:42:13 +0000 (13:42 -0300)] 
smb: client: add multichannel async work for CONFIG_CIFS_DFS_UPCALL=n

Multichannel support is independent of DFS configuration. Extend the
async multichannel setup to non-DFS cifs.ko.

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: introduce multichannel async work during mount
Henrique Carvalho [Mon, 19 Jan 2026 16:42:12 +0000 (13:42 -0300)] 
smb: client: introduce multichannel async work during mount

Mounts can experience large delays when servers advertise interfaces
that are unreachable from the client.

To fix this, decouple channel addition from the synchronous mount path
by introducing struct mchan_mount and running channel setup as
background work.

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: prevent races in ->query_interfaces()
Henrique Carvalho [Mon, 19 Jan 2026 17:54:44 +0000 (14:54 -0300)] 
smb: client: prevent races in ->query_interfaces()

It was possible for two query interface works to be concurrently trying
to update the interfaces.

Prevent this by checking and updating iface_last_update under
iface_lock.

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: add proper locking around ses->iface_last_update
Henrique Carvalho [Mon, 19 Jan 2026 17:54:45 +0000 (14:54 -0300)] 
smb: client: add proper locking around ses->iface_last_update

There is a missing ses->iface_lock in cifs_setup_session,
around ses->iface_last_update.

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: split cached_fid bitfields to avoid shared-byte RMW races
Henrique Carvalho [Tue, 27 Jan 2026 16:01:28 +0000 (13:01 -0300)] 
smb: client: split cached_fid bitfields to avoid shared-byte RMW races

is_open, has_lease and on_list are stored in the same bitfield byte in
struct cached_fid but are updated in different code paths that may run
concurrently. Bitfield assignments generate byte read–modify–write
operations (e.g. `orb $mask, addr` on x86_64), so updating one flag can
restore stale values of the others.

A possible interleaving is:
    CPU1: load old byte (has_lease=1, on_list=1)
    CPU2: clear both flags (store 0)
    CPU1: RMW store (old | IS_OPEN) -> reintroduces cleared bits

To avoid this class of races, convert these flags to separate bool
fields.

Cc: stable@vger.kernel.org
Fixes: ebe98f1447bbc ("cifs: enable caching of directories for which a lease is held")
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Fix locking usage for tcon fields
Shyam Prasad N [Sat, 31 Jan 2026 18:51:13 +0000 (00:21 +0530)] 
cifs: Fix locking usage for tcon fields

We used to use the cifs_tcp_ses_lock to protect a lot of objects
that are not just the server, ses or tcon lists. We later introduced
srv_lock, ses_lock and tc_lock to protect fields within the
corresponding structs. This was done to provide a more granular
protection and avoid unnecessary serialization.

There were still a couple of uses of cifs_tcp_ses_lock to provide
tcon fields. In this patch, I've replaced them with tc_lock.

Cc: stable@vger.kernel.org
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: Corrections to lock ordering notes
Shyam Prasad N [Sat, 31 Jan 2026 18:51:12 +0000 (00:21 +0530)] 
cifs: Corrections to lock ordering notes

There were a couple of discrepencies in lock ordering for the locks
that were specified in the lock ordering notes. Did an analysis
of the current codebase (using LLM) and found two pairs whose ordering
in these notes were wrong. It also found one lock that was recently
removed, and a few locks that weren't documented here before.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: make retry logic in read/write path consistent with other paths
Shyam Prasad N [Sat, 31 Jan 2026 08:33:06 +0000 (14:03 +0530)] 
cifs: make retry logic in read/write path consistent with other paths

Today in most other code paths in cifs.ko, the decision of whether
to retry a command depends on two mount options: retrans and hard.
However, the read/write code paths diverged from this and would only
retry if the error returned was -EAGAIN. However, there are other
replayable errors in cifs.ko, for which is_replayable_errors helper
was written. This change makes read/write codepaths consistent with
other code-paths.

This change also does the following:
1. The SMB2 read/write code diverged significantly (presumably since
they were changed during netfs refactor at different times). This
changes the response verification logic to be consistent.
2. Moves the netfs tracepoints to slightly different locations in order
to make debugging easier.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agonetfs: avoid double increment of retry_count in subreq
Shyam Prasad N [Sat, 31 Jan 2026 08:33:05 +0000 (14:03 +0530)] 
netfs: avoid double increment of retry_count in subreq

This change fixes the instance of double incrementing of
retry_count. The increment of this count already happens
when netfs_reissue_write gets called. Incrementing this
value before is not necessary.

Fixes: 4acb665cf4f3 ("netfs: Work around recursion by abandoning retry if nothing read")
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agonetfs: when subreq is marked for retry, do not check if it faced an error
Shyam Prasad N [Sat, 31 Jan 2026 08:33:04 +0000 (14:03 +0530)] 
netfs: when subreq is marked for retry, do not check if it faced an error

The *_subreq_terminated functions today only process the NEED_RETRY
flag when the subreq was successful or failed with EAGAIN error.
However, there could be other retriable errors for network filesystems.

Avoid this by processing the NEED_RETRY irrespective of the error
code faced by the subreq. If it was specifically marked for retry,
the error code must not matter.

Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agocifs: on replayable errors back-off before replay, not after
Shyam Prasad N [Sat, 31 Jan 2026 08:33:03 +0000 (14:03 +0530)] 
cifs: on replayable errors back-off before replay, not after

On replayable errors, we call smb2_should_replays that does these
things today:
1. decide if we need to replay the command again
2. sleep to back-off the failed request
3. update the next sleep value

We will not be able to use this for async requests, when this is
processed in callbacks (as this will be called in cifsd threads that
should not sleep in response processing).

Modify the behaviour by taking the sleep out of smb2_should_replay
and performing the sleep for back-off just before actually
performing the replay.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agosmb: client: fix potential UAF and double free in smb2_open_file()
Paulo Alcantara [Thu, 5 Feb 2026 16:19:52 +0000 (13:19 -0300)] 
smb: client: fix potential UAF and double free in smb2_open_file()

Zero out @err_iov and @err_buftype before retrying SMB2_open() to
prevent an UAF bug if @data != NULL, otherwise a double free.

Fixes: e3a43633023e ("smb/client: fix memory leak in smb2_open_file()")
Reported-by: David Howells <dhowells@redhat.com>
Closes: https://lore.kernel.org/r/2892312.1770306653@warthog.procyon.org.uk
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
2 days agoLinux 6.19 v6.19
Linus Torvalds [Sun, 8 Feb 2026 21:03:27 +0000 (13:03 -0800)] 
Linux 6.19

3 days agoMerge tag 'i2c-for-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sun, 8 Feb 2026 17:17:46 +0000 (09:17 -0800)] 
Merge tag 'i2c-for-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fix from Wolfram Sang:

 - imx: preserve error state during SMBus block read length handling

* tag 'i2c-for-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: imx: preserve error state in block data length handler

4 days agoMerge tag 'spi-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
Linus Torvalds [Sat, 7 Feb 2026 17:37:34 +0000 (09:37 -0800)] 
Merge tag 'spi-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "One final batch of fixes for the Tegra SPI drivers, the main one is a
  batch of fixes for races with the interrupts in the Tegra210 QSPI
  driver that Breno has been working on for a while"

* tag 'spi-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: tegra114: Preserve SPI mode bits in def_command1_reg
  spi: tegra: Fix a memory leak in tegra_slink_probe()
  spi: tegra210-quad: Protect curr_xfer check in IRQ handler
  spi: tegra210-quad: Protect curr_xfer clearing in tegra_qspi_non_combined_seq_xfer
  spi: tegra210-quad: Protect curr_xfer in tegra_qspi_combined_seq_xfer
  spi: tegra210-quad: Protect curr_xfer assignment in tegra_qspi_setup_transfer_one
  spi: tegra210-quad: Move curr_xfer read inside spinlock
  spi: tegra210-quad: Return IRQ_HANDLED when timeout already processed transfer

4 days agoMerge tag 'regulator-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 7 Feb 2026 17:34:49 +0000 (09:34 -0800)] 
Merge tag 'regulator-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "One last fix for v6.19: the voltages for the SpaceMIT P1 were not
  described correctly"

* tag 'regulator-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: spacemit-p1: Fix n_voltages for BUCK and LDO regulators

4 days agoMerge tag 'char-misc-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 7 Feb 2026 17:27:57 +0000 (09:27 -0800)] 
Merge tag 'char-misc-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull binder fixes from Greg KH:
 "Here are some small, last-minute binder C and Rust driver fixes for
  reported issues. They include a number of fixes for reported crashes
  and other problems.

  All of these have been in linux-next this week, and longer"

* tag 'char-misc-6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  binderfs: fix ida_alloc_max() upper bound
  rust_binderfs: fix ida_alloc_max() upper bound
  binder: fix BR_FROZEN_REPLY error log
  rust_binder: add additional alignment checks
  binder: fix UAF in binder_netlink_report()
  rust_binder: correctly handle FDA objects of length zero

4 days agoMerge tag 'sched-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 7 Feb 2026 17:10:42 +0000 (09:10 -0800)] 
Merge tag 'sched-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Miscellaneous MMCID fixes to address bugs and performance regressions
  in the recent rewrite of the SCHED_MM_CID management code:

   - Fix livelock triggered by BPF CI testing

   - Fix hard lockup on weakly ordered systems

   - Simplify the dropping of CIDs in the exit path by removing an
     unintended transition phase

   - Fix performance/scalability regression on a thread-pool benchmark
     by optimizing transitional CIDs when scheduling out"

* tag 'sched-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/mmcid: Optimize transitional CIDs when scheduling out
  sched/mmcid: Drop per CPU CID immediately when switching to per task mode
  sched/mmcid: Protect transition on weakly ordered systems
  sched/mmcid: Prevent live lock on task to CPU mode transition

4 days agoMerge tag 'objtool-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 7 Feb 2026 16:21:21 +0000 (08:21 -0800)] 
Merge tag 'objtool-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fixes from Ingo Molnar::

 - Bump up the Clang minimum version requirements for livepatch
   builds, due to Clang assembler section handling bugs causing
   silent miscompilations

 - Strip livepatching symbol artifacts from non-livepatch modules

 - Fix livepatch build warnings when certain Clang LTO options
   are enabled

 - Fix livepatch build error when CONFIG_MEM_ALLOC_PROFILING_DEBUG=y

* tag 'objtool-urgent-2026-02-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool/klp: Fix unexported static call key access for manually built livepatch modules
  objtool/klp: Fix symbol correlation for orphaned local symbols
  livepatch: Free klp_{object,func}_ext data after initialization
  livepatch: Fix having __klp_objects relics in non-livepatch modules
  livepatch/klp-build: Require Clang assembler >= 20

4 days agox86/vmware: Fix hypercall clobbers
Josh Poimboeuf [Fri, 6 Feb 2026 22:24:55 +0000 (14:24 -0800)] 
x86/vmware: Fix hypercall clobbers

Fedora QA reported the following panic:

  BUG: unable to handle page fault for address: 0000000040003e54
  #PF: supervisor write access in kernel mode
  #PF: error_code(0x0002) - not-present page
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20251119-3.fc43 11/19/2025
  RIP: 0010:vmware_hypercall4.constprop.0+0x52/0x90
  ..
  Call Trace:
   vmmouse_report_events+0x13e/0x1b0
   psmouse_handle_byte+0x15/0x60
   ps2_interrupt+0x8a/0xd0
   ...

because the QEMU VMware mouse emulation is buggy, and clears the top 32
bits of %rdi that the kernel kept a pointer in.

The QEMU vmmouse driver saves and restores the register state in a
"uint32_t data[6];" and as a result restores the state with the high
bits all cleared.

RDI originally contained the value of a valid kernel stack address
(0xff5eeb3240003e54).  After the vmware hypercall it now contains
0x40003e54, and we get a page fault as a result when it is dereferenced.

The proper fix would be in QEMU, but this works around the issue in the
kernel to keep old setups working, when old kernels had not happened to
keep any state in %rdi over the hypercall.

In theory this same issue exists for all the hypercalls in the vmmouse
driver; in practice it has only been seen with vmware_hypercall3() and
vmware_hypercall4().  For now, just mark RDI/RSI as clobbered for those
two calls.  This should have a minimal effect on code generation overall
as it should be rare for the compiler to want to make RDI/RSI live
across hypercalls.

Reported-by: Justin Forbes <jforbes@fedoraproject.org>
Link: https://lore.kernel.org/all/99a9c69a-fc1a-43b7-8d1e-c42d6493b41f@broadcom.com/
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4 days agoMerge tag 'mm-hotfixes-stable-2026-02-06-12-37' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Fri, 6 Feb 2026 21:07:47 +0000 (13:07 -0800)] 
Merge tag 'mm-hotfixes-stable-2026-02-06-12-37' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull hotfixes from Andrew Morton:
 "A couple of late-breaking MM fixes. One against a new-in-this-cycle
  patch and the other addresses a locking issue which has been there for
  over a year"

* tag 'mm-hotfixes-stable-2026-02-06-12-37' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm/memory-failure: reject unsupported non-folio compound page
  procfs: avoid fetching build ID while holding VMA lock

4 days agoMerge tag 'trace-v6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Fri, 6 Feb 2026 20:37:28 +0000 (12:37 -0800)] 
Merge tag 'trace-v6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fix from Steven Rostedt:

 - Fix event format field alignments for 32 bit architectures

   The fields in the event format files are used to parse the raw binary
   buffer data by applications. If they are incorrect, then the
   application produces garbage.

   On 32 bit architectures, the function graph 64bit calltime and
   rettime were off by 4bytes. That's because the actual fields are in a
   packed structure but the macros used by the ftrace events did not
   mark them as packed, and instead, gave them their natural alignment
   which made their offsets off by 4 bytes.

   There are macros to have a packed field within an embedded structure
   of an event, but there's no macro for normal fields within a packed
   structure of the event. The macro __field_packed() was used for the
   packed embedded structure field. Rename that to __field_desc_packed()
   (to match the non-packed embedded field macro __field_desc()), and
   make __field_packed() for fields that are in a packed event structure
   (which matches the unpacked __field() macro).

   Switch the calltime and rettime fields of the function graph event to
   use the new __field_packed() and this makes the offsets correct.

* tag 'trace-v6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing: Fix ftrace event field alignments

5 days agoMerge tag 'ceph-for-6.19-rc9' of https://github.com/ceph/ceph-client
Linus Torvalds [Fri, 6 Feb 2026 18:34:17 +0000 (10:34 -0800)] 
Merge tag 'ceph-for-6.19-rc9' of https://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
 "One RBD and two CephFS fixes which address potential oopses.

  The RBD thing is more of a rare edge case that pops up in our CI,
  while the two CephFS scenarios are regressions that were reported by
  users and can be triggered trivially in normal operation. All marked
  for stable"

* tag 'ceph-for-6.19-rc9' of https://github.com/ceph/ceph-client:
  ceph: fix NULL pointer dereference in ceph_mds_auth_match()
  ceph: fix oops due to invalid pointer for kfree() in parse_longname()
  rbd: check for EOD after exclusive lock is ensured to be held

5 days agoMerge tag 'dma-mapping-6.19-2026-02-06' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 6 Feb 2026 18:27:42 +0000 (10:27 -0800)] 
Merge tag 'dma-mapping-6.19-2026-02-06' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fixes from Marek Szyprowski:
 "Two minor fixes for the DMA-mapping subsystem:

   - check for the rare case of the allocation failure of the global CMA
     pool (Shanker Donthineni)

   - avoid perf buffer overflow when tracing large scatter-gather lists
     (Deepanshu Kartikey)"

* tag 'dma-mapping-6.19-2026-02-06' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
  dma: contiguous: Check return value of dma_contiguous_reserve_area()
  tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow

5 days agoMerge tag 'iommu-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Feb 2026 18:19:54 +0000 (10:19 -0800)] 
Merge tag 'iommu-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fix from Joerg Roedel:

 - Fix wrong definition of PASID_FLAG_PWSNP bit. This caused DMAR errors
   on Arrow Lake platforms.

* tag 'iommu-fix-v6.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  iommu/vt-d: Treat PAGE_SNOOP and PWSNP separately

5 days agoMerge tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Feb 2026 18:10:39 +0000 (10:10 -0800)] 
Merge tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:

 - imx:
     - Fix system wakeup support for imx8mp power domains
     - Fix potential out-of-range access for imx8m power domains
     - Fix the imx8mm gpu hang

 - qcom: Fix off-by-one error for highest state in rpmpd

* tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain: imx8mp-blk-ctrl: Keep usb phy power domain on for system wakeup
  pmdomain: imx8mp-blk-ctrl: Keep gpc power domain on for system wakeup
  pmdomain: imx8m-blk-ctrl: fix out-of-range access of bc->domains
  pmdomain: imx: gpcv2: Fix the imx8mm gpu hang due to wrong adb400 reset
  pmdomain: qcom: rpmpd: fix off-by-one error in clamping to the highest state

5 days agoMerge tag 'gpio-fixes-for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Feb 2026 18:05:35 +0000 (10:05 -0800)] 
Merge tag 'gpio-fixes-for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - fix incorrect retval check in gpio-loongson-64bit

 - fix GPIO counting with ACPI

* tag 'gpio-fixes-for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: loongson-64bit: Fix incorrect NULL check after devm_kcalloc()
  gpiolib: acpi: Fix gpio count with string references

5 days agoMerge tag 'sound-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 6 Feb 2026 17:59:40 +0000 (09:59 -0800)] 
Merge tag 'sound-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes. It became a bit larger than wished, but
  all of them are device-specific small fixes, and it should be still
  fairly safe to take at the last minute.

  Included are a few quirks and fixes for Intel, AMD, HD-audio, and
  USB-audio, as well as a race fix in aloop driver and corrections of
  Cirrus firmware kunit test"

* tag 'sound-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: Enable headset mic for Acer Nitro 5
  ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()
  ASoC: dt-bindings: ti,tlv320aic3x: Add compatible string ti,tlv320aic23
  ASoC: amd: fix memory leak in acp3x pdm dma ops
  ALSA: usb-audio: fix broken logic in snd_audigy2nx_led_update()
  ALSA: aloop: Fix racy access at PCM trigger
  ASoC: rt1320: fix intermittent no-sound issue
  ASoC: SOF: Intel: use hdev->info.link_mask directly
  firmware: cs_dsp: rate-limit log messages in KUnit builds
  ASoC: amd: yc: Add quirk for HP 200 G2a 16
  ASoC: cs42l43: Correct handling of 3-pole jack load detection
  ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9
  ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43

5 days agoMerge tag 'slab-for-6.19-rc8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Feb 2026 17:56:03 +0000 (09:56 -0800)] 
Merge tag 'slab-for-6.19-rc8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab

Pull slab fix from Vlastimil Babka:
 "A stable fix for memory allocation profiling tag not being cleared
  when aborting an allocation due to memcg charge failure (Hao Ge)"

* tag 'slab-for-6.19-rc8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
  mm/slab: Add alloc_tagging_slab_free_hook for memcg_alloc_abort_single

5 days agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux
Linus Torvalds [Fri, 6 Feb 2026 17:21:38 +0000 (09:21 -0800)] 
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux

Pull ARM fix from Russell King:
 "Just one fix for memset64() on big endian 32-bit ARM systems"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux:
  ARM: 9468/1: fix memset64() on big-endian

5 days agoiommu/vt-d: Treat PAGE_SNOOP and PWSNP separately
Viktor Kleen [Thu, 5 Feb 2026 08:49:41 +0000 (16:49 +0800)] 
iommu/vt-d: Treat PAGE_SNOOP and PWSNP separately

The PASID_FLAG_PAGE_SNOOP and PASID_FLAG_PWSNP constants are identical.
This will cause the pasid code to always set both or neither of the
PGSNP and PWSNP bits in PASID table entries. However, PWSNP is a
reserved bit if SMPWC is not set in the IOMMU's extended capability
register, even if SC is supported.

This has resulted in DMAR errors when testing the iommufd code on an
Arrow Lake platform. With this patch, those errors disappear and the
PASID table entries look correct.

Fixes: 101a2854110fa ("iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry")
Cc: stable@vger.kernel.org
Signed-off-by: Viktor Kleen <viktor@kleen.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20260202192109.1665799-1-viktor@kleen.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
5 days agomm/slab: Add alloc_tagging_slab_free_hook for memcg_alloc_abort_single
Hao Ge [Wed, 4 Feb 2026 10:14:01 +0000 (18:14 +0800)] 
mm/slab: Add alloc_tagging_slab_free_hook for memcg_alloc_abort_single

When CONFIG_MEM_ALLOC_PROFILING_DEBUG is enabled, the following warning
may be noticed:

[ 3959.023862] ------------[ cut here ]------------
[ 3959.023891] alloc_tag was not cleared (got tag for lib/xarray.c:378)
[ 3959.023947] WARNING: ./include/linux/alloc_tag.h:155 at alloc_tag_add+0x128/0x178, CPU#6: mkfs.ntfs/113998
[ 3959.023978] Modules linked in: dns_resolver tun brd overlay exfat btrfs blake2b libblake2b xor xor_neon raid6_pq loop sctp ip6_udp_tunnel udp_tunnel ext4 crc16 mbcache jbd2 rfkill sunrpc vfat fat sg fuse nfnetlink sr_mod virtio_gpu cdrom drm_client_lib virtio_dma_buf drm_shmem_helper drm_kms_helper ghash_ce drm sm4 backlight virtio_net net_failover virtio_scsi failover virtio_console virtio_blk virtio_mmio dm_mirror dm_region_hash dm_log dm_multipath dm_mod i2c_dev aes_neon_bs aes_ce_blk [last unloaded: hwpoison_inject]
[ 3959.024170] CPU: 6 UID: 0 PID: 113998 Comm: mkfs.ntfs Kdump: loaded Tainted: G        W           6.19.0-rc7+ #7 PREEMPT(voluntary)
[ 3959.024182] Tainted: [W]=WARN
[ 3959.024186] Hardware name: QEMU KVM Virtual Machine, BIOS unknown 2/2/2022
[ 3959.024192] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 3959.024199] pc : alloc_tag_add+0x128/0x178
[ 3959.024207] lr : alloc_tag_add+0x128/0x178
[ 3959.024214] sp : ffff80008b696d60
[ 3959.024219] x29: ffff80008b696d60 x28: 0000000000000000 x27: 0000000000000240
[ 3959.024232] x26: 0000000000000000 x25: 0000000000000240 x24: ffff800085d17860
[ 3959.024245] x23: 0000000000402800 x22: ffff0000c0012dc0 x21: 00000000000002d0
[ 3959.024257] x20: ffff0000e6ef3318 x19: ffff800085ae0410 x18: 0000000000000000
[ 3959.024269] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[ 3959.024281] x14: 0000000000000000 x13: 0000000000000001 x12: ffff600064101293
[ 3959.024292] x11: 1fffe00064101292 x10: ffff600064101292 x9 : dfff800000000000
[ 3959.024305] x8 : 00009fff9befed6e x7 : ffff000320809493 x6 : 0000000000000001
[ 3959.024316] x5 : ffff000320809490 x4 : ffff600064101293 x3 : ffff800080691838
[ 3959.024328] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000d5bcd640
[ 3959.024340] Call trace:
[ 3959.024346]  alloc_tag_add+0x128/0x178 (P)
[ 3959.024355]  __alloc_tagging_slab_alloc_hook+0x11c/0x1a8
[ 3959.024362]  kmem_cache_alloc_lru_noprof+0x1b8/0x5e8
[ 3959.024369]  xas_alloc+0x304/0x4f0
[ 3959.024381]  xas_create+0x1e0/0x4a0
[ 3959.024388]  xas_store+0x68/0xda8
[ 3959.024395]  __filemap_add_folio+0x5b0/0xbd8
[ 3959.024409]  filemap_add_folio+0x16c/0x7e0
[ 3959.024416]  __filemap_get_folio_mpol+0x2dc/0x9e8
[ 3959.024424]  iomap_get_folio+0xfc/0x180
[ 3959.024435]  __iomap_get_folio+0x2f8/0x4b8
[ 3959.024441]  iomap_write_begin+0x198/0xc18
[ 3959.024448]  iomap_write_iter+0x2ec/0x8f8
[ 3959.024454]  iomap_file_buffered_write+0x19c/0x290
[ 3959.024461]  blkdev_write_iter+0x38c/0x978
[ 3959.024470]  vfs_write+0x4d4/0x928
[ 3959.024482]  ksys_write+0xfc/0x1f8
[ 3959.024489]  __arm64_sys_write+0x74/0xb0
[ 3959.024496]  invoke_syscall+0xd4/0x258
[ 3959.024507]  el0_svc_common.constprop.0+0xb4/0x240
[ 3959.024514]  do_el0_svc+0x48/0x68
[ 3959.024520]  el0_svc+0x40/0xf8
[ 3959.024526]  el0t_64_sync_handler+0xa0/0xe8
[ 3959.024533]  el0t_64_sync+0x1ac/0x1b0
[ 3959.024540] ---[ end trace 0000000000000000 ]---

When __memcg_slab_post_alloc_hook() fails, there are two different
free paths depending on whether size == 1 or size != 1. In the
kmem_cache_free_bulk() path, we do call alloc_tagging_slab_free_hook().
However, in memcg_alloc_abort_single() we don't, the above warning will be
triggered on the next allocation.

Therefore, add alloc_tagging_slab_free_hook() to the
memcg_alloc_abort_single() path.

Fixes: 9f9796b413d3 ("mm, slab: move memcg charging to post-alloc hook")
Cc: stable@vger.kernel.org
Suggested-by: Hao Li <hao.li@linux.dev>
Signed-off-by: Hao Ge <hao.ge@linux.dev>
Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260204101401.202762-1-hao.ge@linux.dev
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
5 days agoMerge tag 'hwmon-for-v6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Feb 2026 05:33:22 +0000 (21:33 -0800)] 
Merge tag 'hwmon-for-v6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - occ: Mark occ_init_attribute() as __printf to avoid build failure due
   to '-Werror=suggest-attribute=format'

 - gpio-fan: Allow to stop fans when CONFIG_PM is disabled, and fix
   set_rpm() return value

 - acpi_power_meter: Fix deadlocks related to acpi_power_meter_notify()

 - dell-smm: Add Dell G15 5510 to fan control whitelist

* tag 'hwmon-for-v6.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (occ) Mark occ_init_attribute() as __printf
  hwmon: (gpio-fan) Allow to stop FANs when CONFIG_PM is disabled
  hwmon: (gpio-fan) Fix set_rpm() return value
  hwmon: (acpi_power_meter) Fix deadlocks related to acpi_power_meter_notify()
  hwmon: (dell-smm) Add Dell G15 5510 to fan control whitelist

5 days agoMerge tag 'drm-fixes-2026-02-06' of https://gitlab.freedesktop.org/drm/kernel
Linus Torvalds [Fri, 6 Feb 2026 03:56:47 +0000 (19:56 -0800)] 
Merge tag 'drm-fixes-2026-02-06' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "The usual xe/amdgpu selection, and a couple of misc changes for
  gma500, mgag200 and bridge. There is a nouveau revert, and also a set
  of changes that fix a regression since we moved to 570 firmware.
  Suspend/resume was broken on a bunch of GPUs. The fix looks big, but
  it's mostly just refactoring to pass an extra bit down the nouveau
  abstractions to the firmware command.

  amdgpu:
   - MES 11 old firmware compatibility fix
   - ASPM fix
   - DC LUT fixes

  amdkfd:
   - Fix possible double deletion of validate list

  xe:
   - Fix topology query pointer advance
   - A couple of kerneldoc fixes
   - Disable D3Cold for BMG only on specific platforms
   - Fix CFI violation in debugfs access

  nouveau:
   - Revert adding atomic commit functions as it regresses pre-nv50
   - Fix suspend/resume bugs exposed by enabling 570 firmware

  gma500:
   - Revert a regression caused by vblank changes

  mgag200:
   - Replace a busy loop with a polling loop to fix that blocking 1 cpu
     for 300 ms roughly every 20 minutes

bridge:
   - imx8mp-hdmi-pa: Use runtime pm to fix a bug in channel ordering"

* tag 'drm-fixes-2026-02-06' of https://gitlab.freedesktop.org/drm/kernel:
  drm/xe/guc: Fix CFI violation in debugfs access.
  drm/bridge: imx8mp-hdmi-pai: enable PM runtime
  drm/xe/pm: Disable D3Cold for BMG only on specific platforms
  drm/xe: Fix kerneldoc for xe_tlb_inval_job_alloc_dep
  drm/xe: Fix kerneldoc for xe_gt_tlb_inval_init_early
  drm/xe: Fix kerneldoc for xe_migrate_exec_queue
  drm/xe/query: Fix topology query pointer advance
  drm/mgag200: fix mgag200_bmc_stop_scanout()
  nouveau/gsp: fix suspend/resume regression on r570 firmware
  nouveau: add a third state to the fini handler.
  nouveau/gsp: use rpc sequence numbers properly.
  drm/amdgpu: Fix double deletion of validate_list
  drm/amd/display: remove assert around dpp_base replacement
  drm/amd/display: extend delta clamping logic to CM3 LUT helper
  drm/amd/display: fix wrong color value mapping on MCM shaper LUT
  Revert "drm/amd: Check if ASPM is enabled from PCIe subsystem"
  drm/amd: Set minimum version for set_hw_resource_1 on gfx11 to 0x52
  Revert "drm/gma500: use drm_crtc_vblank_crtc()"
  Revert "drm/nouveau/disp: Set drm_mode_config_funcs.atomic_(check|commit)"

5 days agoMerge tag 'amd-drm-fixes-6.19-2026-02-05' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Fri, 6 Feb 2026 02:44:46 +0000 (12:44 +1000)] 
Merge tag 'amd-drm-fixes-6.19-2026-02-05' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.19-2026-02-05:

amdgpu:
- MES 11 old firmware compatibility fix
- ASPM fix
- DC LUT fixes

amdkfd:
- Fix possible double deletion of validate list

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20260205182017.2409773-1-alexander.deucher@amd.com
5 days agoMerge tag 'drm-xe-fixes-2026-02-05' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Fri, 6 Feb 2026 02:41:35 +0000 (12:41 +1000)] 
Merge tag 'drm-xe-fixes-2026-02-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

Driver Changes:
- Fix topology query pointer advance (Shuicheng)
- A couple of kerneldoc fixes (Shuicheng)
- Disable D3Cold for BMG only on specific platforms (Karthik)
- Fix CFI violation in debugfs access (Daniele)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/aYS2v12R8ELQoTiZ@fedora
5 days agoMerge tag 'drm-misc-fixes-2026-02-05' of https://gitlab.freedesktop.org/drm/misc...
Dave Airlie [Fri, 6 Feb 2026 02:24:38 +0000 (12:24 +1000)] 
Merge tag 'drm-misc-fixes-2026-02-05' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

drm-misc-fixes for v6.19 final:

nouveau
-------
Revert adding atomic commit functions as it regresses pre-nv50.
Fix bugs exposed by enabling 570 firmware.

gma500
------
Revert a regression caused by vblank changes.

mgag200
-------
Replace a busy loop with a polling loop to fix that blocking 1 cpu for 300 ms roughly every 20 minutes.

bridge
------
imx8mp-hdmi-pa: Use runtime pm to fix a bug in channel ordering.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patch.msgid.link/c0077ea5-faeb-4b0c-bd4a-ea2384d6dc0c@linux.intel.com
5 days agoMerge tag 'block-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 5 Feb 2026 23:00:53 +0000 (15:00 -0800)] 
Merge tag 'block-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux

Pull block fixes from Jens Axboe:

 - Revert of a change for loop, which caused regressions for some users
   (Actually revert of two commits, where one is just an existing fix
   for the offending commit)

 - NVMe pull via Keith:
      - Fix NULL pointer access setting up dma mappings
      - Fix invalid memory access from malformed TCP PDU

* tag 'block-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  loop: revert exclusive opener loop status change
  nvmet-tcp: add bounds checks in nvmet_tcp_build_pdu_iovec
  nvme-pci: handle changing device dma map requirements

5 days agoMerge tag 'io_uring-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 5 Feb 2026 22:40:06 +0000 (14:40 -0800)] 
Merge tag 'io_uring-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux

Pull io_uring fixes from Jens Axboe:

 - Two small fixes for zcrx

 - Two small fixes for fdinfo - one is just killing a superflous newline

* tag 'io_uring-6.19-20260205' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs
  io_uring/fdinfo: kill unnecessary newline feed in CQE32 printing
  io_uring/zcrx: fix rq flush locking
  io_uring/zcrx: fix page array leak

5 days agomm/memory-failure: reject unsupported non-folio compound page
Miaohe Lin [Thu, 5 Feb 2026 07:53:28 +0000 (15:53 +0800)] 
mm/memory-failure: reject unsupported non-folio compound page

When !CONFIG_TRANSPARENT_HUGEPAGE, a non-folio compound page can appear in
a userspace mapping via either vm_insert_*() functions or
vm_operatios_struct->fault().  They are not folios, thus should not be
considered for folio operations like split.  To reject these pages, make
sure get_hwpoison_page() is always called as HWPoisonHandlable() will do
the right work.

[Some commit log borrowed from Zi Yan. Thanks.]

Link: https://lkml.kernel.org/r/20260205075328.523211-1-linmiaohe@huawei.com
Fixes: 689b8986776c ("mm/memory-failure: improve large block size folio handling")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reported-by: 是参差 <shicenci@gmail.com>
Closes: https://lore.kernel.org/all/PS1PPF7E1D7501F1E4F4441E7ECD056DEADAB98A@PS1PPF7E1D7501F.apcprd02.prod.outlook.com/
Reviewed-by: Zi Yan <ziy@nvidia.com>
Tested-by: Zi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
5 days agoprocfs: avoid fetching build ID while holding VMA lock
Andrii Nakryiko [Thu, 29 Jan 2026 21:53:40 +0000 (13:53 -0800)] 
procfs: avoid fetching build ID while holding VMA lock

Fix PROCMAP_QUERY to fetch optional build ID only after dropping mmap_lock
or per-VMA lock, whichever was used to lock VMA under question, to avoid
deadlock reported by syzbot:

 -> #1 (&mm->mmap_lock){++++}-{4:4}:
        __might_fault+0xed/0x170
        _copy_to_iter+0x118/0x1720
        copy_page_to_iter+0x12d/0x1e0
        filemap_read+0x720/0x10a0
        blkdev_read_iter+0x2b5/0x4e0
        vfs_read+0x7f4/0xae0
        ksys_read+0x12a/0x250
        do_syscall_64+0xcb/0xf80
        entry_SYSCALL_64_after_hwframe+0x77/0x7f

 -> #0 (&sb->s_type->i_mutex_key#8){++++}-{4:4}:
        __lock_acquire+0x1509/0x26d0
        lock_acquire+0x185/0x340
        down_read+0x98/0x490
        blkdev_read_iter+0x2a7/0x4e0
        __kernel_read+0x39a/0xa90
        freader_fetch+0x1d5/0xa80
        __build_id_parse.isra.0+0xea/0x6a0
        do_procmap_query+0xd75/0x1050
        procfs_procmap_ioctl+0x7a/0xb0
        __x64_sys_ioctl+0x18e/0x210
        do_syscall_64+0xcb/0xf80
        entry_SYSCALL_64_after_hwframe+0x77/0x7f

 other info that might help us debug this:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   rlock(&mm->mmap_lock);
                                lock(&sb->s_type->i_mutex_key#8);
                                lock(&mm->mmap_lock);
   rlock(&sb->s_type->i_mutex_key#8);

  *** DEADLOCK ***

This seems to be exacerbated (as we haven't seen these syzbot reports
before that) by the recent:

777a8560fd29 ("lib/buildid: use __kernel_read() for sleepable context")

To make this safe, we need to grab file refcount while VMA is still locked, but
other than that everything is pretty straightforward. Internal build_id_parse()
API assumes VMA is passed, but it only needs the underlying file reference, so
just add another variant build_id_parse_file() that expects file passed
directly.

[akpm@linux-foundation.org: fix up kerneldoc]
Link: https://lkml.kernel.org/r/20260129215340.3742283-1-andrii@kernel.org
Fixes: ed5d583a88a9 ("fs/procfs: implement efficient VMA querying API for /proc/<pid>/maps")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reported-by: <syzbot+4e70c8e0a2017b432f7a@syzkaller.appspotmail.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Tested-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Song Liu <song@kernel.org>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Yonghong Song <yonghong.song@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>