# git rev-parse -q --verify f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76^{commit} f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76 already have revision, skipping fetch # git checkout -q -f -B kisskb f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76 # git clean -qxdf # < git log -1 # commit f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76 # Author: David Howells # Date: Mon Oct 15 12:43:02 2018 +0100 # # afs: Fix clearance of reply # # The recent patch to fix the afs_server struct leak didn't actually fix the # bug, but rather fixed some of the symptoms. The problem is that an # asynchronous call that holds a resource pointed to by call->reply[0] will # find the pointer cleared in the call destructor, thereby preventing the # resource from being cleaned up. # # In the case of the server record leak, the afs_fs_get_capabilities() # function in devel code sets up a call with reply[0] pointing at the server # record that should be altered when the result is obtained, but this was # being cleared before the destructor was called, so the put in the # destructor does nothing and the record is leaked. # # Commit f014ffb025c1 removed the additional ref obtained by # afs_install_server(), but the removal of this ref is actually used by the # garbage collector to mark a server record as being defunct after the record # has expired through lack of use. # # The offending clearance of call->reply[0] upon completion in # afs_process_async_call() has been there from the origin of the code, but # none of the asynchronous calls actually use that pointer currently, so it # should be safe to remove (note that synchronous calls don't involve this # function). # # Fix this by the following means: # # (1) Revert commit f014ffb025c1. # # (2) Remove the clearance of reply[0] from afs_process_async_call(). # # Without this, afs_manage_servers() will suffer an assertion failure if it # sees a server record that didn't get used because the usage count is not 1. # # Fixes: f014ffb025c1 ("afs: Fix afs_server struct leak") # Fixes: 08e0e7c82eea ("[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.") # Signed-off-by: David Howells # Cc: stable # Signed-off-by: Greg Kroah-Hartman # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc --version # < git log --format=%s --max-count=1 f0a7d1883d9f78ae7bf15fc258bf9a2b20f35b76 # < make -s -j 48 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- allmodconfig # make -s -j 48 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- /kisskb/src/scripts/unifdef.c: In function 'Mpass': /kisskb/src/scripts/unifdef.c:453:28: warning: 'strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation] static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /kisskb/src/arch/arm64/include/asm/processor.h:41, from /kisskb/src/include/linux/rcupdate.h:43, from /kisskb/src/include/linux/rculist.h:11, from /kisskb/src/include/linux/pid.h:5, from /kisskb/src/include/linux/sched.h:14, from /kisskb/src/kernel/debug/kdb/kdb_support.c:15: In function 'strncpy', inlined from 'kallsyms_symbol_next' at /kisskb/src/kernel/debug/kdb/kdb_support.c:239:4: /kisskb/src/include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/kernel/debug/kdb/kdb_support.c: In function 'kallsyms_symbol_next': /kisskb/src/include/linux/string.h:267:10: note: length computed here return __builtin_strlen(p); ^~~~~~~~~~~~~~~~~~~ /kisskb/src/lib/ubsan.c:432:1: warning: ignoring attribute 'noreturn' in declaration of a built-in function '__ubsan_handle_builtin_unreachable' because it conflicts with attribute 'const' [-Wattributes] { ^ : note: previous declaration here In file included from /kisskb/src/arch/arm64/include/asm/processor.h:41, from /kisskb/src/include/linux/rcupdate.h:43, from /kisskb/src/include/linux/rculist.h:11, from /kisskb/src/include/linux/pid.h:5, from /kisskb/src/include/linux/sched.h:14, from /kisskb/src/arch/arm64/include/asm/compat.h:25, from /kisskb/src/arch/arm64/include/asm/stat.h:24, from /kisskb/src/include/linux/stat.h:6, from /kisskb/src/include/linux/module.h:10, from /kisskb/src/lib/test_hexdump.c:8: In function 'strncpy', inlined from 'test_hexdump_prepare_test.isra.0' at /kisskb/src/lib/test_hexdump.c:102:3: /kisskb/src/include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/lib/test_hexdump.c: In function 'test_hexdump_prepare_test.isra.0': /kisskb/src/include/linux/string.h:267:10: note: length computed here return __builtin_strlen(p); ^~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/isdn/hardware/eicon/message.c: In function 'sig_ind': /kisskb/src/drivers/isdn/hardware/eicon/message.c:5985:1: warning: the frame size of 2096 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ Completed OK # rm -rf /kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 # Build took: 0:18:06.127834