Commit 9df2380
committed
smb311: failure to open files of length 1040 when mounting with SMB3.1.1 POSIX extensions
If a file size has bits 0x410 = ATTR_DIRECTORY | ATTR_REPARSE set
then during queryinfo (stat) the file is regarded as a directory
and subsequent opens can fail. A simple test example is trying
to open any file 1040 bytes long when mounting with "posix"
(SMB3.1.1 POSIX/Linux Extensions).
The cause of this bug is that Attributes field in smb2_file_all_info
struct occupies the same place that EndOfFile field in
smb311_posix_qinfo, and sometimes the latter struct is incorrectly
processed as if it was the first one.
Reported-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Tested-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent 7330195 commit 9df2380
4 files changed
+29
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
110 | 126 | | |
111 | 127 | | |
112 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| 653 | + | |
653 | 654 | | |
654 | 655 | | |
655 | 656 | | |
| |||
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| 677 | + | |
676 | 678 | | |
677 | 679 | | |
678 | 680 | | |
| |||
770 | 772 | | |
771 | 773 | | |
772 | 774 | | |
| 775 | + | |
773 | 776 | | |
774 | 777 | | |
775 | 778 | | |
| |||
791 | 794 | | |
792 | 795 | | |
793 | 796 | | |
| 797 | + | |
794 | 798 | | |
795 | 799 | | |
796 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| 1004 | + | |
1004 | 1005 | | |
1005 | 1006 | | |
1006 | 1007 | | |
| |||
5146 | 5147 | | |
5147 | 5148 | | |
5148 | 5149 | | |
5149 | | - | |
| 5150 | + | |
5150 | 5151 | | |
5151 | 5152 | | |
5152 | 5153 | | |
| |||
0 commit comments