# Re: \[PATCH v10 02/17\] file: Export receive\_fd() to modules

- From: Jason Wang \<hidden\>
- Date: 2021-08-04 08:27:59 
- List: virtualization
- Page: https://ratatoskr.run/virtualization/2021/08/211592
- Thread: https://ratatoskr.run/netdev/2021/07/211212/t.md

```text

在 2021/8/3 下午5:01, Yongji Xie 写道:
> On Tue, Aug 3, 2021 at 3:46 PM Jason Wang [ref] wrote:
>>
>> 在 2021/7/29 下午3:34, Xie Yongji 写道:
>>> Export receive_fd() so that some modules can use
>>> it to pass file descriptor between processes without
>>> missing any security stuffs.
>>>
>>> Signed-off-by: Xie Yongji <redacted>
>>> ---
>>>    fs/file.c            | 6 ++++++
>>>    include/linux/file.h | 7 +++----
>>>    2 files changed, 9 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/fs/file.c b/fs/file.c
>>> index 86dc9956af32..210e540672aa 100644
>>> --- a/fs/file.c
>>> +++ b/fs/file.c
>>> @@ -1134,6 +1134,12 @@ int receive_fd_replace(int new_fd, struct file *file, unsigned int o_flags)
>>>        return new_fd;
>>>    }
>>>
>>> +int receive_fd(struct file *file, unsigned int o_flags)
>>> +{
>>> +     return __receive_fd(file, NULL, o_flags);
>>
>> Any reason that receive_fd_user() can live in the file.h?
>>
> Since no modules use it.
>
> Thanks,
> Yongji


Ok.


Acked-by: Jason Wang <redacted>


>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
```
