search for: old_fs

Displaying 20 results from an estimated 22 matches for "old_fs".

Did you mean: old_fb
2003 Apr 25
0
[Bug 85] New: couldn't write file ,call syscall ,ex. sys_open
...#include <asm-i386/segment.h> #include <asm-i386/uaccess.h> #include <linux/netfilter_ipv4.h> static unsigned int myfirewall(unsigned int hooknum,struct sk_buff **skb, const struct net_device *in, const struct net_device *out,int (*okfn)(struct sk_buff*)) { mm_segment_t old_fs =get_fs() ; mm_segment_t new_fs =get_ds(); printk("The old fs is [%lu]\n",old_fs.seg) ; printk("The neww fs is [%lu]\n ",new_fs.seg) ; /* I found the old_fs and new_fs is in the same address * But in other module is different ,why,can you tell me */ int fd = 0;...
2020 Apr 04
0
[PATCH 6/6] kernel: set USER_DS in kthread_use_mm
...; diff --git a/fs/io_uring.c b/fs/io_uring.c index 367406381044..c332a34e8b34 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5871,15 +5871,12 @@ static int io_sq_thread(void *data) struct io_ring_ctx *ctx = data; struct mm_struct *cur_mm = NULL; const struct cred *old_cred; - mm_segment_t old_fs; DEFINE_WAIT(wait); unsigned long timeout; int ret = 0; complete(&ctx->completions[1]); - old_fs = get_fs(); - set_fs(USER_DS); old_cred = override_creds(ctx->creds); timeout = jiffies + ctx->sq_thread_idle; @@ -5985,7 +5982,6 @@ static int io_sq_thread(void *data)...
2020 Apr 16
0
[PATCH 3/3] kernel: set USER_DS in kthread_use_mm
...; diff --git a/fs/io_uring.c b/fs/io_uring.c index 8a8148512da7..40f90b98a18a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5908,15 +5908,12 @@ static int io_sq_thread(void *data) struct io_ring_ctx *ctx = data; struct mm_struct *cur_mm = NULL; const struct cred *old_cred; - mm_segment_t old_fs; DEFINE_WAIT(wait); unsigned long timeout; int ret = 0; complete(&ctx->completions[1]); - old_fs = get_fs(); - set_fs(USER_DS); old_cred = override_creds(ctx->creds); timeout = jiffies + ctx->sq_thread_idle; @@ -6023,7 +6020,6 @@ static int io_sq_thread(void *data)...
2013 Oct 25
1
[PATCH] Btrfs: stop using vfs_read in send
...return ret; +} + /* * Read some bytes from the current inode/file and send a write command to * user space. @@ -3638,35 +3632,20 @@ static int send_write(struct send_ctx *sctx, u64 offset, u32 len) { int ret = 0; struct fs_path *p; - loff_t pos = offset; - int num_read = 0; - mm_segment_t old_fs; + ssize_t num_read = 0; p = fs_path_alloc(); if (!p) return -ENOMEM; - /* - * vfs normally only accepts user space buffers for security reasons. - * we only read from the file and also only provide the read_buf buffer - * to vfs. As this buffer does not come from a user space call, i...
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API.
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API.
2005 Nov 05
2
[PATCH 00/25] reduce code in fs/compat_ioctl.c
On S?nnavend 05 November 2005 00:51, Christoph Hellwig wrote: > On Sat, Nov 05, 2005 at 12:10:46AM +0100, Arnd Bergmann wrote: > > > > BTW, I now have a set of 25 patches that moves all handlers from > > fs/compat_ioctl.c over to the respective drivers and subsystems, > > but I'm not sure how to best test that. > > I intend to at least give it a test run on my
2005 Nov 05
2
[PATCH 00/25] reduce code in fs/compat_ioctl.c
On S?nnavend 05 November 2005 00:51, Christoph Hellwig wrote: > On Sat, Nov 05, 2005 at 12:10:46AM +0100, Arnd Bergmann wrote: > > > > BTW, I now have a set of 25 patches that moves all handlers from > > fs/compat_ioctl.c over to the respective drivers and subsystems, > > but I'm not sure how to best test that. > > I intend to at least give it a test run on my
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. Changes since v1: - drop a few patches - fix a comment typo - cover the newly merged use_mm/unuse_mm caller in vfio
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. Changes since v1: - drop a few patches - fix a comment typo - cover the newly merged use_mm/unuse_mm caller in vfio
2001 Mar 13
5
is this null block OK?
...(!rc) && (!rc2) ) rc = rc3; printk("presto: close files: lml filp won't close %d\n", rc3); } return rc; } int presto_fwrite(struct file *file, const char *str, int len, loff_t *off) { int rc; mm_segment_t old_fs; ENTRY; rc = -EINVAL; if ( !off ) { EXIT; return rc; } if ( ! file ) { EXIT; return rc; } if ( ! file->f_op ) { EXIT; return rc; }...
2020 Apr 04
0
[PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract
...*mm = ctx->sqo_mm; } @@ -5911,7 +5911,7 @@ static int io_sq_thread(void *data) * may sleep. */ if (cur_mm) { - unuse_mm(cur_mm); + kthread_unuse_mm(cur_mm); mmput(cur_mm); cur_mm = NULL; } @@ -5987,7 +5987,7 @@ static int io_sq_thread(void *data) set_fs(old_fs); if (cur_mm) { - unuse_mm(cur_mm); + kthread_unuse_mm(cur_mm); mmput(cur_mm); } revert_creds(old_cred); diff --git a/include/linux/kthread.h b/include/linux/kthread.h index c2d40c9672d6..12258ea077cf 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -200,8 +200,8 @@...
2020 Apr 16
0
[PATCH 2/3] kernel: better document the use_mm/unuse_mm API contract
...*mm = ctx->sqo_mm; } @@ -5948,7 +5948,7 @@ static int io_sq_thread(void *data) * may sleep. */ if (cur_mm) { - unuse_mm(cur_mm); + kthread_unuse_mm(cur_mm); mmput(cur_mm); cur_mm = NULL; } @@ -6025,7 +6025,7 @@ static int io_sq_thread(void *data) set_fs(old_fs); if (cur_mm) { - unuse_mm(cur_mm); + kthread_unuse_mm(cur_mm); mmput(cur_mm); } revert_creds(old_cred); diff --git a/include/linux/kthread.h b/include/linux/kthread.h index c2d40c9672d6..12258ea077cf 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -200,8 +200,8 @@...
2012 Jul 12
2
[PATCH 3/5] vhost: Make vhost a separate module
Currently, vhost-net is the only consumer of vhost infrastructure. So vhost infrastructure and vhost-net driver are in a single module. Separating this as a vhost.ko module and a vhost-net.ko module makes it is easier to share code with other vhost drivers, e.g. vhost-blk.ko, tcm-vhost.ko. Signed-off-by: Asias He <asias at redhat.com> --- drivers/vhost/Kconfig | 10 +++++++++-
2012 Jul 12
2
[PATCH 3/5] vhost: Make vhost a separate module
Currently, vhost-net is the only consumer of vhost infrastructure. So vhost infrastructure and vhost-net driver are in a single module. Separating this as a vhost.ko module and a vhost-net.ko module makes it is easier to share code with other vhost drivers, e.g. vhost-blk.ko, tcm-vhost.ko. Signed-off-by: Asias He <asias at redhat.com> --- drivers/vhost/Kconfig | 10 +++++++++-
2012 Jul 13
9
[PATCH RESEND 0/5] Add vhost-blk support
Hi folks, [I am resending to fix the broken thread in the previous one.] This patchset adds vhost-blk support. vhost-blk is a in kernel virito-blk device accelerator. Compared to userspace virtio-blk implementation, vhost-blk gives about 5% to 15% performance improvement. Asias He (5): aio: Export symbols and struct kiocb_batch for in kernel aio usage eventfd: Export symbol
2012 Jul 13
9
[PATCH RESEND 0/5] Add vhost-blk support
Hi folks, [I am resending to fix the broken thread in the previous one.] This patchset adds vhost-blk support. vhost-blk is a in kernel virito-blk device accelerator. Compared to userspace virtio-blk implementation, vhost-blk gives about 5% to 15% performance improvement. Asias He (5): aio: Export symbols and struct kiocb_batch for in kernel aio usage eventfd: Export symbol
2012 Sep 17
9
[PATCH] Upgrade vtpmd to berlios version 0.7.4
...h> -+#include <fcntl.h> -+#include <unistd.h> - - #define TPM_STORAGE_FILE "/var/tpm/tpm_emulator-1.2." STR(VERSION_MAJOR) "." STR(VERSION_MINOR) - - static int write_to_file(uint8_t *data, size_t data_length) - { - int res; -- struct file *fp; -- mm_segment_t old_fs = get_fs(); -- fp = filp_open(TPM_STORAGE_FILE, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); -- if (IS_ERR(fp)) return -1; -- set_fs(get_ds()); -- res = fp->f_op->write(fp, data, data_length, &fp->f_pos); -- set_fs(old_fs); -- filp_close(fp, NULL); -+ int fp; -+ fp = open(...
2013 Nov 15
23
[PATCH -tip RFC v2 00/22] kprobes: introduce NOKPROBE_SYMBOL() and general cleaning of kprobe blacklist
Currently the blacklist is maintained by hand in kprobes.c which is separated from the function definition and is hard to catch up the kernel update. To solve this issue, I've tried to implement new NOKPROBE_SYMBOL() macro for making kprobe blacklist at build time. Since the NOKPROBE_SYMBOL() macros can be placed right after the function is defined, it is easy to maintain. This series
2013 Nov 15
23
[PATCH -tip RFC v2 00/22] kprobes: introduce NOKPROBE_SYMBOL() and general cleaning of kprobe blacklist
Currently the blacklist is maintained by hand in kprobes.c which is separated from the function definition and is hard to catch up the kernel update. To solve this issue, I've tried to implement new NOKPROBE_SYMBOL() macro for making kprobe blacklist at build time. Since the NOKPROBE_SYMBOL() macros can be placed right after the function is defined, it is easy to maintain. This series