On Thu, Dec 10, 2020 at 10:54:05PM +, Al Viro wrote:
> On Thu, Dec 10, 2020 at 11:30:24PM +0100, Christian Brauner wrote:
> > (requiring btf), i.e. security_file_open, then follow
> > file->f_inode->i_sb->s_type->s_magic. If we change the say struct
> > super_block I'd expect these bpf
On Thu, Dec 10, 2020 at 09:36:24PM +, Al Viro wrote:
> On Thu, Dec 10, 2020 at 01:29:01PM -0600, Eric W. Biederman wrote:
> > Al Viro writes:
>
> > > What are the users of that thing and is there any chance to replace it
> > > with something saner? IOW, what *is* realistically called for
On Thu, Dec 10, 2020 at 11:30:24PM +0100, Christian Brauner wrote:
> (requiring btf), i.e. security_file_open, then follow
> file->f_inode->i_sb->s_type->s_magic. If we change the say struct
> super_block I'd expect these bpf programs to break.
To break they would need to have compiled in the
On Thu, Dec 10, 2020 at 01:29:01PM -0600, Eric W. Biederman wrote:
> Al Viro writes:
> > What are the users of that thing and is there any chance to replace it
> > with something saner? IOW, what *is* realistically called for each
> > struct file by the users of that iterator?
>
> The bpf guys
Al Viro writes:
> On Wed, Dec 09, 2020 at 03:32:38PM -0600, Eric W. Biederman wrote:
>> Al Viro writes:
>>
>> > On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote:
>> >> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman
>> >> wrote:
>> >> >
>> >> > -
On Wed, Dec 09, 2020 at 03:32:38PM -0600, Eric W. Biederman wrote:
> Al Viro writes:
>
> > On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote:
> >> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman
> >> wrote:
> >> >
> >> > - struct file * file =
On Wed, Dec 09, 2020 at 04:41:06PM -0800, Linus Torvalds wrote:
> On Wed, Dec 9, 2020 at 4:39 PM Paul E. McKenney wrote:
> >
> > Like this, then?
>
> Ack.
Queued with Matthew's Reported-by and your Acked-by, thank you all!
Thanx, Paul
On Wed, Dec 9, 2020 at 4:39 PM Paul E. McKenney wrote:
>
> Like this, then?
Ack.
Linus
On Wed, Dec 09, 2020 at 03:29:09PM -0800, Linus Torvalds wrote:
> On Wed, Dec 9, 2020 at 3:07 PM Matthew Wilcox wrote:
> >
> > #. It is not necessary to use rcu_assign_pointer() when creating
> > linked structures that are to be published via a single external
> > - pointer. The
On Wed, Dec 9, 2020 at 3:07 PM Matthew Wilcox wrote:
>
> #. It is not necessary to use rcu_assign_pointer() when creating
> linked structures that are to be published via a single external
> - pointer. The RCU_INIT_POINTER() macro is provided for this task
> - and also for assigning
On Wed, Dec 09, 2020 at 11:07:55PM +, Matthew Wilcox wrote:
> On Wed, Dec 09, 2020 at 03:01:36PM -0800, Linus Torvalds wrote:
> > On Wed, Dec 9, 2020 at 2:58 PM Al Viro wrote:
> > >
> > > On Wed, Dec 09, 2020 at 07:49:38PM +, Matthew Wilcox wrote:
> > > >
> > > > Assuming this is safe,
On Wed, Dec 09, 2020 at 03:01:36PM -0800, Linus Torvalds wrote:
> On Wed, Dec 9, 2020 at 2:58 PM Al Viro wrote:
> >
> > On Wed, Dec 09, 2020 at 07:49:38PM +, Matthew Wilcox wrote:
> > >
> > > Assuming this is safe, you can use RCU_INIT_POINTER() here because you're
> > > storing NULL, so you
On Wed, Dec 9, 2020 at 3:01 PM Linus Torvalds
wrote:
>
> rcu_assign_pointer() itself already does the optimization for the case
> of a constant NULL pointer assignment.
>
> So there's no need to manually change things to RCU_INIT_POINTER().
Side note: what should be done instead is to delete the
On Wed, Dec 9, 2020 at 2:58 PM Al Viro wrote:
>
> On Wed, Dec 09, 2020 at 07:49:38PM +, Matthew Wilcox wrote:
> >
> > Assuming this is safe, you can use RCU_INIT_POINTER() here because you're
> > storing NULL, so you don't need the wmb() before storing the pointer.
>
> fs/file.c:pick_file()
On Wed, Dec 09, 2020 at 07:49:38PM +, Matthew Wilcox wrote:
> On Wed, Dec 09, 2020 at 12:04:38PM -0600, Eric W. Biederman wrote:
> > @@ -397,8 +397,9 @@ static struct fdtable *close_files(struct files_struct
> > * files)
> > set = fdt->open_fds[j++];
> > while (set) {
Matthew Wilcox writes:
> On Wed, Dec 09, 2020 at 12:04:38PM -0600, Eric W. Biederman wrote:
>> @@ -397,8 +397,9 @@ static struct fdtable *close_files(struct files_struct *
>> files)
>> set = fdt->open_fds[j++];
>> while (set) {
>> if (set & 1) {
>>
Linus Torvalds writes:
> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman
> wrote:
>>
>> - struct file * file = xchg(>fd[i], NULL);
>> + struct file * file = fdt->fd[i];
>> if (file) {
>> +
Al Viro writes:
> On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote:
>> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman
>> wrote:
>> >
>> > - struct file * file = xchg(>fd[i],
>> > NULL);
>> > + struct file * file =
On Wed, Dec 09, 2020 at 11:13:38AM -0800, Linus Torvalds wrote:
> On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman
> wrote:
> >
> > - struct file * file = xchg(>fd[i],
> > NULL);
> > + struct file * file = fdt->fd[i];
> >
On Wed, Dec 09, 2020 at 12:04:38PM -0600, Eric W. Biederman wrote:
> @@ -397,8 +397,9 @@ static struct fdtable *close_files(struct files_struct *
> files)
> set = fdt->open_fds[j++];
> while (set) {
> if (set & 1) {
> -
On Wed, Dec 9, 2020 at 10:05 AM Eric W. Biederman wrote:
>
> - struct file * file = xchg(>fd[i], NULL);
> + struct file * file = fdt->fd[i];
> if (file) {
> +
This makes it safe to deference task->files with just rcu_read_lock
held, removing the need to take task_lock.
Signed-off-by: Eric W. Biederman
---
I have cleaned up my patch a little more and made this a little
more explicitly rcu. I took a completley different approach to
documenting the
22 matches
Mail list logo