Re: 3.7.10+: BUG Dentry still in use [unmount of cifs cifs]

2013-03-07 Thread Mateusz Guzik
) with reads as well, which should match your scenario. I attached a patch that deals with this problem by grabbing refcounts to cifs superblock on cifsInodeInfo creation. This delays sb destruction until all cifsInodeInfos are gone. I didn't test it on 3.7.10 kernel but it should work fine. -- Mateusz

Re: disappearing listen()ed SO_REUSEPORT sockets across fork() when using epoll

2013-11-25 Thread Mateusz Guzik
On Mon, Nov 25, 2013 at 11:53:24AM -0800, Shawn Landden wrote: On Mon, Nov 25, 2013 at 10:05 AM, Jason Baron jba...@akamai.com wrote: On 11/22/2013 12:53 PM, Shawn Landden wrote: Hello, when running the attached program on 3.12 child processes are missing a socket fd opened, set with

[PATCH 3.10] aio: restore locking of ioctx list on removal

2013-12-05 Thread Mateusz Guzik
the ioctx list to table lookup v3. Fix the problem by restoring appropriate locking. Signed-off-by: Mateusz Guzik mgu...@redhat.com Reported-by: Eryu Guan eg...@redhat.com Cc: Jeff Moyer jmo...@redhat.com Cc: Kent Overstreet k...@daterainc.com Cc: linux-...@kvack.org Cc: linux-kernel@vger.kernel.org

Re: [PATCH 3.10] aio: restore locking of ioctx list on removal

2013-12-06 Thread Mateusz Guzik
On Thu, Dec 05, 2013 at 05:03:47PM -0800, Greg KH wrote: On Thu, Dec 05, 2013 at 11:09:02AM +0100, Mateusz Guzik wrote: Commit 36f5588905c10a8c4568a210d601fe8c3c27e0f0 aio: refcounting cleanup resulted in ioctx_lock not being held during ctx removal, leaving the list susceptible

Re: [PATCH] mm/swap: fix race on swap_info reuse between swapoff and swapon

2014-01-12 Thread Mateusz Guzik
now. SWP_USED would be cleared as it is and would be set in _enable_swap_info Then swap_info_get would be left unchanged and swap_* would test for SWP_USED only. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

[PATCH] aio: simplify exit_aio

2014-02-18 Thread Mateusz Guzik
-by: Mateusz Guzik mgu...@redhat.com --- fs/aio.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 062a5f6..0701181 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -766,38 +766,35 @@ void exit_aio(struct mm_struct *mm) { struct

[PATCH] kref: oops on zero or negative refcount

2014-02-20 Thread Mateusz Guzik
or underflow. Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: Rik van Riel r...@redhat.com --- include/linux/kref.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/kref.h b/include/linux/kref.h index 484604d..c3f8a0a 100644 --- a/include/linux/kref.h +++ b/include

Re: [PATCH] kref: oops on zero or negative refcount

2014-02-21 Thread Mateusz Guzik
On Thu, Feb 20, 2014 at 01:14:40PM -0500, Dave Jones wrote: On Thu, Feb 20, 2014 at 06:44:59PM +0100, Mateusz Guzik wrote: In use after free situations, it is possible for one thread to write to memory that has just been reallocated to a new user. This could open up potential security

[PATCH] NFS: populate -net in mount data when remounting

2014-06-10 Thread Mateusz Guzik
Otherwise the kernel oopses when remounting with IPv6 server because net is dereferenced in dev_get_by_name. Use net ns of current thread so that dev_get_by_name does not operate on foreign ns. Changing the address is prohibited anyway so this should not affect anything. Signed-off-by: Mateusz

Re: [PATCH] net: ipv4: current group_info should be put after using.

2014-05-11 Thread Mateusz Guzik
13 10:01:00 2011 + net: ipv4: add IPPROTO_ICMP socket kind starting with 3.0. Thanks, -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-15 Thread Mateusz Guzik
On Thu, May 15, 2014 at 07:54:57AM +1000, Dave Chinner wrote: On Tue, May 13, 2014 at 08:31:02PM +0200, Mateusz Guzik wrote: This helps hang troubleshooting efforts when only dmesg is available. I really don't think that spamming dmesg every time a filesystem is frozen or thawed is a good

Re: [PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-15 Thread Mateusz Guzik
PM, Dave Chinner wrote: On Thu, May 15, 2014 at 08:00:52AM +1000, Dave Chinner wrote: On Wed, May 14, 2014 at 01:39:45PM +0200, Jan Kara wrote: On Wed 14-05-14 13:26:21, Mateusz Guzik wrote: On Wed, May 14, 2014 at 01:14:49PM +0200, Jan Kara wrote: On Wed 14-05-14 00:04:43, Mateusz

Re: WARN in do_rt_tgsigqueueinfo()

2014-05-15 Thread Mateusz Guzik
] ---[ end trace 02450728e2526283 ]--- This is apparently a very common thing to hit according to google. Well, it warns about an argument received from userland, so nothing fishy going on as far as kernel consistency is concerned if that's what you mean. -- Mateusz Guzik -- To unsubscribe from

Re: [PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-15 Thread Mateusz Guzik
On Fri, May 16, 2014 at 08:21:35AM +1000, Dave Chinner wrote: On Thu, May 15, 2014 at 12:47:48PM +0200, Mateusz Guzik wrote: On Thu, May 15, 2014 at 12:40:19PM +0200, Lukáš Czerner wrote: On Wed, 14 May 2014, Eric Sandeen wrote: Date: Wed, 14 May 2014 17:40:22 -0500 From: Eric

Re: [PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-15 Thread Mateusz Guzik
On Fri, May 16, 2014 at 08:51:41AM +1000, Dave Chinner wrote: On Fri, May 16, 2014 at 12:34:40AM +0200, Mateusz Guzik wrote: On Fri, May 16, 2014 at 08:21:35AM +1000, Dave Chinner wrote: IOW, a new column in mountinfo. For frozen filesystems it would contain 'frozen_by=[%s]:[%d

Re: [PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-15 Thread Mateusz Guzik
On Fri, May 16, 2014 at 10:11:56AM +1000, Dave Chinner wrote: On Fri, May 16, 2014 at 01:19:09AM +0200, Mateusz Guzik wrote: Except there is no log entry if /var got frozen (and this is not an imaginary example). Freezing the filesystem that the freezing daemon logs to is, well, a major

Re: [PATCH] kref: warn on uninitialized kref

2014-05-17 Thread Mateusz Guzik
. i.e. WARN_ON(count atomic_read(kref-refcount)); this also detects your original problem. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
pairs like: sprintf(dp, ...); dp += strlen(...) with: dp += sprintf(dp, ...); -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read

Re: [PATCH] i2c: busses: i2c-pxa.c: Fix for possible null pointer dereference

2014-05-17 Thread Mateusz Guzik
for this function may not be called when you jump here. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
On Sat, May 17, 2014 at 06:21:09PM +0100, Al Viro wrote: On Sat, May 17, 2014 at 05:44:28PM +0200, Mateusz Guzik wrote: This particular function would be better of with removing this variable and replacing all pairs like: sprintf(dp, ...); dp += strlen(...) with: dp += sprintf(dp

[PATCH 1/2] fs: include device name in error messages about freezing

2014-05-13 Thread Mateusz Guzik
While here use pr_err instead of printk(KERN_ERR...) Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: linux-fsde...@vger.kernel.org Cc: Josef Bacik jba...@fb.com Cc: Jan Kara j...@suse.cz Cc: Al Viro v...@zeniv.linux.org.uk Cc: Eric Sandeen esand...@redhat.com --- fs/super.c | 6 ++ 1

[PATCH 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-13 Thread Mateusz Guzik
This helps hang troubleshooting efforts when only dmesg is available. Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: linux-fsde...@vger.kernel.org Cc: Josef Bacik jba...@fb.com Cc: Jan Kara j...@suse.cz Cc: Al Viro v...@zeniv.linux.org.uk Cc: Eric Sandeen esand...@redhat.com --- fs/super.c

Re: [PATCH 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-13 Thread Mateusz Guzik
On Tue, May 13, 2014 at 11:39:31AM -0700, Joe Perches wrote: On Tue, 2014-05-13 at 20:31 +0200, Mateusz Guzik wrote: This helps hang troubleshooting efforts when only dmesg is available. [] diff --git a/fs/super.c b/fs/super.c [] @@ -1289,12 +1289,9 @@ int freeze_super(struct super_block

Re: [PATCH 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-13 Thread Mateusz Guzik
On Tue, May 13, 2014 at 12:00:21PM -0700, Joe Perches wrote: On Tue, 2014-05-13 at 20:53 +0200, Mateusz Guzik wrote: This is the same code which you can find at the end of the function. I added the label so that I can write freeze printk only once. Yes, but for a read-only filesystem

[PATCH V2 1/2] fs: include device name in error messages about freezing

2014-05-13 Thread Mateusz Guzik
While here use pr_err instead of printk(KERN_ERR...) Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: linux-fsde...@vger.kernel.org Cc: Josef Bacik jba...@fb.com Cc: Jan Kara j...@suse.cz Cc: Al Viro v...@zeniv.linux.org.uk Cc: Eric Sandeen esand...@redhat.com --- fs/super.c | 6 ++ 1 file

[PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-13 Thread Mateusz Guzik
This helps hang troubleshooting efforts when only dmesg is available. While here remove code duplication with MS_RDONLY case and fix a whitespace nit. Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: linux-fsde...@vger.kernel.org Cc: Josef Bacik jba...@fb.com Cc: Jan Kara j...@suse.cz Cc: Al

Re: [PATCH v2] x86: kaslr to avoid setup_data regions

2014-05-14 Thread Mateusz Guzik
-hdr.setup_data examination is correct, so not commenting on that. What prevents the loop from overflowing the table? Additinally reaching the limit should at least result in a big fat warning. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCH V2 2/2] fs: print a message when freezing/unfreezing filesystems

2014-05-14 Thread Mateusz Guzik
On Wed, May 14, 2014 at 01:14:49PM +0200, Jan Kara wrote: On Wed 14-05-14 00:04:43, Mateusz Guzik wrote: This helps hang troubleshooting efforts when only dmesg is available. While here remove code duplication with MS_RDONLY case and fix a whitespace nit. I'm somewhat undecided here I

[PATCH] sched: fix possible divide by zero in avg_atom calculation

2014-06-14 Thread Mateusz Guzik
calculations of avg_atom for big nr_switches are now correct. Signed-off-by: Mateusz Guzik mgu...@redhat.com Cc: Ingo Molnar mi...@redhat.com Cc: Peter Zijlstra pet...@infradead.org Cc: sta...@vger.kernel.org --- kernel/sched/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH] Check for Null return from logfs_readpage_nolock in btree_write_block

2014-06-16 Thread Mateusz Guzik
can be found here: http://kernelnewbies.org/FAQ/KernelCompilation I would also suggest letting the patch wait few hours and have another look before sending. Cheers, -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [RFC][PATCH 3/3] audit: Audit proc cmdline value

2014-01-06 Thread Mateusz Guzik
be swapped in due to I/O errors). Also since you are just putting 0 in there anyway I don't see much point in testing for it. + context-cmdline = buf; + } + msg = context-cmdline; +out: + audit_log_untrustedstring(ab, msg); +} + -- Mateusz Guzik -- To unsubscribe from

[PATCH] ipc: fix compat msgrcv with negative msgtyp

2014-01-15 Thread Mateusz Guzik
Compat function takes msgtyp argument as u32 and passes it down to do_msgrcv which results in casting to long, thus the sign is lost and we get a big positive number instead. Cast the argument to signed type before passing it down. Signed-off-by: Mateusz Guzik mgu...@redhat.com Reported

Re: [PATCH] fs: clear close-on-exec flag as part of put_unused_fd()

2013-12-11 Thread Mateusz Guzik
- __clear_close_on_exec(fd, fdt); spin_unlock(files-file_lock); if (tofree) From my reading this will break at least the following: fd = open(..., .. | O_CLOEXEC); dup2(whatever, fd); now fd has O_CLOEXEC even though it should not -- Mateusz Guzik -- To unsubscribe from this list: send

Re: [PATCH] staging: line6: fix possible overrun

2014-04-27 Thread Mateusz Guzik
On Sun, Apr 27, 2014 at 08:39:32PM +0300, Dan Carpenter wrote: On Sat, Apr 26, 2014 at 11:59:46PM +0200, Mateusz Guzik wrote: And sadly enough some of those -id strings are more than 15 characters and a NUL which will fit in card-id. So this overflow is real. The card-shortname is a 32

Re: [PATCH] staging: line6: fix possible overrun

2014-04-29 Thread Mateusz Guzik
On Tue, Apr 29, 2014 at 04:47:11PM +0200, Takashi Iwai wrote: At Mon, 28 Apr 2014 01:44:25 +0300, Dan Carpenter wrote: On Sun, Apr 27, 2014 at 10:00:43PM +0200, Mateusz Guzik wrote: and a WARN_ON + -EINVAL in line6_init_audio to catch future offenders. Returning -EINVAL

Re: [PATCH 1/1] aio: change exit_aio() to load mm-ioctx_table once and avoid rcu_read_lock()

2014-04-29 Thread Mateusz Guzik
. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] aio: fix potential leak in aio_run_iocb().

2014-05-01 Thread Mateusz Guzik
so that it frees stuff on error, taking care of this case as well: https://lkml.org/lkml/2014/4/25/778 -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()

2014-05-01 Thread Mateusz Guzik
; if (pwps_ie_src == NULL) return; Maybe just check pwps_ie_src earlier? -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH 1/1] mm/zswap.c: add lock helper

2014-05-02 Thread Mateusz Guzik
On Fri, May 02, 2014 at 06:35:10PM +0200, Fabian Frederick wrote: tree-lock is used all over the place [..] + spinlock_t *lock = tree-lock; if (!tree) return; Rather fishy, although I'm unsure if this is a real problem. -- Mateusz Guzik -- To unsubscribe from

Re: [RFC][PATCH] vfs: add closefrom(2) syscall

2014-04-08 Thread Mateusz Guzik
? -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: Clarification needed on use of put_user inside a loop

2014-04-25 Thread Mateusz Guzik
consumers, it seems to be a bug to not include it. Thus I suggest adding access_ok variant which calls might_fault. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] drm: make variable named refcount atomic, like most refcounts in the kernel.

2014-04-26 Thread Mateusz Guzik
refcount manipulation primitives without atomicity guarantees, which could be used in cases like this. Then atomic and non-atomic versions could be used to detect overflows and overputs at least in debug kernels. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH] staging: line6: fix possible overrun

2014-04-26 Thread Mateusz Guzik
(or some other error) instead? Now you will possibly truncate the name. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH] staging: line6: fix possible overrun

2014-04-26 Thread Mateusz Guzik
On Sun, Apr 27, 2014 at 12:36:21AM +0300, Dan Carpenter wrote: On Sat, Apr 26, 2014 at 10:47:05PM +0200, Mateusz Guzik wrote: On Sat, Apr 26, 2014 at 07:09:22PM +0200, Laurent Navet wrote: The strcpy operation may write past the end of the fixed-size destination buffer if the source

Re: [PATCH] drm: make variable named refcount atomic, like most refcounts in the kernel.

2014-04-26 Thread Mateusz Guzik
, if this would be the only consumer (which will most likely never leak anyway) then this is defnitely not worth it. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH] net: ipv4: current group_info should be put after using.

2014-04-11 Thread Mateusz Guzik
; + goto out_release_group; } count -= cp_count; } - return -EACCES; + ret = -EACCES; + +out_release_group: + put_group_info(group_info); + return ret; } EXPORT_SYMBOL_GPL(ping_init_sock); -- Mateusz Guzik

Re: [PATCH] net: ipv4: current group_info should be put after using.

2014-04-11 Thread Mateusz Guzik
On Fri, Apr 11, 2014 at 10:35:33AM +0200, Mateusz Guzik wrote: On Fri, Apr 11, 2014 at 01:37:08PM -0400, Wang, Xiaoming wrote: There is a memory leak in ping. Current group_info had been got in ping_init_sock and group_info-usage increased. But the usage hasn't decreased anywhere in ping

Re: [PATCH] net: ipv4: current group_info should be put after using.

2014-04-11 Thread Mateusz Guzik
the reference to a place where it is actually needed. Please cc: me if you resend the patch. Thanks, -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [RFC PATCH] cmdline: Hide debug from /proc/cmdline

2014-04-02 Thread Mateusz Guzik
would be spawned with these arguments and would just go over its argv. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: lib/argv_split.c : should argv be kfree'ed ?

2014-06-28 Thread Mateusz Guzik
char *str, int *argcp) *argv++ = argv_str; } } + kfree (argv); *argv = NULL; if (argcp) No, see argv_free. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: lib/argv_split.c : should argv be kfree'ed ?

2014-06-29 Thread Mateusz Guzik
On Sun, Jun 29, 2014 at 04:40:17PM +0200, Toralf Förster wrote: On 06/29/2014 12:04 AM, Mateusz Guzik wrote: On Sat, Jun 28, 2014 at 11:52:37PM +0200, Toralf Förster wrote: /me wonders if this patch is needed here : diff --git a/lib/argv_split.c b/lib/argv_split.c index e927ed0

Re: [PATCH v2] hid-appleir: Fix kernel panic due to null pointer

2014-07-01 Thread Mateusz Guzik
anyway because: unsigned short keymap[ARRAY_SIZE(appleir_key_table)]; although one may argue is slightly nicer since it is used in memcpy line earlier. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v2 1/1] vfs: Respect MS_RDONLY at bind mount creation

2014-08-01 Thread Mateusz Guzik
not it be much better to pass down info about rdonly request to copy_tree/clone_mnt (perhaps CL_MOUNT_RDONLY flag or a separate flags argument) and handle it there? This would avoid fishy-looking traversal before graft_tree, which even if correct should not be necessary. -- Mateusz Guzik -- To unsubscribe

Re: [PATCH v3 1/1] vfs: Respect MS_RDONLY at bind mount creation

2014-08-02 Thread Mateusz Guzik
0x040 +#define CL_COPY_MNT_NS_FILE 0x080 +#define CL_MAKE_RDONLY 0x100 #define CL_COPY_ALL (CL_COPY_UNBINDABLE | CL_COPY_MNT_NS_FILE) -- 1.8.5.5 -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCH] scatterlist.h: Change CONFIG_DEBUG_SG for ifdef statement in sg_set_bf

2014-08-02 Thread Mateusz Guzik
, what hapened to that? What exactly were you trying to achieve? Did this BUG_ON detect a problem on your system and now you are trying to silence it? The change would be wrong even if it compiled since it would just execute the assertion only when debug is disabled. -- Mateusz Guzik

Re: [PATCH] scatterlist.h: Change CONFIG_DEBUG_SG for ifdef statement in sg_set_bf

2014-08-02 Thread Mateusz Guzik
On Sun, Aug 03, 2014 at 12:31:30AM -0400, Nick Krause wrote: On Sat, Aug 2, 2014 at 11:59 PM, Mateusz Guzik mgu...@redhat.com wrote: On Sat, Aug 02, 2014 at 10:56:13PM -0400, Nicholas Krause wrote: This changes the ifdef statement in sg_set_bg to !CONFIG_DEBUG_SG in order to avoid a bug

Re: [PATCH] scatterlist.h: Change CONFIG_DEBUG_SG for ifdef statement in sg_set_bf

2014-08-03 Thread Mateusz Guzik
not use wrappers - a simple shell supporting output redirection and pipes - pick your favourite utility from and implement your own version. can be echo, cat, rev, kill, strings; then you can move to maybe stat, du, ls, chmod I hope this helps, -- Mateusz Guzik -- To unsubscribe from this list

Re: [PATCH] xhci: Merge and Update debugging for patches from 3.6 kernel tree

2014-08-05 Thread Mateusz Guzik
recommend one last time you leave the kernel alone for the time being and focus on userspace. There. This is my last reply, have fun. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info

Re: /proc/pid/exe symlink behavior change in =3.15.

2014-09-07 Thread Mateusz Guzik
use container_of to get to the counter. I can implement that later if it sounds sane enough. Note this behaviour seems to be a requirement for cross-rename to work. At least restoring previous behaviour while keeping cross-rename is not hard, I can write it later. -- Mateusz Guzik

Re: /proc/pid/exe symlink behavior change in =3.15.

2014-09-11 Thread Mateusz Guzik
On Thu, Sep 11, 2014 at 06:39:58PM -0500, Chuck Ebbert wrote: On Sun, 7 Sep 2014 09:56:08 +0200 Mateusz Guzik mgu...@redhat.com wrote: On Sat, Sep 06, 2014 at 11:44:32PM +0200, Piotr Karbowski wrote: Hi, Starting with kernel 3.15 the 'exe' symlink under /proc/pid/ acts diffrent

Re: [PATCH] gpu: drm: drm_dp_mst_topology.c: Fix improper use of strncat.

2014-10-05 Thread Mateusz Guzik
(struct drm_dp_mst_branch *mstb, -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RESEND][PATCHv2 1/2] procfs: show hierarchy of pid namespace

2014-09-22 Thread Mateusz Guzik
))); + seq_printf(m, %s , pid_buf); + } + + seq_putc(m, '\n'); + } + + free_pidns_list(pidns_tree); + mutex_unlock(pidns_list_lock); + + return 0; +} + -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH] vfs: Don't exchange filenames unconditionally.

2014-09-18 Thread Mateusz Guzik
...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCHv3 1/2] procfs: show hierarchy of pid namespace

2014-09-24 Thread Mateusz Guzik
))); + seq_printf(m, %s , pid_buf); + } + + seq_putc(m, '\n'); + } + + free_pidns_list(pidns_tree); + mutex_unlock(pidns_list_lock); + + return 0; +} -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH 1/2v6] procfs: show hierarchy of pid namespace

2014-11-05 Thread Mateusz Guzik
= seq_lseek, + .release= single_release, +}; + +static int __init pidns_hierarchy_init(void) +{ + proc_create(NS_HIERARCHY, S_IWUGO, + NULL, proc_nspid_nslist_fops); + + return 0; +} +fs_initcall(pidns_hierarchy_init); -- 1.9.3 -- Mateusz Guzik

[PATCH 2/2] fs: avoid unnecessary prepare_creds in faccessat

2015-03-09 Thread Mateusz Guzik
Sometimes faccessat needs to modify current thread's credentials, but calls prepare_creds unconditionally. Take advantage of the fact that we can detect whether any modification to credentials is needed and in turn avoid unnecessary allocations. Signed-off-by: Mateusz Guzik mgu...@redhat.com

[PATCH 0/2] avoid prepare_creds in faccessat when possible

2015-03-09 Thread Mateusz Guzik
adds a helper which allows comparing capability sets and modifies faccessat to use it. Mateusz Guzik (2): CAPABILITIES: add cap_isequal helper fs: avoid unnecessary prepare_creds in faccessat fs/open.c | 53 ++ include/linux

[PATCH 1/2] CAPABILITIES: add cap_isequal helper

2015-03-09 Thread Mateusz Guzik
Can be used to determine whether two given sets have the same capabilities. Signed-off-by: Mateusz Guzik mgu...@redhat.com --- include/linux/capability.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/capability.h b/include/linux/capability.h index af9f0b9..2fcf941

Re: [PATCH 0/2] avoid prepare_creds in faccessat when possible

2015-03-13 Thread Mateusz Guzik
On Mon, Mar 09, 2015 at 09:35:45PM +0100, Mateusz Guzik wrote: Sometimes faccessat needs to modify current thread's credentials, but calls prepare_creds unconditionally. However, typically resulting credentials are identical to original ones and in that case newcredentials are unnecessary

Re: [PATCH 1/2] CAPABILITIES: add cap_isequal helper

2015-03-13 Thread Mateusz Guzik
On Fri, Mar 13, 2015 at 10:02:46AM -0400, Paul Moore wrote: On Monday, March 09, 2015 09:35:46 PM Mateusz Guzik wrote: Can be used to determine whether two given sets have the same capabilities. Signed-off-by: Mateusz Guzik mgu...@redhat.com --- include/linux/capability.h | 10

Re: [PATCH v3] fs: record task name which froze superblock

2015-03-01 Thread Mateusz Guzik
a rountrip of systemap scripts showing freezer process tree. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http

Re: [PATCH v3] fs: record task name which froze superblock

2015-03-01 Thread Mateusz Guzik
On Mon, Mar 02, 2015 at 05:38:29AM +0100, Mateusz Guzik wrote: On Sun, Mar 01, 2015 at 08:31:26AM +1100, Dave Chinner wrote: On Sat, Feb 28, 2015 at 05:25:57PM +0300, Alexey Dobriyan wrote: Freezing and thawing are separate system calls, task which is supposed to thaw filesystem

Re: [PATCH v4 1/1] vfs: Respect MS_RDONLY at bind mount creation

2015-02-25 Thread Mateusz Guzik
More majordomo info at http://vger.kernel.org/majordomo-info.html -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-20 Thread Mateusz Guzik
On Sat, Apr 18, 2015 at 12:41:38PM -0700, Eric Dumazet wrote: On Sat, 2015-04-18 at 00:02 +0100, Al Viro wrote: On Sat, Apr 18, 2015 at 12:16:48AM +0200, Mateusz Guzik wrote: I would say this makes the use of seq counter impossible. Even if we decided to fall back to a lock on retry

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-20 Thread Mateusz Guzik
On Mon, Apr 20, 2015 at 03:06:33PM +0200, Mateusz Guzik wrote: On Sat, Apr 18, 2015 at 12:02:52AM +0100, Al Viro wrote: On Sat, Apr 18, 2015 at 12:16:48AM +0200, Mateusz Guzik wrote: I would say this makes the use of seq counter impossible. Even if we decided to fall back to a lock

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-20 Thread Mateusz Guzik
On Sat, Apr 18, 2015 at 12:02:52AM +0100, Al Viro wrote: On Sat, Apr 18, 2015 at 12:16:48AM +0200, Mateusz Guzik wrote: I would say this makes the use of seq counter impossible. Even if we decided to fall back to a lock on retry, we cannot know what to do if the slot is reserved - it very

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-20 Thread Mateusz Guzik
On Mon, Apr 20, 2015 at 03:43:26PM +0200, Mateusz Guzik wrote: On Mon, Apr 20, 2015 at 03:06:33PM +0200, Mateusz Guzik wrote: On Sat, Apr 18, 2015 at 12:02:52AM +0100, Al Viro wrote: On Sat, Apr 18, 2015 at 12:16:48AM +0200, Mateusz Guzik wrote: I would say this makes the use of seq

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-22 Thread Mateusz Guzik
On Tue, Apr 21, 2015 at 02:06:53PM -0700, Eric Dumazet wrote: On Tue, 2015-04-21 at 22:12 +0200, Mateusz Guzik wrote: in dup_fd: for (i = open_files; i != 0; i--) { struct file *f = *old_fds++; if (f) { get_file(f

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-21 Thread Mateusz Guzik
On Tue, Apr 21, 2015 at 11:05:43AM -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 13:49 -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 10:15 -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 17:10 +0200, Mateusz Guzik wrote: Sorry for spam but I came up with another hack

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-21 Thread Mateusz Guzik
On Tue, Apr 21, 2015 at 10:06:24PM +0200, Mateusz Guzik wrote: On Tue, Apr 21, 2015 at 11:05:43AM -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 13:49 -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 10:15 -0700, Eric Dumazet wrote: On Mon, 2015-04-20 at 17:10 +0200, Mateusz Guzik

Re: [PATCH 2/2] Fix variable error missing initialization

2015-04-29 Thread Mateusz Guzik
the chance to set error. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] fs/file.c: don't acquire files-file_lock in fd_install()

2015-04-27 Thread Mateusz Guzik
On Tue, Apr 21, 2015 at 09:59:28PM -0700, Eric Dumazet wrote: From: Eric Dumazet eduma...@google.com Mateusz Guzik reported : Currently obtaining a new file descriptor results in locking fdtable twice - once in order to reserve a slot and second time to fill it. Holding the spinlock

[RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-16 Thread Mateusz Guzik
updated the right table. Signed-off-by: Mateusz Guzik mgu...@redhat.com --- fs/file.c | 24 +++- include/linux/fdtable.h | 5 + 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/fs/file.c b/fs/file.c index 93c5f89..bd1ef4c 100644 --- a/fs

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-16 Thread Mateusz Guzik
On Thu, Apr 16, 2015 at 01:55:39PM -0700, Eric Dumazet wrote: On Thu, 2015-04-16 at 13:42 -0700, Eric Dumazet wrote: On Thu, 2015-04-16 at 19:09 +0100, Al Viro wrote: On Thu, Apr 16, 2015 at 02:16:31PM +0200, Mateusz Guzik wrote: @@ -165,8 +165,10 @@ static int expand_fdtable(struct

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-16 Thread Mateusz Guzik
On Thu, Apr 16, 2015 at 07:09:32PM +0100, Al Viro wrote: On Thu, Apr 16, 2015 at 02:16:31PM +0200, Mateusz Guzik wrote: @@ -165,8 +165,10 @@ static int expand_fdtable(struct files_struct *files, int nr) cur_fdt = files_fdtable(files); if (nr = cur_fdt-max_fds

[PATCH] fs/file.c: remove useless xchg and NULL check in close_files

2015-04-14 Thread Mateusz Guzik
Since the table is about to be freed, there is no reason to set file pointer to NULL on closing. At this point open_fd map is supposed to indicate whether a file is installed, so NULL-checking it is unnecessary. Signed-off-by: Mateusz Guzik mgu...@redhat.com --- fs/file.c | 7 ++- 1 file

Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install

2015-04-17 Thread Mateusz Guzik
On Fri, Apr 17, 2015 at 02:46:56PM -0700, Eric Dumazet wrote: On Thu, 2015-04-16 at 14:16 +0200, Mateusz Guzik wrote: Hi, Currently obtaining a new file descriptor results in locking fdtable twice - once in order to reserve a slot and second time to fill it ... void

Re: [RFC PATCH RESEND] vfs: Move security_inode_killpriv() after permission checks

2015-04-08 Thread Mateusz Guzik
is the first rule of tautology club. -- Mateusz Guzik -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFC PATCH RESEND] vfs: Move security_inode_killpriv() after permission checks

2015-06-03 Thread Mateusz Guzik
On Mon, Apr 13, 2015 at 11:39:01AM +1000, James Morris wrote: On Wed, 8 Apr 2015, Mateusz Guzik wrote: This is still a problem. Any feedback about the patch? I'd like to see feedback from vfs folk (Al). Ping? Are there any concerns with the patch? -- Mateusz Guzik -- To unsubscribe

Re: Anonymous inode cleanup?

2015-11-12 Thread Mateusz Guzik
his case without serious tinkering. In fact this code cannot realiably work without weird locking. By the time anon_inode_getfd returns, the file could have been closed by a different thread. What you want instead is anon_inode_getfile. See perf_event_open for an example how to use it. -- Mateusz Guzi

[PATCH] fs/file.c: tidy up close_files

2015-10-08 Thread Mateusz Guzik
is populated. Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- fs/file.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/fs/file.c b/fs/file.c index 6c672ad..103d931 100644 --- a/fs/file.c +++ b/fs/file.c @@ -365,7 +365,7

Re: [RESEND PATCH] vfs: show_vfsstat: do not ignore errors from show_devname method

2015-11-18 Thread Mateusz Guzik
} > > /* mount point */ > seq_puts(m, " mounted on "); > /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ > err = seq_path_root(m, _path, >root, " \t\n\\"); > if (err) > goto out; >

Re: [PATCH 1/2] prctl: take mmap sem for writing to protect against others

2016-01-06 Thread Mateusz Guzik
On Wed, Jan 06, 2016 at 03:05:09PM +0530, Anshuman Khandual wrote: > On Wed, Jan 6, 2016 at 10:32 AM, Mateusz Guzik <mgu...@redhat.com> wrote: > > The code was taking the semaphore for reading, which does not protect > > against readers nor concurrent modifications. >

[PATCH] poll: plug an unused argument to do_poll

2016-01-05 Thread Mateusz Guzik
Number of fds is already known based on passed list. No functional changes. Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- fs/select.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/select.c b/fs/select.c index 0155473..79d0d49 100644 --- a/fs/select.c

[PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap semaphore taken.

2016-01-05 Thread Mateusz Guzik
Only functions doing more than one read are modified. Consumeres happened to deal with possibly changing data, but it does not seem like a good thing to rely on. Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- fs/proc/base.c | 13 ++--- mm/util.c | 16 2

[PATCH 0/2] fix up {arg,env}_{start,end} vs prctl

2016-01-05 Thread Mateusz Guzik
from similar treatment and are left untouched. Mateusz Guzik (2): prctl: take mmap sem for writing to protect against others proc read mm's {arg,env}_{start,end} with mmap semaphore taken. fs/proc/base.c | 13 ++--- kernel/sys.c | 20 ++-- mm/util.c | 16 +++

[PATCH 1/2] prctl: take mmap sem for writing to protect against others

2016-01-05 Thread Mateusz Guzik
, but they seem to be fine despite possible modificaton. Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- kernel/sys.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 6af9212..78947de 100644 --- a/kernel/sys.c +++ b/kernel

[PATCH] tty: plug a use-after-free in TIOCGETD ioctl

2016-01-07 Thread Mateusz Guzik
-by: Milos Vyletel <mi...@redhat.com> Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- drivers/tty/tty_io.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 892c923..1b10469 100644 --- a

Re: [PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap semaphore taken.

2016-01-06 Thread Mateusz Guzik
On Wed, Jan 06, 2016 at 03:14:22PM +0530, Anshuman Khandual wrote: > On Wed, Jan 6, 2016 at 10:32 AM, Mateusz Guzik <mgu...@redhat.com> wrote: > > Only functions doing more than one read are modified. Consumeres > > happened to deal with possibly changing data, but it does not

[PATCH] coredump: fix dumping through pipes

2016-06-05 Thread Mateusz Guzik
tore explicit tracking of the offset in coredump_params. Introduce ->pos field for this purpose since ->written was already reused. Reported-by: Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl> Signed-off-by: Mateusz Guzik <mgu...@redhat.com> --- arch/powerpc/platforms/cell/

  1   2   3   4   >