Message ID | 20220120020822.I2yQQ39wx%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D4EC433FE for <linux-mm@archiver.kernel.org>; Thu, 20 Jan 2022 02:08:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9C516B0096; Wed, 19 Jan 2022 21:08:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E4B476B0098; Wed, 19 Jan 2022 21:08:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D13266B0099; Wed, 19 Jan 2022 21:08:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id C26B86B0096 for <linux-mm@kvack.org>; Wed, 19 Jan 2022 21:08:26 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8899495C92 for <linux-mm@kvack.org>; Thu, 20 Jan 2022 02:08:26 +0000 (UTC) X-FDA: 79049031012.28.A9E7E11 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf11.hostedemail.com (Postfix) with ESMTP id 289D84002D for <linux-mm@kvack.org>; Thu, 20 Jan 2022 02:08:26 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1B769B81C9F; Thu, 20 Jan 2022 02:08:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40683C004E1; Thu, 20 Jan 2022 02:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642644503; bh=O6zypJLFMy0RfX3u7/FHbhcHAHSZNrmmm76fs+WWiCc=; h=Date:From:To:Subject:In-Reply-To:From; b=R7L777ivrFhH57I1Up2QjUcfhxO6t5AUswPbVTi+8jito10Gv0Qu05mzbADYkz1pp 2FiAIBTiPT6uPStdRkdQ9tKlN79GmPD9YOTVZNyqzDkE0NTwNTIZNaA1VgwF+DwVrO 2QLlJudQGDVJWePD2eAFiCLagaLsFeMu/W7K/dcY= Date: Wed, 19 Jan 2022 18:08:22 -0800 From: Andrew Morton <akpm@linux-foundation.org> To: akpm@linux-foundation.org, alexei.starovoitov@gmail.com, andrii.nakryiko@gmail.com, andrii@kernel.org, arnaldo.melo@gmail.com, david@redhat.com, dennis.dalessandro@cornelisnetworks.com, keescook@chromium.org, laoar.shao@gmail.com, linux-mm@kvack.org, mathieu.desnoyers@efficios.com, mirq-linux@rere.qmqm.pl, mm-commits@vger.kernel.org, peterz@infradead.org, pmladek@suse.com, rostedt@goodmis.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, willy@infradead.org Subject: [patch 13/55] fs/exec: replace strncpy with strscpy_pad in __get_task_comm Message-ID: <20220120020822.I2yQQ39wx%akpm@linux-foundation.org> In-Reply-To: <20220119180714.9e187ce100e4510de3cd9f7d@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 289D84002D X-Stat-Signature: r6crghdfrdahon1y7encxapdf4aaiwmj Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=R7L777iv; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1642644506-786822 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[01/55] mm: percpu: generalize percpu related config
|
expand
|
--- a/fs/exec.c~fs-exec-replace-strncpy-with-strscpy_pad-in-__get_task_comm +++ a/fs/exec.c @@ -1207,7 +1207,8 @@ static int unshare_sighand(struct task_s char *__get_task_comm(char *buf, size_t buf_size, struct task_struct *tsk) { task_lock(tsk); - strncpy(buf, tsk->comm, buf_size); + /* Always NUL terminated and zero-padded */ + strscpy_pad(buf, tsk->comm, buf_size); task_unlock(tsk); return buf; }