1. 27 9月, 2021 1 次提交
    • R
      ksmbd: remove RFC1002 check in smb2 request · 18d46769
      Ronnie Sahlberg 提交于
      In smb_common.c you have this function :   ksmbd_smb_request() which
      is called from connection.c once you have read the initial 4 bytes for
      the next length+smb2 blob.
      
      It checks the first byte of this 4 byte preamble for valid values,
      i.e. a NETBIOSoverTCP SESSION_MESSAGE or a SESSION_KEEP_ALIVE.
      
      We don't need to check this for ksmbd since it only implements SMB2
      over TCP port 445.
      The netbios stuff was only used in very old servers when SMB ran over
      TCP port 139.
      Now that we run over TCP port 445, this is actually not a NB header anymore
      and you can just treat it as a 4 byte length field that must be less
      than 16Mbyte. and remove the references to the RFC1002 constants that no
      longer applies.
      
      Cc: Tom Talpey <tom@talpey.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Ralph Böhme <slow@samba.org>
      Cc: Steve French <smfrench@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Acked-by: NHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      18d46769
  2. 25 9月, 2021 12 次提交
  3. 24 9月, 2021 5 次提交
  4. 23 9月, 2021 4 次提交
  5. 22 9月, 2021 4 次提交
  6. 21 9月, 2021 2 次提交
    • D
      ceph: fix off by one bugs in unsafe_request_wait() · 708c8716
      Dan Carpenter 提交于
      The "> max" tests should be ">= max" to prevent an out of bounds access
      on the next lines.
      
      Fixes: e1a4541e ("ceph: flush the mdlog before waiting on unsafe reqs")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      708c8716
    • L
      qnx4: work around gcc false positive warning bug · d5f65459
      Linus Torvalds 提交于
      In commit b7213ffa ("qnx4: avoid stringop-overread errors") I tried
      to teach gcc about how the directory entry structure can be two
      different things depending on a status flag.  It made the code clearer,
      and it seemed to make gcc happy.
      
      However, Arnd points to a gcc bug, where despite using two different
      members of a union, gcc then gets confused, and uses the size of one of
      the members to decide if a string overrun happens.  And not necessarily
      the rigth one.
      
      End result: with some configurations, gcc-11 will still complain about
      the source buffer size being overread:
      
        fs/qnx4/dir.c: In function 'qnx4_readdir':
        fs/qnx4/dir.c:76:32: error: 'strnlen' specified bound [16, 48] exceeds source size 1 [-Werror=stringop-overread]
           76 |                         size = strnlen(name, size);
              |                                ^~~~~~~~~~~~~~~~~~~
        fs/qnx4/dir.c:26:22: note: source object declared here
           26 |                 char de_name;
              |                      ^~~~~~~
      
      because gcc will get confused about which union member entry is actually
      getting accessed, even when the source code is very clear about it.  Gcc
      internally will have combined two "redundant" pointers (pointing to
      different union elements that are at the same offset), and takes the
      size checking from one or the other - not necessarily the right one.
      
      This is clearly a gcc bug, but we can work around it fairly easily.  The
      biggest thing here is the big honking comment about why we do what we
      do.
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c6Reported-and-tested-by: NArnd Bergmann <arnd@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d5f65459
  7. 18 9月, 2021 9 次提交
  8. 17 9月, 2021 3 次提交