lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 13 May 2022 15:48:23 +0530 From: Charan Teja Kalla <quic_charante@...cinc.com> To: Greg KH <gregkh@...uxfoundation.org> CC: <christian.koenig@....com>, <sumit.semwal@...aro.org>, <hridya@...gle.com>, <daniel.vetter@...ll.ch>, <tjmercier@...gle.com>, <linux-media@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>, <linaro-mm-sig@...ts.linaro.org>, <linux-kernel@...r.kernel.org> Subject: Re: [PATCH V3] dma-buf: ensure unique directory name for dmabuf stats On 5/13/2022 3:41 PM, Greg KH wrote: >> Reported-by: kernel test robot <lkp@...el.com> > The trest robot did not say that the dmabuf stat name was being > duplicated, did it? > It reported a printk warning on V2[1]. Should we remove this on V3? @Christian: Could you please drop this tag while merging? [1] https://lore.kernel.org/all/202205110511.E0d8TXXC-lkp@intel.com/ >> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c >> index a6fc96e..0ad5039 100644 >> --- a/drivers/dma-buf/dma-buf.c >> +++ b/drivers/dma-buf/dma-buf.c >> @@ -407,6 +407,7 @@ static inline int is_dma_buf_file(struct file *file) >> >> static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) >> { >> + static atomic64_t dmabuf_inode = ATOMIC64_INIT(0); >> struct file *file; >> struct inode *inode = alloc_anon_inode(dma_buf_mnt->mnt_sb); >> >> @@ -416,6 +417,13 @@ static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) >> inode->i_size = dmabuf->size; >> inode_set_bytes(inode, dmabuf->size); >> >> + /* >> + * The ->i_ino acquired from get_next_ino() is not unique thus >> + * not suitable for using it as dentry name by dmabuf stats. >> + * Override ->i_ino with the unique and dmabuffs specific >> + * value. >> + */ >> + inode->i_ino = atomic64_add_return(1, &dmabuf_inode); >> file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf", >> flags, &dma_buf_fops); >> if (IS_ERR(file)) >> -- >> 2.7.4 >> > Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org> Thanks for the ACK. --Charan
Powered by blists - more mailing lists