On Sat, Aug 15, 2020 at 11:23:43AM -0700, Pascal Bouchareine wrote:
> Let caller specify allocation.
> Preserve existing calls with GFP_USER.
Bloody bad idea, unless you slap a BUG_ON(flags & GFP_ATOMIC) on it,
to make sure nobody tries _that_. Note that copying from userland
is an inherently
On Thu, Aug 13, 2020 at 01:19:18PM -0400, Josef Bacik wrote:
> > in sunrpc proc_dodebug() turns into
> > left -= snprintf(buffer, left, "0x%04x\n",
left + 1, that is.
> >
On Thu, Aug 13, 2020 at 04:19:27PM +, David Laight wrote:
> From: Josef Bacik
> > Sent: 13 August 2020 15:53
> >
> > sysctl: pass kernel pointers to ->proc_handler
> >
> > we have been pre-allocating a buffer to copy the data from the proc
> > handlers into, and then copying that to
On Thu, Aug 13, 2020 at 05:41:17PM +0200, Christoph Hellwig wrote:
> On Thu, Aug 13, 2020 at 11:40:00AM -0400, Josef Bacik wrote:
> > On 8/13/20 11:37 AM, Christoph Hellwig wrote:
> >> On Thu, Aug 13, 2020 at 11:33:56AM -0400, Josef Bacik wrote:
> >>> Since
> >>>
> >>>sysctl: pass kernel
On Thu, Aug 13, 2020 at 09:36:52PM +1000, Daniel Axtens wrote:
> Hi,
>
> >> Seem like this could simply use a copy_to_user to further simplify
> >> things?
> >
> > I'll benchmark it and find out.
>
> I tried this:
>
> for (walk = head; walk; walk = walk->next) {
> - struct
On Wed, Aug 12, 2020 at 07:33:26PM +0100, Al Viro wrote:
> BTW, what would such opened files look like from /proc/*/fd/* POV? And
> what would happen if you walk _through_ that symlink, with e.g. ".."
> following it? Or with names of those attributes, for that matter...
&g
On Wed, Aug 12, 2020 at 06:39:11PM +0100, Al Viro wrote:
> On Wed, Aug 12, 2020 at 07:16:37PM +0200, Miklos Szeredi wrote:
> > On Wed, Aug 12, 2020 at 6:33 PM Al Viro wrote:
> > >
> > > On Wed, Aug 12, 2020 at 05:13:14PM +0200, Miklos Szeredi wrote:
> >
> >
On Wed, Aug 12, 2020 at 07:16:37PM +0200, Miklos Szeredi wrote:
> On Wed, Aug 12, 2020 at 6:33 PM Al Viro wrote:
> >
> > On Wed, Aug 12, 2020 at 05:13:14PM +0200, Miklos Szeredi wrote:
>
> > > Why does it have to have a struct mount? It does not have to use
> >
On Wed, Aug 12, 2020 at 05:13:14PM +0200, Miklos Szeredi wrote:
> > Lovely. And what of fchdir() to those?
>
> Not allowed.
Not allowed _how_? Existing check is "is it a directory"; what do you
propose? IIRC, you've mentioned using readdir() in that context, so
it's not that you only allow
On Wed, Aug 12, 2020 at 04:46:20PM +0200, Miklos Szeredi wrote:
> > "Can those suckers be passed to
> > ...at() as starting points?
>
> No.
Lovely. And what of fchdir() to those? Are they all non-directories?
Because the starting point of ...at() can be simulated that way...
> > Can they be
On Wed, Aug 12, 2020 at 09:23:23AM +0200, Miklos Szeredi wrote:
> Anyway, starting with just introducing the alt namespace without
> unification seems to be a good first step. If that turns out to be
> workable, we can revisit unification later.
Start with coming up with answers to the questions
On Tue, Aug 11, 2020 at 09:29:47PM -0700, Linus Torvalds wrote:
> On Tue, Aug 11, 2020 at 9:15 PM Al Viro wrote:
> >
> > fix breakage in do_rmdir()
> >
> > putname() should happen only after we'd *not* branched to
> > retry, same as it's done in do_unlinka
290
fix breakage in do_rmdir()
putname() should happen only after we'd *not* branched to
retry, same as it's done in do_unlinkat().
Fixes: e24ab0ef689d "fs: push the getname from do_rmdir into the callers"
Signed-off-by: Al Viro
---
diff --git a/fs/namei.c b/fs/namei.c
index fde8fe0
On Tue, Aug 11, 2020 at 10:28:31PM +0200, Miklos Szeredi wrote:
> On Tue, Aug 11, 2020 at 6:17 PM Casey Schaufler
> wrote:
>
> > Since ab has known meaning, and lots of applications
> > play loose with '/', its really dangerous to treat the string as
> > special. We only get away with
On Tue, Aug 11, 2020 at 09:09:36AM -0700, Linus Torvalds wrote:
> On Tue, Aug 11, 2020 at 9:05 AM Al Viro wrote:
> >
> > Except that you suddenly see non-directory dentries get children.
> > And a lot of dcache-related logics needs to be changed if that
> > becomes p
On Tue, Aug 11, 2020 at 08:20:24AM -0700, Linus Torvalds wrote:
> I don't think this works for the reasons Al says, but a slight
> modification might.
>
> IOW, if you do something more along the lines of
>
>fd = open(""foo/bar", O_PATH);
>metadatafd = openat(fd, "metadataname",
On Tue, Aug 11, 2020 at 04:36:32PM +0200, Miklos Szeredi wrote:
> > > - strip off trailing part after first instance of ///
> > > - perform path lookup as normal
> > > - resolve meta path after /// on result of normal lookup
> >
> > ... and interpolation of relative symlink body into the
On Tue, Aug 11, 2020 at 10:33:59AM -0400, Tang Jiye wrote:
> anyone knows how to post a question?
Generally the way you just have, except that you generally
put it *after* the relevant parts of the quoted text (and
removes the irrelevant ones).
On Tue, Aug 11, 2020 at 04:22:19PM +0200, Miklos Szeredi wrote:
> On Tue, Aug 11, 2020 at 4:08 PM Al Viro wrote:
> >
> > On Tue, Aug 11, 2020 at 03:54:19PM +0200, Miklos Szeredi wrote:
> > > On Wed, Aug 05, 2020 at 10:24:23AM +0200, Miklos Szeredi wrote:
> > >
On Tue, Aug 11, 2020 at 03:54:19PM +0200, Miklos Szeredi wrote:
> On Wed, Aug 05, 2020 at 10:24:23AM +0200, Miklos Szeredi wrote:
> > On Tue, Aug 4, 2020 at 4:36 PM Miklos Szeredi wrote:
> >
> > > I think we already lost that with the xattr API, that should have been
> > > done in a way that
On Tue, Aug 11, 2020 at 12:43:52AM +0200, Mickaël Salaün wrote:
> Hooking on open is a simple design that enables processes to check files
> they intend to open, before they open them.
Which is a good thing, because...?
> From an API point of view,
> this series extends openat2(2) with one
On Mon, Aug 10, 2020 at 10:09:09PM +, David Laight wrote:
> > On Mon, Aug 10, 2020 at 10:11:53PM +0200, Mickaël Salaün wrote:
> > > It seems that there is no more complains nor questions. Do you want me
> > > to send another series to fix the order of the S-o-b in patch 7?
> >
> > There is a
On Mon, Aug 10, 2020 at 10:11:53PM +0200, Mickaël Salaün wrote:
> It seems that there is no more complains nor questions. Do you want me
> to send another series to fix the order of the S-o-b in patch 7?
There is a major question regarding the API design and the choice of
hooking that stuff on
://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.misc
for you to fetch changes up to 6414e9b09ffd197803f8e86ce2fafdaf1de4e8e4:
fs: define inode flags using bit numbers (2020-07-27 14:39:53 -0400)
Al Viro (1):
dlmfs
The following changes since commit f073531070d24bbb82cb2658952d949f4851024b:
init: add an init_dup helper (2020-08-04 21:02:38 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git fixes
for you to fetch changes up to
On Fri, Aug 07, 2020 at 03:49:39PM -0700, Lokesh Gidra wrote:
> The new functions accept an optional context_inode parameter that
> callers can use to provide additional contextual information to
> security modules, e.g., indicating that one anonymous struct file is a
> logical child of another,
400)
----
Al Viro (7):
unexport linux/elfcore.h
take fdpic-related parts of elf_prstatus out
kill elf_fpxregs_t
[elf-fdpic] coredump: don't bother with cyclic list for per-thread objects
[elf-fdpic] move allocat
On Fri, Aug 07, 2020 at 01:09:30PM +0200, Enrico Weigelt, metux IT consult
wrote:
> Hello folks,
>
>
> here's the first version of my "srvfs" implementation - a synthentic
> filesystem which allows a process to "publish" an open file descriptor
> into the file system, so other processes can
On Fri, Aug 07, 2020 at 01:27:27PM +0100, Al Viro wrote:
> On Fri, Aug 07, 2020 at 07:35:08PM +0900, Tetsuo Handa wrote:
> > syzbot is reporting hung task at pipe_release() [1], for for_each_bvec()
> > from
> > iterate_bvec() from iterate_all_kinds() from iov_
On Fri, Aug 07, 2020 at 07:35:08PM +0900, Tetsuo Handa wrote:
> syzbot is reporting hung task at pipe_release() [1], for for_each_bvec() from
> iterate_bvec() from iterate_all_kinds() from iov_iter_alignment() from
> ext4_unaligned_io() from ext4_dio_write_iter() from ext4_file_write_iter()
>
set: kill user_regset_copyout{,_zero}() (2020-07-27 14:31:13 -0400)
----
Al Viro (42):
x86: copy_fpstate_to_sigframe(): have fpregs_soft_get() use kernel buffer
x86: kill dump_fpu()
[ia64] sanitize elf_access_gpreg()
On Thu, Aug 06, 2020 at 04:17:32PM +0200, Christoph Hellwig wrote:
> Fix for umount03 below. The other one works fine here, but from
> your logs this might be a follow on if you run it after umount without
> the fix.
Ugh...
How about
static int may_umount(const struct path *path, int flags)
{
On Thu, Aug 06, 2020 at 12:59:16PM +0100, Al Viro wrote:
> On Thu, Aug 06, 2020 at 07:53:16PM +0800, linmiaohe wrote:
> > From: Miaohe Lin
> >
> > We should fput() file iff FDPUT_FPUT is set. So we should set fput_needed
> > accordingly.
> >
> > Fi
On Thu, Aug 06, 2020 at 07:53:16PM +0800, linmiaohe wrote:
> From: Miaohe Lin
>
> We should fput() file iff FDPUT_FPUT is set. So we should set fput_needed
> accordingly.
>
> Fixes: 00e188ef6a7e ("sockfd_lookup_light(): switch to fdget^W^Waway from
> fget_light")
Explain, please. We are
Christoph's "getting rid of ksys_...() uses under KERNEL_DS" stuff.
One trivial conflict (drivers/md/md.c).
The following changes since commit f8456690ba8eb18ea4714e68554e242a04f65cff:
Merge tag 'clk-fixes-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux into
On Tue, Aug 04, 2020 at 07:20:05PM -0700, Palmer Dabbelt wrote:
> On Tue, 04 Aug 2020 19:07:45 PDT (-0700), v...@zeniv.linux.org.uk wrote:
> > On Tue, Aug 04, 2020 at 07:01:01PM -0700, Palmer Dabbelt wrote:
> >
> > > > We currently have @start_pos fixed at 0 across all calls, which works as
> > >
On Tue, Aug 04, 2020 at 07:01:01PM -0700, Palmer Dabbelt wrote:
> > We currently have @start_pos fixed at 0 across all calls, which works as
> > a result of the implementation, in particular because we have no padding
> > between the FP general registers and the FP control and status register,
>
On Tue, Aug 04, 2020 at 03:44:51PM +, Kalesh Singh wrote:
> Hi Al. Thank you for the comments. Ultimately what we need is to identify
> processes
> that hold a file reference to the dma-buf. Unfortunately we can't use only
> explicit dma_buf_get/dma_buf_put to track them because when an FD
On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote:
> IOW, what the hell is that horror for? You do realize, for example, that
> there's
> such thing as dup(), right? And dup2() as well. And while we are at it, how
> do you keep track of removals, considering the fact that y
On Mon, Aug 03, 2020 at 09:22:53AM -0700, Suren Baghdasaryan wrote:
> On Mon, Aug 3, 2020 at 9:12 AM Matthew Wilcox wrote:
> >
> > On Mon, Aug 03, 2020 at 09:00:00AM -0700, Suren Baghdasaryan wrote:
> > > On Mon, Aug 3, 2020 at 8:41 AM Matthew Wilcox wrote:
> > > >
> > > > On Mon, Aug 03, 2020
On Mon, Aug 03, 2020 at 02:47:18PM +, Kalesh Singh wrote:
> Provides a per process hook for the acquisition of file descriptors,
> despite the method used to obtain the descriptor.
No, with the side of Fuck, No.
Driver has no possible reason to watch know the descriptors involved.
Moreover,
On Thu, Jul 30, 2020 at 08:25:24AM +0200, Christoph Hellwig wrote:
> On Wed, Jul 29, 2020 at 08:51:17PM +0100, Al Viro wrote:
> > On Tue, Jul 28, 2020 at 06:33:53PM +0200, Christoph Hellwig wrote:
> > > Hi Al and Linus,
> > >
> > > currently a lot of the fi
On Thu, Jul 30, 2020 at 05:17:01PM +0100, Al Viro wrote:
> On Thu, Jul 30, 2020 at 05:20:46PM +0200, Christoph Hellwig wrote:
>
> > Fortunately I think the fix is pretty easy - remove the special pipe
> > zero copy optimization from copy_page_to_iter, and just have the
> &g
On Thu, Jul 30, 2020 at 05:20:46PM +0200, Christoph Hellwig wrote:
> Fortunately I think the fix is pretty easy - remove the special pipe
> zero copy optimization from copy_page_to_iter, and just have the
> callers actually want it because they have pagecache or similar
> refcountable pages use
On Thu, Jul 30, 2020 at 09:03:29AM +0200, Christoph Hellwig wrote:
> On Thu, Jul 30, 2020 at 01:05:44AM +0100, Al Viro wrote:
> > On Tue, Jul 07, 2020 at 07:48:00PM +0200, Christoph Hellwig wrote:
> > > If a file implements the ->read_iter method, the iter based sp
On Tue, Jul 07, 2020 at 07:48:00PM +0200, Christoph Hellwig wrote:
> If a file implements the ->read_iter method, the iter based splice read
> works and is always preferred over the ->read based one. Use it by
> default in do_splice_to and remove all the direct assignment of
>
On Fri, Jul 17, 2020 at 11:09:13PM +0200, Thomas Gleixner wrote:
>
> Needs some thought and maybe some cocci help from Julia, but that's way
> better than this brute force sed thing which results in malformed crap
> like this:
>
> static const struct file_operations debug_stats_fops = {
>
On Tue, Jul 07, 2020 at 07:47:46PM +0200, Christoph Hellwig wrote:
> If we write to a file that implements ->write_iter there is no need
> to change the address limit if we send a kvec down. Implement that
> case, and prefer it over using plain ->write with a changed address
> limit if available.
On Tue, Jul 28, 2020 at 06:33:53PM +0200, Christoph Hellwig wrote:
> Hi Al and Linus,
>
> currently a lot of the file system calls in the early in code (and the
> devtmpfs kthread) rely on the implicit set_fs(KERNEL_DS) during boot.
> This is one of the few last remaining places we need to deal
On Wed, Jul 29, 2020 at 08:33:05AM +0200, Christoph Hellwig wrote:
> Thanks,
>
> I've sent out a fixed version.
#work.quota-compat and #for-next rebuilt (and pushed) with it...
On Tue, Jul 28, 2020 at 03:22:59PM -0700, Casey Schaufler wrote:
> > + hlist_for_each_entry(p, _hook_heads.bdev_setsecurity, list) {
> > + rc = p->hook.bdev_setsecurity(bdev, name, value, size);
> > +
> > + if (rc == -ENOSYS)
> > + rc = 0;
> > +
> > +
On Mon, Jul 27, 2020 at 11:31:58PM +0200, Jan Kara wrote:
> On Mon 27-07-20 16:56:16, Al Viro wrote:
> > On Mon, Jul 27, 2020 at 02:41:27PM +0200, Jan Kara wrote:
> > > On Sun 26-07-20 18:04:01, Christoph Hellwig wrote:
> > > > Fold the misaligned u64 workaroun
On Mon, Jul 27, 2020 at 06:40:54PM +0100, Colin King wrote:
> From: Colin Ian King
>
> Variable regset0_size is an unsigned int and it is being checked
> for an error by checking if it is less than zero, and hence this
> check is always going to be false. Fix this by making the variable
>
at sendmsg() with several different-sized cmsg
attached started to fail with EINVAL. Trivial to fix, fortunately.
Reported-by: Nick Bowler
Tested-by: Nick Bowler
Fixes: 547ce4cfb34c ("switch cmsghdr_from_user_compat_to_kern() to
copy_from_user()")
Signed-off-by: Al Viro
---
diff --git
On Mon, Jul 27, 2020 at 05:05:54PM +0100, Al Viro wrote:
> On Thu, Jul 23, 2020 at 11:51:01AM -0400, Nick Bowler wrote:
> > Hi,
> >
> > After installing Linux 5.8-rc6, it seems cryptsetup can no longer
> > open LUKS volumes. Regardless of the entered passphras
On Thu, Jul 23, 2020 at 11:51:01AM -0400, Nick Bowler wrote:
> Hi,
>
> After installing Linux 5.8-rc6, it seems cryptsetup can no longer
> open LUKS volumes. Regardless of the entered passphrase (correct
> or otherwise), the result is a very unhelpful "Keyslot open failed."
> message.
>
> On
On Mon, Jul 27, 2020 at 02:41:27PM +0200, Jan Kara wrote:
> On Sun 26-07-20 18:04:01, Christoph Hellwig wrote:
> > Fold the misaligned u64 workarounds into the main quotactl flow instead
> > of implementing a separate compat syscall handler.
> >
> > Signed-off-by: Christoph Hellwig
>
> The
On Mon, Jul 27, 2020 at 08:48:28AM +0200, Christoph Hellwig wrote:
> On Mon, Jul 27, 2020 at 07:03:22AM +0100, Al Viro wrote:
> > On Mon, Jul 27, 2020 at 07:46:25AM +0200, Christoph Hellwig wrote:
> > > On Mon, Jul 27, 2020 at 04:05:34AM +0100, Al Viro wrote:
> > > >
On Mon, Jul 27, 2020 at 09:51:45AM +, David Laight wrote:
> I'm sure there is code that processes options in chunks.
> This probably means it is possible to put a chunk boundary
> at the end of userspace and continue processing the very start
> of kernel memory.
>
> At best this faults on
On Mon, Jul 27, 2020 at 07:46:25AM +0200, Christoph Hellwig wrote:
> On Mon, Jul 27, 2020 at 04:05:34AM +0100, Al Viro wrote:
> > On Tue, Jul 14, 2020 at 09:04:22PM +0200, Christoph Hellwig wrote:
> > > Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but
On Thu, Jul 23, 2020 at 07:12:24PM +0200, Mickaël Salaün wrote:
> When the O_MAYEXEC flag is passed, openat2(2) may be subject to
> additional restrictions depending on a security policy managed by the
> kernel through a sysctl or implemented by an LSM thanks to the
> inode_permission hook. This
On Sun, Jul 26, 2020 at 08:11:32AM +0100, Christoph Hellwig wrote:
> On Fri, Jul 24, 2020 at 01:30:40PM +0100, Al Viro wrote:
> > > Sorry, I meant csum_and_copy_from_nocheck, just as in this patch.
> > >
> > > Merging your branch into the net-next tree thus wi
On Tue, Jul 14, 2020 at 09:04:22PM +0200, Christoph Hellwig wrote:
> Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but
> instead open a struct file for /dev/console and then install it as FD
> 0/1/2 manually.
I really hate that one. Every time we exposed the internal
On Tue, Jul 14, 2020 at 09:04:21PM +0200, Christoph Hellwig wrote:
> - ssize_t rv = ksys_write(fd, p, count);
> + ssize_t rv = kernel_write(file, p, count, >f_pos);
No. Sure, that'll work for ramfs with nobody else playing with those.
However, this is the wrong way to do
On Thu, Jul 23, 2020 at 04:27:34PM +0200, Christoph Hellwig wrote:
> On Thu, Jul 23, 2020 at 04:25:34PM +0200, Lukasz Stelmach wrote:
> > >> Can you comment out the call to d_genocide? It seems like for your
> > >> the fact that clean_rootfs didn't actually clean up was a feature and
> > >> not a
On Tue, Jul 14, 2020 at 09:04:16PM +0200, Christoph Hellwig wrote:
> static int __init
> -identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
> +identify_ramdisk_image(struct file *file, int start_block,
> + decompress_fn *decompressor)
> {
> -
On Tue, Jul 14, 2020 at 03:02:58PM +0800, zhouchuangao wrote:
> Fix code style errors reported by scripts/checkpatch.pl.
NAKed-because: excessive deference to checkpatch.pl
It's not a holy oracle than needs to be appeased, no questions
asked. Reference to it is absolutely insufficient reason
On Sun, Jul 26, 2020 at 06:34:22PM +0200, Christoph Hellwig wrote:
> On Sun, Jul 26, 2020 at 05:32:14PM +0100, Al Viro wrote:
> > > +static int compat_copy_fs_qfilestat(struct compat_fs_qfilestat __user
> > > *to,
> > > + struct fs_qfilestat *from)
>
On Sun, Jul 26, 2020 at 06:26:27PM +0200, Christoph Hellwig wrote:
> On Sun, Jul 26, 2020 at 06:24:26PM +0200, Christoph Hellwig wrote:
> > Btw, care to take a look at
> >
> > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/kernel_readwrite
> >
> > it has been in linux-next for
On Sun, Jul 26, 2020 at 06:04:01PM +0200, Christoph Hellwig wrote:
> Fold the misaligned u64 workarounds into the main quotactl flow instead
> of implementing a separate compat syscall handler.
I can live with that (and drop the local quota-related stuff from
copy_in_user/compat_alloc_user_space
On Sun, Jul 26, 2020 at 05:52:04PM +0200, Christoph Hellwig wrote:
> On Sun, Jul 26, 2020 at 08:49:28AM -0700, Linus Torvalds wrote:
> > On Sun, Jul 26, 2020 at 12:14 AM Christoph Hellwig wrote:
> > >
> > > Hi Al and Linus,
> > >
> > > currently a lot of the file system calls in the early in code
On Fri, Jul 24, 2020 at 05:40:43PM -0700, Pascal Bouchareine wrote:
> This command attaches a description to a file descriptor for
> troubleshooting purposes. The free string is displayed in the
> process fdinfo file for that fd /proc/pid/fdinfo/fd.
>
> One intended usage is to allow processes to
On Tue, Jul 21, 2020 at 10:11:18PM +0100, Al Viro wrote:
> Theoretically - sure. I can post the full analysis of that stuff (starting
> with the proof that all instances of csum_partial() are OK in that respect,
> which takes care of the default instances, then instance-by-instance
&
On Fri, Jul 24, 2020 at 07:16:44PM +0100, Al Viro wrote:
Argh... Sorry, hit send too early; the missing summary would be
Max Filippov has caught a breakage introduced in xtensa this
cycle by the csum_and_copy_..._user() series. Cut'n'paste from the
wrong source - the check that belongs
The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407:
Linux 5.8-rc1 (2020-06-14 12:45:04 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git fixes
for you to fetch changes up to
On Fri, Jul 24, 2020 at 01:23:37PM +0100, Christoph Hellwig wrote:
> On Fri, Jul 24, 2020 at 01:19:18PM +0100, Al Viro wrote:
> > > net-next has a patch from me killing off csum_and_copy_from_user
> > > already:
> > >
> > > https://git.kernel.org/pub/s
On Fri, Jul 24, 2020 at 07:41:17AM +0100, Christoph Hellwig wrote:
> On Fri, Jul 24, 2020 at 02:25:30AM +0100, Al Viro wrote:
> > From: Al Viro
> >
> > quite a few architectures have the same csum_partial_copy_nocheck() -
> > simply memcpy() the data and then
From: Al Viro
it's always 0
Signed-off-by: Al Viro
---
drivers/net/ethernet/sun/sunvnet_common.c | 2 +-
include/linux/skbuff.h| 2 +-
net/core/skbuff.c | 11 ++-
net/ipv4/icmp.c | 2 +-
net/ipv4/ip_output.c
From: Max Filippov
Commit d341659f470b ("xtensa: switch to providing
csum_and_copy_from_user()") introduced access check, but incorrectly
tested dst instead of src.
Fix access_ok argument in csum_and_copy_from_user.
Cc: Al Viro
Fixes: d341659f470b ("xtensa: swit
From: Al Viro
Preparation for the change of calling conventions; right now all
callers pass 0 as initial sum. Passing 0x instead yields
the values comparable mod 0x and guarantees that 0 will not
be returned on success.
Note that this relies upon the correct behaviour
From: Al Viro
get rid of set_fs() in csum_partial_copy_nocheck(), while we are at it -
just take the part of csum_and_copy_from_user() sans the access_ok() check
into a helper function and have csum_partial_copy_nocheck() call that.
Signed-off-by: Al Viro
---
arch/alpha/lib
From: Al Viro
... and get rid of the "clean the destination on error" crap.
Simplifies the fault handlers and the function itself...
Signed-off-by: Al Viro
---
arch/arm/include/asm/checksum.h | 7 ++-
arch/arm/lib/csumpartialcopy.S| 1 -
ar
From: Al Viro
do csum_partial_copy_nocheck() on the first fragment, then
add the rest to it. Equivalent transformation.
That was the only caller of csum_partial_copy_nocheck() that
might pass it non-zero as the last argument.
Signed-off-by: Al Viro
---
net/ipv4/icmp.c | 8
1 file
From: Al Viro
... and don't bother zeroing destination on error
Signed-off-by: Al Viro
---
arch/x86/include/asm/checksum_32.h | 18 ++
arch/x86/lib/checksum_32.S | 117 +
2 files changed, 47 insertions(+), 88 deletions(-)
diff --git a/arch/x86
From: Al Viro
quite a few architectures have the same csum_partial_copy_nocheck() -
simply memcpy() the data and then return the csum of the copy.
hexagon, parisc, ia64, s390, um: explicitly spelled out that way.
arc, arm64, csky, h8300, m68k/nommu, microblaze, mips/GENERIC_CSUM, nds32,
nios2
From: Al Viro
Signed-off-by: Al Viro
---
arch/m68k/lib/checksum.c | 79 +---
1 file changed, 15 insertions(+), 64 deletions(-)
diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c
index 3aeca261f622..7e6afeae6217 100644
--- a/arch/m68k
From: Al Viro
It's always 0. Note that we could use ~0U as well - result
will be the same modulo 0x; later we'll make use of that
whenever convenient.
Signed-off-by: Al Viro
---
arch/alpha/include/asm/checksum.h| 2 +-
arch/alpha/lib/csum_partial_copy.c | 4 ++--
arch/arm/include
From: Al Viro
... and get rid of zeroing destination on error there.
Signed-off-by: Al Viro
---
arch/sh/include/asm/checksum_32.h | 20 ++-
arch/sh/lib/checksum.S| 119 +++---
2 files changed, 39 insertions(+), 100 deletions(-)
diff --git
From: Al Viro
Signed-off-by: Al Viro
---
arch/mips/include/asm/checksum.h | 3 ---
arch/mips/lib/csum_partial.S | 3 ---
2 files changed, 6 deletions(-)
diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index 5cf4ce11c821..a8ff9c306363 100644
--- a/arch/mips
From: Al Viro
... and get rid of zeroing the target, etc. on fault.
All exception handlers merge into one; moreover, since we are not
calling lookup_fault() anymore, we don't need the magic with passing
arguments for it from the page fault handler.
Acked-by: David S. Miller
Signed-off-by: Al
From: Al Viro
and turn the exception handlers into simply returning 0, which
simplifies the hell out of things in csum_partial.S
Signed-off-by: Al Viro
---
arch/mips/include/asm/checksum.h | 26 +---
arch/mips/lib/csum_partial.S | 258 +--
2 files
From: Al Viro
they are only called for iovec-backed iov_iter and under KERNEL_DS an
attempt to create such a beast will yield a kvec-backed one.
Signed-off-by: Al Viro
---
arch/mips/include/asm/checksum.h | 32 +++-
1 file changed, 7 insertions(+), 25 deletions
From: Al Viro
... and get rid of the pointless fallback in the wrappers. On error it used
to zero the unwritten area and calculate the csum of the entire thing. Not
wanting to do it in assembler part had been very reasonable; doing that in
the first place, OTOH... In case of an error
From: Al Viro
... and rename them into csum_and_copy_...() - the wrappers become pointless.
[braino fixed]
Signed-off-by: Al Viro
---
arch/sparc/include/asm/checksum.h| 1 +
arch/sparc/include/asm/checksum_32.h | 2 --
arch/sparc/include/asm/checksum_64.h | 41
From: Al Viro
turn the exception handlers into returning 0.
Reviewed-by: Max Filippov
Tested-by: Max Filippov
Signed-off-by: Al Viro
---
arch/xtensa/include/asm/checksum.h | 20 +++-
arch/xtensa/lib/checksum.S | 67 +-
2 files changed, 19
From: Al Viro
... and fold handling of misaligned case into it.
Implementation note: we stash the "will we need to rol8 the sum in the end"
flag into the MSB of %rcx (the lower 32 bits are used for length); the rest
is pretty straightforward.
Signed-off-by: Al Viro
---
arch/x86/i
From: Al Viro
All callers of these primitives will
* discard anything we might've copied in case of error
* ignore the csum value in case of error
* always pass 0x as the initial sum, so the
resulting csum value (in case of success, that is) will never be 0
followups.
Shortlog:
Al Viro (19):
skb_copy_and_csum_bits(): don't bother with the last argument
icmp_push_reply(): reorder adding the checksum up
unify generic instances of csum_partial_copy_nocheck()
csum_partial_copy_nocheck(): drop the last argument
csum_and_cop
On Thu, Jul 23, 2020 at 09:00:29AM +0100, Christoph Hellwig wrote:
> Hi Al,
>
> what's the state of the series? I noticed it hasn't shown up in
> linux-next so far.
It (as well as fdpic coredump stuff) will go into -next as soon as I post
the second variant of csum_and_copy stuff (later today).
On Thu, Jul 23, 2020 at 03:53:42PM +0100, Al Viro wrote:
> Said that, what you've printed for 1-byte segments (and that's going to be
> seriously affected by the setup costs in csum-copy.S, sensitive to calling
> convention changes) is time to run the 16-iteration loop divided by 1 *
501 - 600 of 11792 matches
Mail list logo