# git rev-parse -q --verify 8c7ae38d1ce12a0eaeba655df8562552b3596c7f^{commit} 8c7ae38d1ce12a0eaeba655df8562552b3596c7f already have revision, skipping fetch # git checkout -q -f -B kisskb 8c7ae38d1ce12a0eaeba655df8562552b3596c7f # git clean -qxdf # < git log -1 # commit 8c7ae38d1ce12a0eaeba655df8562552b3596c7f # Author: David Howells # Date: Wed Mar 27 22:48:02 2019 +0000 # # afs: Fix StoreData op marshalling # # The marshalling of AFS.StoreData, AFS.StoreData64 and YFS.StoreData64 calls # generated by ->setattr() ops for the purpose of expanding a file is # incorrect due to older documentation incorrectly describing the way the RPC # 'FileLength' parameter is meant to work. # # The older documentation says that this is the length the file is meant to # end up at the end of the operation; however, it was never implemented this # way in any of the servers, but rather the file is truncated down to this # before the write operation is effected, and never expanded to it (and, # indeed, it was renamed to 'TruncPos' in 2014). # # Fix this by setting the position parameter to the new file length and doing # a zero-lengh write there. # # The bug causes Xwayland to SIGBUS due to unexpected non-expansion of a file # it then mmaps. This can be tested by giving the following test program a # filename in an AFS directory: # # #include # #include # #include # #include # #include # int main(int argc, char *argv[]) # { # char *p; # int fd; # if (argc != 2) { # fprintf(stderr, # "Format: test-trunc-mmap \n"); # exit(2); # } # fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC); # if (fd < 0) { # perror(argv[1]); # exit(1); # } # if (ftruncate(fd, 0x140008) == -1) { # perror("ftruncate"); # exit(1); # } # p = mmap(NULL, 4096, PROT_READ | PROT_WRITE, # MAP_SHARED, fd, 0); # if (p == MAP_FAILED) { # perror("mmap"); # exit(1); # } # p[0] = 'a'; # if (munmap(p, 4096) < 0) { # perror("munmap"); # exit(1); # } # if (close(fd) < 0) { # perror("close"); # exit(1); # } # exit(0); # } # # Fixes: 31143d5d515e ("AFS: implement basic file write support") # Reported-by: Jonathan Billings # Tested-by: Jonathan Billings # Signed-off-by: David Howells # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 8c7ae38d1ce12a0eaeba655df8562552b3596c7f # < make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 allyesconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_KCOV=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_GCC_PLUGIN_STRUCTLEAK=n # Added to kconfig CONFIG_GCC_PLUGIN_RANDSTRUCT=n # Added to kconfig CONFIG_UML_NET=n # Added to kconfig CONFIG_UML_NET_ETHERTAP=n # Added to kconfig CONFIG_UML_NET_TUNTAP=n # Added to kconfig CONFIG_UML_NET_SLIP=n # Added to kconfig CONFIG_UML_NET_DAEMON=n # Added to kconfig CONFIG_UML_NET_VDE=n # Added to kconfig CONFIG_UML_NET_MCAST=n # Added to kconfig CONFIG_UML_NET_PCAP=n # Added to kconfig CONFIG_UML_NET_SLIRP=n # Added to kconfig CONFIG_GCOV_KERNEL=n # yes \n | make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 oldconfig yes: standard output: Broken pipe # make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/arch/um/kernel/skas/uaccess.c: In function 'do_op_one_page': /kisskb/src/arch/um/kernel/skas/uaccess.c:62:10: warning: unused variable 'buf' [-Wunused-variable] jmp_buf buf; ^ /kisskb/src/arch/um/os-Linux/umid.c: In function 'is_umdir_used': /kisskb/src/arch/um/os-Linux/umid.c:138:2: warning: ISO C90 forbids variable length array 'file' [-Wvla] char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; ^ /kisskb/src/arch/um/os-Linux/umid.c: In function 'create_pid_file': /kisskb/src/arch/um/os-Linux/umid.c:213:2: warning: ISO C90 forbids variable length array 'file' [-Wvla] char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; ^ /kisskb/src/arch/um/os-Linux/umid.c: In function 'remove_umid_dir': /kisskb/src/arch/um/os-Linux/umid.c:388:2: warning: ISO C90 forbids variable length array 'dir' [-Wvla] char dir[strlen(uml_dir) + UMID_LEN + 1], err; ^ /kisskb/src/security/apparmor/policy_unpack.c: In function 'unpack_trans_table': /kisskb/src/security/apparmor/policy_unpack.c:496:9: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized] str[pos] = ':'; ^ /kisskb/src/lib/lz4/lz4hc_compress.c: In function 'LZ4HC_compress_generic': /kisskb/src/lib/lz4/lz4hc_compress.c:579:1: warning: the frame size of 2144 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/mm/mprotect.c: In function 'change_pte_range': /kisskb/src/mm/mprotect.c:42:20: warning: unused variable 'mm' [-Wunused-variable] struct mm_struct *mm = vma->vm_mm; ^ /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret == -EOPNOTSUPP) ^ LINK linux Completed OK # rm -rf /kisskb/build/linus_um-allyesconfig_um-x86_64 # Build took: 0:05:57.508325