# 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/gcc-4.6.3-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ld --version # < git log --format=%s --max-count=1 8c7ae38d1ce12a0eaeba655df8562552b3596c7f # < make -s -j 48 ARCH=arm O=/kisskb/build/linus_shmobile_defconfig_arm CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- shmobile_defconfig # make -s -j 48 ARCH=arm O=/kisskb/build/linus_shmobile_defconfig_arm CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- :1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp] :1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp] :1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp] :1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp] /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:187:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/ipc/shm.c: In function 'ksys_shmdt': /kisskb/src/ipc/shm.c:1712:59: warning: 'file' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:140:32: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:88:6: note: 'levelspread[]' was declared here /kisskb/src/net/core/gen_stats.c: In function '__gnet_stats_copy_basic': /kisskb/src/net/core/gen_stats.c:161:19: warning: 'seq' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv6/ip6_output.c: In function '__ip6_append_data': /kisskb/src/include/linux/skbuff.h:1397:6: warning: 'extra_uref' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv6/ip6_output.c:1276:14: note: 'extra_uref' was declared here /kisskb/src/lib/rhashtable.c: In function 'rht_deferred_worker': /kisskb/src/lib/rhashtable.c:264:2: warning: 'next' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/lib/rhashtable.c:229:28: note: 'next' was declared here /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:337:21: note: 'pdeo' was declared here /kisskb/src/sound/core/pcm_iec958.c: In function 'create_iec958_consumer': /kisskb/src/sound/core/pcm_iec958.c:80:9: warning: 'ws' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv4/ip_output.c: In function '__ip_append_data': /kisskb/src/include/linux/skbuff.h:1397:6: warning: 'extra_uref' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv4/ip_output.c:885:14: note: 'extra_uref' was declared here /kisskb/src/net/core/dev.c: In function 'validate_xmit_skb_list': /kisskb/src/net/core/dev.c:3405:15: warning: 'tail' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/gpio/gpiolib-of.c: In function 'of_gpiochip_add': /kisskb/src/drivers/gpio/gpiolib-of.c:462:8: warning: 'dflags' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/gpio/gpiolib-of.c:448:19: note: 'dflags' was declared here /kisskb/src/drivers/gpio/gpiolib-of.c:462:8: warning: 'lflags' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/gpio/gpiolib-of.c:447:25: note: 'lflags' was declared here /kisskb/src/fs/fs_parser.c: In function 'fs_validate_description': /kisskb/src/fs/fs_parser.c:413:6: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat] /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 [-Wuninitialized] /kisskb/src/drivers/i2c/busses/i2c-sh_mobile.c: In function 'sh_mobile_i2c_isr': /kisskb/src/drivers/i2c/busses/i2c-sh_mobile.c:399:26: warning: 'data' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/i2c/busses/i2c-sh_mobile.c:372:16: note: 'data' was declared here /kisskb/src/drivers/gpu/drm/drm_dp_mst_topology.c: In function 'drm_dp_sideband_msg_build': /kisskb/src/drivers/gpu/drm/drm_dp_mst_topology.c:423:23: warning: 'hdrlen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_check_only': /kisskb/src/drivers/gpu/drm/drm_atomic.c:420:38: warning: 'crtc_state' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/gpu/drm/drm_atomic.c:399:25: note: 'crtc_state' was declared here /kisskb/src/drivers/usb/host/xhci-debugfs.c: In function 'xhci_ring_open': /kisskb/src/drivers/usb/host/xhci-debugfs.c:246:20: warning: 'f_map' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/usb/host/xhci-debugfs.c: In function 'xhci_context_open': /kisskb/src/drivers/usb/host/xhci-debugfs.c:327:20: warning: 'f_map' may be used uninitialized in this function [-Wuninitialized] Completed OK # rm -rf /kisskb/build/linus_shmobile_defconfig_arm # Build took: 0:00:52.580638