Re: [PATCH] Fix sync. in blkdev_write_iter() acessing i_flags

2018-12-07 Thread Al Viro
On Fri, Dec 07, 2018 at 08:49:16PM +0100, Alexander Lochmann wrote: > > _What_ SUID bit? We are talking about a write to block device, for fsck > > sake... > > > That's the way I understood Jan's explanation: > " > Thinking more about this I'm not sure if this is actually the right > solution.

Re: [PATCH] Fix sync. in blkdev_write_iter() acessing i_flags

2018-12-07 Thread Al Viro
On Fri, Dec 07, 2018 at 05:10:15PM +0100, Alexander Lochmann wrote: > > inode.i_flags might be altered without proper > synchronisation when the inode belongs to devtmpfs. > blkdev_write_iter() starts writing via __generic_file_write_iter() > which sets S_NOSEC bit without any synchronisation. >

Re: [PATCH v2] binder: fix use-after-free due to fdget() optimization

2018-12-05 Thread Al Viro
On Wed, Dec 05, 2018 at 04:21:55PM -0800, Todd Kjos wrote: > > How about grabbing the references to all victims (*before* screwing with > > ksys_close()), sticking them into a structure with embedded callback_head > > and using task_work_add() on it, the callback doing those fput()? > > > > The

Re: [PATCH v2] binder: fix use-after-free due to fdget() optimization

2018-12-05 Thread Al Viro
On Wed, Dec 05, 2018 at 01:16:01PM -0800, Todd Kjos wrote: > 44d8047f1d87a ("binder: use standard functions to allocate fds") > exposed a pre-existing issue in the binder driver. > > fdget() is used in ksys_ioctl() as a performance optimization. > One of the rules associated with fdget() is that

Re: linux-next: manual merge of the selinux tree with the vfs tree

2018-12-05 Thread Al Viro
On Wed, Dec 05, 2018 at 10:37:56AM +0100, Ondrej Mosnacek wrote: > I just tested the Q28 branch rebased onto a recent Fedora rawhide > kernel (4.20.0-0.rc5.git0.1) and that code seems to be working fine. > The submount test failed with Q28 and succeeds with Q28+fix, as > expected. Also, the

Re: linux-next: manual merge of the selinux tree with the vfs tree

2018-12-03 Thread Al Viro
On Mon, Dec 03, 2018 at 11:12:59AM +0100, Ondrej Mosnacek wrote: > I think I figured out what's the problem. NFS still creates the > submount via the old vfs_submount() call, which calls > vfs_kern_mount(), which creates an fs_context with > FS_CONTEXT_FOR_USER_MOUNT because

Re: [PATCH RFC 01/15] MIPS: replace **** with a hug

2018-11-30 Thread Al Viro
On Fri, Nov 30, 2018 at 11:27:10AM -0800, Jarkko Sakkinen wrote: > In order to comply with the CoC, replace with a hug. OK, that's it - from now on I'm switching to use of CoC as a general-purpose obscene verb. As in "this protocol is completely CoCed in head", etc.

Re: dcache_readdir NULL inode oops

2018-11-30 Thread Al Viro
On Fri, Nov 30, 2018 at 09:16:49AM -0600, Eric W. Biederman wrote: > >> > + inode_lock(parent->d_inode); > >> > dentry->d_fsdata = NULL; > >> > drop_nlink(dentry->d_inode); > >> > d_delete(dentry); > >> > + inode_unlock(parent->d_inode); > >> > + > >> >

[git pull] vfs.git fixes

2018-11-29 Thread Al Viro
) Al Viro (1): iov_iter: teach csum_and_copy_to_iter() to handle pipe-backed ones David Howells (3): afs: Fix validation/callback interaction afs: Fix missing net error handling afs: Use d_instantiate() rather than d_add() and don't d_drop() Jens Axboe (1): aio: fix

Re: linux-next: manual merge of the selinux tree with the vfs tree

2018-11-29 Thread Al Viro
On Fri, Nov 30, 2018 at 01:27:07AM +, Al Viro wrote: > And then there's sb_mount, with 3 instances and arseloads of > races in 2 out of 3. PS: the 3rd one (in selinux) is, AFAICS, TOCTOU-free, because it ignores everything except the mountpoint, which is already looked up by the

Re: linux-next: manual merge of the selinux tree with the vfs tree

2018-11-29 Thread Al Viro
On Thu, Nov 29, 2018 at 04:57:20PM -0800, Casey Schaufler wrote: > > Question: what *should* happen if we try to cross into a submount and find > > that the thing on the other side is already mounted elsewhere, with > > incompatible > > LSM options? Ditto for referrals, with an extra twist -

Re: [PATCH - resend*2] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2018-11-29 Thread Al Viro
em > impact of using synchronize_rcu_expedited(). > > Acked-by: Paul E. McKenney (from general rcu > perspective) > Signed-off-by: NeilBrown > --- > > Al Viro says "I can live with this one" but this still hasn't landed. > Maybe someone else could apply it? Applied (in work.misc, once I push it out)

Re: linux-next: manual merge of the selinux tree with the vfs tree

2018-11-29 Thread Al Viro
On Thu, Nov 29, 2018 at 05:23:24PM -0500, Paul Moore wrote: > > OK, I will verify that the SELinux submount fix rebased on top of > > vfs/work.mount in the way I suggested above passes the same testing > > (seliinux-testsuite + NFS crossmnt reproducer). I am now building two > > kernels

Re: oops when ext4 fs is full

2018-11-28 Thread Al Viro
On Wed, Nov 28, 2018 at 08:50:39AM +, Willy Wolff wrote: > Hi, > I got a Oops when the hard drive was COMPLETELY full using a ext4 fs. > After it, any command on the directory where the last write should have > occurred freezes, while any other directory behave just fine. > > If this email

Re: [PATCH] namei: free new_dentry late

2018-11-24 Thread Al Viro
On Sat, Nov 24, 2018 at 05:23:24PM +0800, Pan Bian wrote: > After calling dput(new_dentry), new_dentry is passed to fsnotify_move. > This may result in a use-after-free bug. This patch moves the put > operation late. > > Fixes: 49d31c2f389a("dentry name snapshots") What does that commit have to

Re: [PATCH V2] exportfs: do not read dentry after free

2018-11-23 Thread Al Viro
On Fri, Nov 23, 2018 at 03:56:33PM +0800, Pan Bian wrote: > The function dentry_connected calls dput(dentry) to drop the previously > acquired reference to dentry. In this case, dentry can be released. > After that, IS_ROOT(dentry) checks the condition > (dentry == dentry->d_parent), which may

Re: [PATCH -next] exportfs: fix 'passing zero to ERR_PTR()' warning

2018-11-18 Thread Al Viro
On Mon, Nov 19, 2018 at 11:32:41AM +0800, YueHaibing wrote: > Fix a static code checker warning: > fs/exportfs/expfs.c:171 reconnect_one() warn: passing zero to 'ERR_PTR' > > The error path for lookup_one_len_unlocked failure > should set err to PTR_ERR. > > Fixes: bbf7a8a3562f ("exportfs:

Re: [PATCH] proc: allow killing processes via file descriptors

2018-11-18 Thread Al Viro
On Sun, Nov 18, 2018 at 09:42:35AM -0800, Andy Lutomirski wrote: > Now here's the kicker: if the "running program" calls execve(), it > goes away. The fd gets some sort of notification that this happened Type error, parser failed. Define "fd", please. If it's a "file descriptor", thank you do

Re: [git pull] mount API series

2018-11-12 Thread Al Viro
On Sun, Nov 11, 2018 at 08:07:20PM -0600, Eric W. Biederman wrote: > Steven Whitehouse writes: > > Can you share some details of what this NULL dereference is? David and > > Al have been working on the changes as requested by Linus later in > > this thread, and they'd like to tidy up this issue

Re: [PATCH -next] sysv: return 'err' instead of 0 in __sysv_write_inode

2018-11-10 Thread Al Viro
On Sat, Nov 10, 2018 at 04:13:24AM +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > fs/sysv/inode.c: In function '__sysv_write_inode': > fs/sysv/inode.c:239:6: warning: > variable 'err' set but not used [-Wunused-but-set-variable] > > __sysv_write_inode should

Re: [PATCH] net/9p: Fix iov_iter usage

2018-11-03 Thread Al Viro
On Sat, Nov 03, 2018 at 08:04:28PM -0700, Andy Lutomirski wrote: > Trying to use 9pfs causes QEMU to complain: commit 2cbfdf4df58330f6cb493500387427dae1c5551d Author: Marc Zyngier Date: Fri Nov 2 17:16:51 2018 + iov_iter: Fix 9p virtio breakage

[git pull] followup fix to work.afs

2018-11-02 Thread Al Viro
Regression fix for net/9p handling of iov_iter; broken by braino when switching to iov_iter_is_kvec() et.al., spotted and fixed by Marc. The following changes since commit 0e9b4a82710220c04100892fb7277b78fd33a747: missing bits of "iov_iter: Separate type from direction and use accessor

Re: [git pull] mount API series

2018-11-02 Thread Al Viro
On Fri, Nov 02, 2018 at 04:07:01AM +, Al Viro wrote: > On Thu, Nov 01, 2018 at 11:59:23PM +, David Howells wrote: > > > (*) mount-api-core. These are the internal-only patches that add the > > fs_context, the legacy wrapper and the security hook

Re: [PATCH] iov_iter: Fix 9p virtio breakage

2018-11-02 Thread Al Viro
oring the missing "!" brings the guest back to life. > > Fixes: 00e23707442a ("iov_iter: Use accessor function") > Reported-by: Will Deacon > Signed-off-by: Marc Zyngier ACK. Do you want me to take it via vfs.git? Or might as well send directly to Linus, with Acked-by Al Viro on it.

Re: [git pull] mount API series

2018-11-01 Thread Al Viro
On Thu, Nov 01, 2018 at 11:59:23PM +, David Howells wrote: > (*) mount-api-core. These are the internal-only patches that add the > fs_context, the legacy wrapper and the security hooks and make certain > filesystems make use of it. FWIW, while rereading that series I'd spotted

Re: [PATCH] Make JFFS2 endianness configurable

2018-11-01 Thread Al Viro
On Thu, Nov 01, 2018 at 05:02:36PM -0700, Daniel Walker wrote: > > > > On Thu, Nov 01, 2018 at 03:56:03PM -0700, Nikunj Kela wrote: > > This patch allows the endianness of the JFSS2 filesystem to be > > specified by config options. > > > > It defaults to native-endian (the previously

[git pull] work.afs

2018-11-01 Thread Al Viro
to 0e9b4a82710220c04100892fb7277b78fd33a747: missing bits of "iov_iter: Separate type from direction and use accessor functions" (2018-11-01 18:19:03 -0400) -------- Al Viro (2): Merge tag 'nfs-for-4.20-1' of git://git.linux-nfs.or

Re: [git pull] mount API series

2018-11-01 Thread Al Viro
On Thu, Nov 01, 2018 at 11:33:31AM -0700, Linus Torvalds wrote: > Al - can I ask you to look at helping David with something like that? > You tend to be very good at generating those patch-series with > "obviously no changes" for the individual patches, but the end result > ends up being totally

Re: [git pull] mount API series

2018-11-01 Thread Al Viro
On Wed, Oct 31, 2018 at 04:36:01PM +, Al Viro wrote: > On Wed, Oct 31, 2018 at 10:38:17AM -0500, Eric W. Biederman wrote: > > A couple of bugs that I can see quickly. Several of which I have > > previously reported: > > > > - There is an easily triggered NULL point

Re: [git pull] mount API series

2018-10-31 Thread Al Viro
On Wed, Oct 31, 2018 at 10:38:17AM -0500, Eric W. Biederman wrote: > A couple of bugs that I can see quickly. Several of which I have > previously reported: > > - There is an easily triggered NULL pointer deference with open_tree > and mount propagation. What the hell? If the fixes that went

[git pull] mount API series

2018-10-30 Thread Al Viro
another go at having a superblock creation whilst getting rid of the one that says it's already mounted. = The following changes since commit 11da3a7f84f19c26da6f86af878298694ede0804: Linux 4.19-rc3 (2018-0

Re: [PATCH v2 01/17] compat_ioctl: add generic_compat_ioctl_ptrarg()

2018-10-28 Thread Al Viro
On Thu, Sep 13, 2018 at 12:29:02PM +0200, Arnd Bergmann wrote: > I was hoping that the _ptrarg suffix gives enough warning here, > but maybe not. I was careful to only use it in cases that I > checked are safe, either using only pointer arguments, or > no arguments. > > What we might do for

Re: [Ksummit-discuss] The linux devs can rescind their license grant.

2018-10-27 Thread Al Viro
On Sat, Oct 27, 2018 at 03:46:02PM -0700, Bruce Perens wrote: > The anonymous person is generally thought to have appeared on the net > previously as MikeeUSA. That entity has a well-recorded history of misogyny > and other anti-social behaviour. You are misreading it - behaviour of that...

Re: [PATCH v2 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-27 Thread Al Viro
On Sat, Oct 27, 2018 at 06:17:29PM +1100, Aleksa Sarai wrote: > I'm going to send out a v4 "soon" but I would like to know what folks > think about having resolveat(2) (or similar) to separate the scoping O_* > flags and produce an O_PATH -- since unsupported O_* flags are ignored > by older

Re: The linux devs can rescind their license grant.

2018-10-27 Thread Al Viro
On Sat, Oct 27, 2018 at 06:52:44AM +, visionsofal...@redchan.it wrote: > Al: the FSF was so insistent on the adoption of the GPL version 3 > because the GPL version 2 is not operative against the grantor. Anonymous wankstain: sod off and learn to troll properly. It *is* an art form, and the

Re: The linux devs can rescind their license grant.

2018-10-25 Thread Al Viro
On Thu, Oct 25, 2018 at 10:28:36PM -0400, Eric S. Raymond wrote: > Al Viro : > > * in case it needs to be spelled out: I am not at all interested > > in that kind of stunts. One of the reasons I thoroughly despise RMS > > and his bunch is the leverage game they tri

Re: The linux devs can rescind their license grant.

2018-10-25 Thread Al Viro
On Thu, Oct 25, 2018 at 05:41:23PM -0400, Eric S. Raymond wrote: > I do not have any facts with which to dispute this specific claim. > However, I do notice that a significant number of long-time > contributors have put themselves in the anti-CoC camp. I note Al Viro > as a re

[git pull] more ->lookup() cleanups

2018-10-24 Thread Al Viro
ias() calling conventions for ->lookup() users. (2018-10-10 16:52:37 -0400) -------- Al Viro (3): clean erofs_lookup() simplify btrfs_lookup() Document d_splice_alias() calling conventions for ->lookup() users. Docu

[git pull] compat_ioctl fixes

2018-10-24 Thread Al Viro
repository at: git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.compat for you to fetch changes up to 702ec3072ae61cdf018725b353ff043e196548a6: hidp: fix compat_ioctl (2018-09-10 12:41:07 -0400) Al Viro (5

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Al Viro
On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote: > +static inline unsigned char fs_dtype(int filetype) That "int" is asking for trouble, especially since negative argument will blow up. And it comes from untrusted source... > +{ > + if (filetype >= FT_MAX) > +

Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]

2018-10-23 Thread Al Viro
On Tue, Oct 23, 2018 at 12:19:35PM +0100, Alan Jenkins wrote: > I think there's another small hole. It is possible to move a sub-mount from > a detached tree (instead of moving the root of the tree). Then > do_move_mount() calls attach_recursive_mnt() with a non-NULL parent_path. > > This

Re: [Ksummit-discuss] Call to Action Re: [PATCH 0/7] Code of Conduct: Fix some wording, and add an interpretation document

2018-10-23 Thread Al Viro
On Tue, Oct 23, 2018 at 09:26:52AM +0300, Dan Carpenter wrote: > Ten years back there was a patch rejected because "F*** you, what do > women know about programming?" I can't imagine it happening now, but I > was so shocked by it at the time also... URL? I would really, honestly, no kidding,

Re: [Ksummit-discuss] Call to Action Re: [PATCH 0/7] Code of Conduct: Fix some wording, and add an interpretation document

2018-10-23 Thread Al Viro
On Tue, Oct 23, 2018 at 04:28:03PM +1100, NeilBrown wrote: > > If that's a clarification, I'm sorry to say that I understand you even less > > now. > > What are you proposing? Duopoly? How do you deal with disagreements? > > Fork? > > Revert wars? > > We already have team-maintainership

Re: [Ksummit-discuss] Call to Action Re: [PATCH 0/7] Code of Conduct: Fix some wording, and add an interpretation document

2018-10-22 Thread Al Viro
On Tue, Oct 23, 2018 at 03:25:08PM +1100, NeilBrown wrote: > >> If Linus is not true to his new-found sensitivity, we might need someone > >> (Greg?) to be a co-maintainer, able to accept patches when Linus has a > >> relapse. It might be good form to create this channel anyway, but I > >> doubt

Re: Reiser4 Linux 4.17.19-1 hangs in Google cloud VM, too.

2018-10-22 Thread Al Viro
On Mon, Oct 22, 2018 at 09:04:18PM -0700, Vito Caputo wrote: > > reiser4 has never been in-tree to start with. And name is completely > > irrelevant - > > all I'm refering to is that I have not seen any postings on l-k/fsdevel/etc. > > from anybody working on that particular out-of-tree

[git pull] tty ioctl cleanups and fixes

2018-10-22 Thread Al Viro
) Al Viro (53): presence of RS485 ioctls has been unconditional since 2014 move compat handling of tty ioctls to tty_compat_ioctl() tty_ioctl(): drop FIONBIO handling mos7720: bury dead TIOCM... in ->ioctl() tty_ioctl(): start taking TIOC[SG]SER

Re: Reiser4 Linux 4.17.19-1 hangs in Google cloud VM, too.

2018-10-22 Thread Al Viro
On Mon, Oct 22, 2018 at 08:47:19PM -0700, Vito Caputo wrote: > On Tue, Oct 23, 2018 at 04:38:52AM +0100, Al Viro wrote: > > On Mon, Oct 22, 2018 at 03:19:12AM -0700, Metztli Information Technology > > wrote: > > > I installed reiser4 -enhanced Linux kernel 4.

Re: Reiser4 Linux 4.17.19-1 hangs in Google cloud VM, too.

2018-10-22 Thread Al Viro
On Mon, Oct 22, 2018 at 03:19:12AM -0700, Metztli Information Technology wrote: > I installed reiser4 -enhanced Linux kernel 4.17.19-1 --thus replacing the > prior hung reiser4 -patched kernel 4.18.15-1 in the Google Compute Engine > (GCE) cloud instance. After less than 24 hours the 4.17.19-1

Re: [Ksummit-discuss] Call to Action Re: [PATCH 0/7] Code of Conduct: Fix some wording, and add an interpretation document

2018-10-22 Thread Al Viro
On Tue, Oct 23, 2018 at 07:26:06AM +1100, NeilBrown wrote: > Currently if a maintainer is rude to you, there is no where else that > you can go and *that* is why it hurts. It isn't the abuse so much as > the powerlessness associated with it. If you can (metaphorically) say > to that maintainer

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-20 Thread Al Viro
On Sat, Oct 20, 2018 at 03:26:37PM -0700, Matthew Wilcox wrote: > On Sat, Oct 20, 2018 at 11:09:57PM +0100, Phillip Potter wrote: > > Remove switch statement from ufs_set_de_type function in fs/ufs/util.h > > header and replace with simple assignment. For each case, S_IFx >> 12 > > is equal to

Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]

2018-10-20 Thread Al Viro
On Sat, Oct 20, 2018 at 12:48:26PM +0100, Al Viro wrote: > Not just refcounting; it's that fs_pin is really intended to have ->kill() > triggered only once. If you look at the pin_kill() (which is where the > livelock happened) More specifically, it's group_pin_kill() assuming that

Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]

2018-10-20 Thread Al Viro
On Sat, Oct 20, 2018 at 12:06:32PM +0100, Alan Jenkins wrote: > You posted an analysis of a GPF, where you showed the reference count was > clearly one less than it should have been.  You narrowed this down to a step > where you connected an unmounted mount (MNT_UMOUNT) to a mounted mount.  So >

Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]

2018-10-19 Thread Al Viro
On Fri, Oct 19, 2018 at 11:36:19PM +0100, David Howells wrote: > Alan Jenkins wrote: > > > # open_tree_clone 3 > # cd /proc/self/fd/3 > > # mount --move . /mnt > > [ 41.747831] mnt_flags=1020 umount=0 > > # cd / > > # umount /mnt > > umount: /mnt: target is busy > > > > ^ a newly introduced

Re: [PATCH 03/24] iov_iter: Add I/O discard iterator

2018-10-19 Thread Al Viro
On Sat, Oct 20, 2018 at 02:10:59AM +0100, David Howells wrote: > @@ -1060,6 +1074,9 @@ void iov_iter_revert(struct iov_iter *i, size_t unroll) > } > unroll -= i->iov_offset; > switch (iov_iter_type(i)) { > + case ITER_DISCARD: > + i->iov_offset = 0; > +

Re: [PATCH 02/24] iov_iter: Renumber the ITER_* constants in uio.h

2018-10-19 Thread Al Viro
On Sat, Oct 20, 2018 at 02:10:52AM +0100, David Howells wrote: > Renumber the ITER_* constants in uio.h to be contiguous to make comparing > them more efficient in a switch-statement. Are you sure that they *are* more efficient that way? Some of those paths are fairly hot, so much that I would

Re: [PATCH 01/24] iov_iter: Separate type from direction and use accessor functions

2018-10-19 Thread Al Viro
On Sat, Oct 20, 2018 at 02:10:44AM +0100, David Howells wrote: One general comment: I would strongly recommend splitting the iov_iter initializers change into a separate patch. > index 8d41ca7bfcf1..dcdbcb6f09f8 100644 > --- a/fs/cifs/file.c > +++ b/fs/cifs/file.c > @@ -2990,7 +2990,7 @@

Re: Question about mmap syscall and POSIX standard on mips arch

2018-10-17 Thread Al Viro
[mips folks Cc'd] On Thu, Oct 18, 2018 at 11:26:02AM +0800, Hongzhi, Song wrote: > Hi all, > > Ltp has a POSIX teatcase about mmap, 24-2.c. > >

Re: in_compat_syscall() returns from kernel thread for X86_32.

2018-10-17 Thread Al Viro
On Wed, Oct 17, 2018 at 07:37:42PM -0700, Andy Lutomirski wrote: > I could get on board with: > > ({WARN_ON_ONCE(current->flags & PF_KTHREAD); true}) > > The point of these accessors is to be used *in a syscall*. > > What on Earth is Lustre doing that makes it have this problem? Plays

Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function

2018-10-17 Thread Al Viro
On Wed, Oct 17, 2018 at 10:11:47AM +, David Laight wrote: > From: Phillip Potter > > Sent: 17 October 2018 11:08 > > > > Remove switch statement from ufs_set_de_type function in fs/ufs/util.h > > header and replace with simple assignment. For each case, S_IFx >> 12 > > is equal to DT_x, so in

Re: [PATCH] hfs: fix array out of bounds read of array extent

2018-10-17 Thread Al Viro
On Wed, Oct 17, 2018 at 03:01:17PM -0700, Andrew Morton wrote: > On Fri, 31 Aug 2018 15:05:38 +0100 Colin King > wrote: > > > From: Colin Ian King > > > > Currently extent and index i are both being incremented causing > > an array out of bounds read on extent[i]. Fix this by removing > > the

Re: [PATCH v3 2/2] sysctl: handle overflow for file-max

2018-10-16 Thread Al Viro
On Wed, Oct 17, 2018 at 12:33:22AM +0200, Christian Brauner wrote: > Currently, when writing > > echo 18446744073709551616 > /proc/sys/fs/file-max > > /proc/sys/fs/file-max will overflow and be set to 0. That quickly > crashes the system. > This commit sets the max and min value for file-max and

Re: [PATCH RFC] err.h: document that PTR_ERR should only be used if IS_ERR returns true

2018-10-16 Thread Al Viro
On Mon, Oct 15, 2018 at 11:37:08AM +0200, Alessandro Rubini wrote: > OTOH I admit you can compare any value with -EINVAL, after PTR_ERR. > But in general you first detect the error condition and then split > among error (or print a message according to the exact value. if (IS_ERR(p) &&

Re: [PATCH 1/2] sysctl: add overflow detection to proc_get_long()

2018-10-14 Thread Al Viro
On Sun, Oct 14, 2018 at 08:53:46PM +0200, Christian Brauner wrote: > > Yecchh... First of all, the cast back to unsigned long long is completely > > pointless. What's more, > > Sorry, seriously asking: why? This was meant to handle the case where > sizeof(unsigned long long) != sizeof(unsigned

Re: [PATCH 1/2] sysctl: add overflow detection to proc_get_long()

2018-10-14 Thread Al Viro
On Sun, Oct 14, 2018 at 03:25:09PM +0200, Christian Brauner wrote: > +static unsigned long sysctl_strtoul_lenient(const char *cp, char **endp, > + unsigned int base, bool *overflow) > +{ > + unsigned long long result; > + unsigned int rv; > + > +

Re: [PATCH v3 3/3] namei: aggressively check for nd->root escape on ".." resolution

2018-10-13 Thread Al Viro
On Sat, Oct 13, 2018 at 07:53:26PM +1100, Aleksa Sarai wrote: > I didn't know about path_is_under() -- I just checked and it appears to > not take _lock? From my understanding, in order to protect > against the rename attack you need to take _lock (or check > against _lock at least and retry if

Re: [PATCH v3 3/3] namei: aggressively check for nd->root escape on ".." resolution

2018-10-13 Thread Al Viro
On Wed, Oct 10, 2018 at 02:37:28AM +1100, Aleksa Sarai wrote: > > > +static inline int nd_alloc_dpathbuf(struct nameidata *nd) > > > +{ > > > + if (unlikely(!nd->dpathbuf)) { > > > + if (nd->flags & LOOKUP_RCU) { > > > + nd->dpathbuf = kmalloc(PATH_MAX,

Re: [PATCH v3 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-13 Thread Al Viro
On Sat, Oct 13, 2018 at 08:33:19AM +0100, Al Viro wrote: > Pardon me, but... huh? The reason for your two calls of dirfd_path_init() is, > AFAICS, the combination of absolute pathname with both LOOKUP_XDEV and > LOOKUP_BENEATH at the same time. That combination is treated as if the &

Re: [PATCH v3 1/3] namei: implement O_BENEATH-style AT_* flags

2018-10-13 Thread Al Viro
On Tue, Oct 09, 2018 at 06:02:28PM +1100, Aleksa Sarai wrote: First of all, dirfd_path_init() part should be in a separate commit. And I'm really not happy with the logics in there. dirfd_path_init() itself is kinda-sorta reasonable. It is equivalent to setting the starting point for relative

Re: [PATCH 31/34] vfs: syscall: Add fspick() to select a superblock for reconfiguration [ver #12]

2018-10-13 Thread Al Viro
On Fri, Oct 12, 2018 at 03:49:50PM +0100, Alan Jenkins wrote: > > +SYSCALL_DEFINE3(fspick, int, dfd, const char __user *, path, unsigned int, > > flags) > > +{ > > + struct fs_context *fc; > > + struct path target; > > + unsigned int lookup_flags; > > + int ret; > > + > > + if

Re: [PATCH 03/34] teach move_mount(2) to work with OPEN_TREE_CLONE [ver #12]

2018-10-13 Thread Al Viro
On Thu, Oct 11, 2018 at 09:17:54PM +0100, David Howells wrote: > +/* > + * Object if there are any nsfs mounts in the specified subtree. These can > act > + * as pins for mount namespaces that aren't checked by the mount-cycle > checking > + * code, thereby allowing cycles to be made. > + */ >

Re: [PATCH 09/50] amiserial: switch to ->[sg]et_serial()

2018-10-12 Thread Al Viro
On Thu, Oct 11, 2018 at 07:58:28PM +0200, Geert Uytterhoeven wrote: > drivers/tty/amiserial.c:1076:3: error: 'retval' undeclared (first use > in this function) > > http://kisskb.ellerman.id.au/kisskb/buildresult/13544535/ > http://kisskb.ellerman.id.au/kisskb/buildresult/13544413/ Fixed and

Re: [resend PATCH] MAINTAINERS: Clarify UIO vs UACCESS maintainer

2018-10-12 Thread Al Viro
tecture patches that touch > lib/iov_iter.c. > > Cc: Al Viro > Reported-by: Greg Kroah-Hartman > Acked-by: Greg Kroah-Hartman > Signed-off-by: Dan Williams > --- > I got a bounce last time I tried to send this, hopefully the situation > has improved now. &

Re: [Ksummit-discuss] [PATCH v2 0/3] code of conduct fixes

2018-10-10 Thread Al Viro
On Wed, Oct 10, 2018 at 06:23:24PM -0500, Eric W. Biederman wrote: > Which is very problematic. > a) In append only logs like git we can not edit history. >Making it a mainters responsibility to edit the history, to do the >impossible is a problem. > > b) There are no responsibilities of

Re: [PATCH RFC] proc: Don't retain negative dentries

2018-10-08 Thread Al Viro
On Mon, Oct 08, 2018 at 07:02:09PM +0200, Ahmad Fatoum wrote: > Hello, > > On 10/8/18 6:55 PM, Al Viro wrote: > > > > What the hell does that have to do with negative dentries anywhere??? > > It's possible that this needs fixing at another place. I don't know, >

Re: [PATCH RFC] proc: Don't retain negative dentries

2018-10-08 Thread Al Viro
On Mon, Oct 08, 2018 at 06:50:10PM +0200, Ahmad Fatoum wrote: > The referenced commit 1da4d377f94 ("proc: revalidate misc dentries") > caused following userspace code to access a stale /proc/net/dev > after the network namespace was changed: > Despite switching the network namespace, the read

Re: general protection fault in getname_kernel

2018-10-07 Thread Al Viro
On Sun, Oct 07, 2018 at 04:44:03PM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:c1d84a1b42ef Merge git://git.kernel.org/pub/scm/linux/kern.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=10f3c6a140 >

Re: [Ksummit-discuss] [PATCH 1/2] code-of-conduct: Fix the ambiguity about collecting email addresses

2018-10-07 Thread Al Viro
On Sun, Oct 07, 2018 at 11:56:13PM +0100, Al Viro wrote: > We can surround it with "explanations" Sorry, "clarifications". Or whatever euphemism you prefer for exegesis, really...

Re: [Ksummit-discuss] [PATCH 1/2] code-of-conduct: Fix the ambiguity about collecting email addresses

2018-10-07 Thread Al Viro
On Mon, Oct 08, 2018 at 08:25:35AM +1000, Dave Airlie wrote: > This isn't a legally binding license or anything, but departing from > the upstream wording makes it tricker to merge new upstream versions > if they are considered appropriate. Nicely done, that - gotta love the passive voice use.

Re: [PATCH - resend] VFS: use synchronize_rcu_expedited() in namespace_unlock()

2018-10-04 Thread Al Viro
On Fri, Oct 05, 2018 at 11:27:37AM +1000, NeilBrown wrote: > > The synchronize_rcu() in namespace_unlock() is called every time > a filesystem is unmounted. If a great many filesystems are mounted, > this can cause a noticable slow-down in, for example, system shutdown. > > The sequence: >

Re: [PATCH] fs: ufs: Convert ufs_set_de_type to use lookup table

2018-10-01 Thread Al Viro
On Mon, Oct 01, 2018 at 04:33:10PM +0100, Phillip Potter wrote: > Modify ufs_set_de_type function in fs/ufs/util.h to use a lookup > table rather than a switch statement, as per the TODO comment. Brittle, that... Something like fs/ext2/dir.c approach (that is, #define S_SHIFT 12 static unsigned

Re: [PATCH 17/50] usb-serial: begin switching to ->[sg]et_serial()

2018-09-14 Thread Al Viro
On Fri, Sep 14, 2018 at 03:39:30PM +0200, Johan Hovold wrote: > > + if (port->serial->type->get_serial) > > + return port->serial->type->get_serial(tty, ss); > > + return -ENOIOCTLCMD; > > +} > > + > > +static int serial_set_serial(struct tty_struct *tty, struct serial_struct > >

Re: [PATCH 05/50] tty_ioctl(): start taking TIOC[SG]SERIAL into separate methods

2018-09-14 Thread Al Viro
On Fri, Sep 14, 2018 at 03:22:16PM +0200, Johan Hovold wrote: > On Thu, Sep 13, 2018 at 03:40:04AM +0100, Al Viro wrote: > > From: Al Viro > > > > ->set_serial() and ->get_serial() resp., both taking tty and > > a kernel pointer to serial_struct

Re: [PATCHES] tty ioctls cleanups, compat and not only

2018-09-14 Thread Al Viro
On Fri, Sep 14, 2018 at 10:21:53AM +0200, Arnd Bergmann wrote: > This does sound very appealing, but there is a small downside: > The difference between ".compat_ioctl = NULL" and > ".compat_ioctl=native_ioctl" is now very subtle, and I wouldn't > necessarily expect casual readers to understand

Re: [PATCH 04/10] iov_iter: Add mapping and discard iterator types

2018-09-13 Thread Al Viro
On Thu, Sep 13, 2018 at 04:52:09PM +0100, David Howells wrote: > Add two new iterator types to iov_iter: > > (1) ITER_MAPPING > > This walks through a set of pages attached to an address_space that > are pinned or locked, starting at a given page and offset and walking > for the

Re: [PATCHES] tty ioctls cleanups, compat and not only

2018-09-13 Thread Al Viro
; > Very definitely shared with sockets, and I prefer to handle the tty-side > > cases > > in ldisc ->compat_ioctl(). > > Fair enough. FWIW, a solution of sorts pushed into the same branch. It does *not* cover tty_operations ->compat_ioctl() - only ldisc ones. Comments? co

Re: [RFC] UAPI: Check headers by compiling all together as C++

2018-09-13 Thread Al Viro
On Fri, Sep 14, 2018 at 12:27:49AM +0100, David Howells wrote: > Al Viro wrote: > > > It's too early for AFD postings. And you *are* tempting > > me to throw into the tree as many anti-C++ devices as can be > > done tastefully, just to stop somebody

Re: [RFC] UAPI: Check headers by compiling all together as C++

2018-09-13 Thread Al Viro
On Fri, Sep 14, 2018 at 01:01:24AM +0300, Alexey Dobriyan wrote: > > Don't tempt me... > > <= g++-8 doesn't support C99 style initializers. > g++-8 mostly does: for example > > .foo = { > [BAR] = 1, > }, > > doesn't work, but regular .foo = 42 does. > Additionally, g++

Re: [PATCHES] tty ioctls cleanups, compat and not only

2018-09-13 Thread Al Viro
On Thu, Sep 13, 2018 at 01:19:42PM +0200, Arnd Bergmann wrote: > On Thu, Sep 13, 2018 at 4:31 AM Al Viro wrote: > > > > See vfs.git#work.tty-ioctl. Completely untested, should seriously > > clean the things up wrt compat. Remaining problems (aside of th

Re: [PATCH 00/10] iov_iter: Add new iters and use with AFS

2018-09-13 Thread Al Viro
On Thu, Sep 13, 2018 at 04:51:35PM +0100, David Howells wrote: > > Hi Al, > > Here's a set of patches that adds two new iov_iter types and then makes AFS > use them to do I/O. The iov_iter changes are: > > (1) Separate the type from the direction in the iov_iter struct and > provide

[PATCH 11/50] ipwireless: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/tty/ipwireless/tty.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index 1ef751c27ac6..fad3401e604d 100644 --- a/drivers/tty

[PATCH 06/50] simserial: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- arch/ia64/hp/sim/simserial.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 663388a73d4e..de5e69162ad5 100644 --- a/arch/ia64/hp/sim/simserial.c

[PATCH 04/50] mos7720: bury dead TIOCM... in ->ioctl()

2018-09-12 Thread Al Viro
From: Al Viro These ioctls never reach driver's ->ioctl() - tty_ioctl() handles them on its own. ->tiocm[gs]et() is what actually gets called, and mos7720 provides those, with results equivalent to what the unreachable code would be doing when called. Signed-off-by: Al Viro --- drive

[PATCH 10/50] cyclades: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/tty/cyclades.c | 77 -- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 6d3c58051ce3..4562c8060d09 100644 --- a/drivers/tty

[PATCH 01/50] presence of RS485 ioctls has been unconditional since 2014

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- fs/compat_ioctl.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index a9b00942e87d..53bc3659dcef 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -749,12 +749,8 @@ COMPATIBLE_IOCTL(TIOCOUTQ

[PATCH 02/50] move compat handling of tty ioctls to tty_compat_ioctl()

2018-09-12 Thread Al Viro
From: Al Viro ioctls that are * callable only via tty_ioctl() * not driver-specific * not demand data structure conversions * either always need passing arg as is or always demand compat_ptr() get intercepted in tty_compat_ioctl() from the very beginning

[PATCH 09/50] amiserial: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/tty/amiserial.c | 83 ++--- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 34dead614149..17fc8bb6c6b8 100644 --- a/drivers/tty

[PATCH 07/50] fwserial: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/staging/fwserial/fwserial.c | 66 - 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index fa0dd425b454..173f451b86b7

[PATCH 03/50] tty_ioctl(): drop FIONBIO handling

2018-09-12 Thread Al Viro
From: Al Viro That code had been live for 11 weeks back in 1992, but it had been 26 years since sys_ioctl() began handling FIONBIO on its own. Time to to bury the body, already... Signed-off-by: Al Viro --- drivers/tty/tty_io.c | 30 -- 1 file changed, 30

[PATCH 08/50] greybus/uart: switch to ->[sg]et_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/staging/greybus/uart.c | 47 -- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 8a006323c3c1..3313cb0b60af 100644

[PATCH 24/50] io_ti: switch to ->get_serial()

2018-09-12 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/usb/serial/io_ti.c | 47 ++ 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 6d1d6efa3055..c327d4cf7928 100644 --- a/drivers

  1   2   3   4   5   6   7   8   9   10   >