From: Bhupesh Sharma <bhsharma@igalia.com>
To: Kees Cook <kees@kernel.org>
Cc: Bhupesh <bhupesh@igalia.com>,
akpm@linux-foundation.org, kernel-dev@igalia.com,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, oliver.sang@intel.com, lkp@intel.com,
laoar.shao@gmail.com, pmladek@suse.com, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, arnaldo.melo@gmail.com,
alexei.starovoitov@gmail.com, andrii.nakryiko@gmail.com,
mirq-linux@rere.qmqm.pl, peterz@infradead.org,
willy@infradead.org, david@redhat.com, viro@zeniv.linux.org.uk,
ebiederm@xmission.com, brauner@kernel.org, jack@suse.cz,
mingo@redhat.com, juri.lelli@redhat.com, bsegall@google.com,
mgorman@suse.de, vschneid@redhat.com
Subject: Re: [PATCH v2 1/3] exec: Dynamically allocate memory to store task's full name
Date: Wed, 9 Apr 2025 17:01:05 +0530 [thread overview]
Message-ID: <35b4fe2a-606c-f25c-0d5c-1abb6e7b3003@igalia.com> (raw)
In-Reply-To: <202504041023.A21FA17DDC@keescook>
Hi Kees,
Sorry for the delay - I was out for a couple of days.
On 4/4/25 10:54 PM, Kees Cook wrote:
> On Fri, Apr 04, 2025 at 12:18:56PM +0530, Bhupesh Sharma wrote:
>> In another review for this series, Yafang mentioned the following cleanup +
>> approach suggested by Linus (see [0]).
>> Also I have summarized my understanding on the basis of the suggestions
>> Linus shared and the accompanying background threads (please see [1]).
>>
>> Kindly share your views on the same, so that I can change the implementation
>> in v3 series accordingly.
> In thinking about this a little more I think we can't universally change
> all the APIs to use the new full_name since it is a pointer, which may
> be getting changed out from under readers if a setter changes it. So
> this may need some careful redesign, likely with RCU. hmm.
>
Thinking more about this, Linus mentioned in [0]:
'Since user space can randomly change their names anyway, using locking
was always wrong for readers (for writers it probably does make sense
to have some lock'
So, if we go with the union approach, probably we can do with just a writer-lock, whereas if we go with a task->full_name like pointer one, we would probably need a rcu lock.
Please let me know your comments.
[0]. https://lore.kernel.org/all/CAHk-=wivfrF0_zvf+oj6==Sh=-npJooP8chLPEfaFV0oNYTTBA@mail.gmail.com/
next prev parent reply other threads:[~2025-04-09 11:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 12:18 [PATCH v2 0/3] Dynamically allocate memory to store task's full name Bhupesh
2025-03-31 12:18 ` [PATCH v2 1/3] exec: " Bhupesh
2025-04-01 2:07 ` Yafang Shao
2025-04-04 6:35 ` Bhupesh Sharma
2025-04-06 2:28 ` Yafang Shao
2025-04-09 11:13 ` Bhupesh Sharma
2025-04-01 4:02 ` Harry Yoo
2025-04-04 5:31 ` Bhupesh Sharma
2025-04-03 16:17 ` Andrii Nakryiko
2025-04-04 5:36 ` Bhupesh Sharma
2025-04-03 16:30 ` Kees Cook
2025-04-04 6:48 ` Bhupesh Sharma
2025-04-04 17:24 ` Kees Cook
2025-04-09 11:31 ` Bhupesh Sharma [this message]
2025-03-31 12:18 ` [PATCH v2 2/3] fs/proc: Pass 'task->full_name' via 'proc_task_name()' Bhupesh
2025-03-31 12:18 ` [PATCH v2 3/3] kthread: Use 'task_struct->full_name' to store kthread's full name Bhupesh
2025-04-03 16:24 ` Kees Cook
2025-04-04 6:38 ` Bhupesh Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35b4fe2a-606c-f25c-0d5c-1abb6e7b3003@igalia.com \
--to=bhsharma@igalia.com \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=bhupesh@igalia.com \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=bsegall@google.com \
--cc=david@redhat.com \
--cc=ebiederm@xmission.com \
--cc=jack@suse.cz \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=kernel-dev@igalia.com \
--cc=laoar.shao@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vschneid@redhat.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).