Re: locks_remove_file() -> flock_lock_inode() sleeps in invalid context, false positive due to NULL dereference ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rafael,

On Wed, 7 Nov 2018 22:54:24 -0200 Rafael David Tinoco <rafael.tinoco@xxxxxxxxxx> wrote:
>
> NM for this one, just saw flock_make_lock() can return a ptr to struct
> file_lock *, after creating it from slab, or just populate a stack
> variable, like it is doing here.
> 
> For:
> 
> ...
> flock_make_lock(filp, LOCK_UN, &fl);
> fl.fl_flags |= FL_CLOSE;
> ...
> 
> I wonder if, for x86, we are just missing an initialization:
> 
> memset(&fl, 0, sizeof(struct file_lock));
> 
> in the beginning of locks_remove_flock().

I noticed that today's file-locks tree has added an initialisation for
fl ...

-- 
Cheers,
Stephen Rothwell

Attachment: pgpXinAujpN90.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux