)]}' { "commit": "3756f6401c302617c5e091081ca4d26ab604bec5", "tree": "d6a81d1e3d4677dd7ccb556e25800f4bba418342", "parents": [ "302ec300ef8a545a7fc7f667e5fd743b091c2eeb" ], "author": { "name": "Arnd Bergmann", "email": "arnd@arndb.de", "time": "Thu Dec 14 15:32:41 2017 -0800" }, "committer": { "name": "Linus Torvalds", "email": "torvalds@linux-foundation.org", "time": "Thu Dec 14 16:00:48 2017 -0800" }, "message": "exec: avoid gcc-8 warning for get_task_comm\n\ngcc-8 warns about using strncpy() with the source size as the limit:\n\n fs/exec.c:1223:32: error: argument to \u0027sizeof\u0027 in \u0027strncpy\u0027 call is the same expression as the source; did you mean to use the size of the destination? [-Werror\u003dsizeof-pointer-memaccess]\n\nThis is indeed slightly suspicious, as it protects us from source\narguments without NUL-termination, but does not guarantee that the\ndestination is terminated.\n\nThis keeps the strncpy() to ensure we have properly padded target\nbuffer, but ensures that we use the correct length, by passing the\nactual length of the destination buffer as well as adding a build-time\ncheck to ensure it is exactly TASK_COMM_LEN.\n\nThere are only 23 callsites which I all reviewed to ensure this is\ncurrently the case. We could get away with doing only the check or\npassing the right length, but it doesn\u0027t hurt to do both.\n\nLink: http://lkml.kernel.org/r/20171205151724.1764896-1-arnd@arndb.de\nSigned-off-by: Arnd Bergmann \u003carnd@arndb.de\u003e\nSuggested-by: Kees Cook \u003ckeescook@chromium.org\u003e\nAcked-by: Kees Cook \u003ckeescook@chromium.org\u003e\nAcked-by: Ingo Molnar \u003cmingo@kernel.org\u003e\nCc: Alexander Viro \u003cviro@zeniv.linux.org.uk\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: Serge Hallyn \u003cserge@hallyn.com\u003e\nCc: James Morris \u003cjames.l.morris@oracle.com\u003e\nCc: Aleksa Sarai \u003casarai@suse.de\u003e\nCc: \"Eric W. Biederman\" \u003cebiederm@xmission.com\u003e\nCc: Frederic Weisbecker \u003cfrederic@kernel.org\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "6be2aa0ab26fe26cb37032b99bba656f8d7c6b51", "old_mode": 33188, "old_path": "fs/exec.c", "new_id": "156f56acfe8e7cce22cac60a0cf35635d274a1c3", "new_mode": 33188, "new_path": "fs/exec.c" }, { "type": "modify", "old_id": "21991d668d35231e625b95d99e2bd6826ba6a47e", "old_mode": 33188, "old_path": "include/linux/sched.h", "new_id": "5124ba7098301622af1a0f2217b31b462d0538b3", "new_mode": 33188, "new_path": "include/linux/sched.h" } ] }