[net-next:master 1147/1193] drivers/net/ethernet/socionext/netsec.c:1583:17: error: implicit declaration of function 'devm_ioremap'; did you mean '__ioremap'?

2018-01-10 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: c5e62a24278ab343819dc35fee3684e6b4ba755d commit: 533dd11a12f698c571a12271b20f235792d3e148 [1147/1193] net: socionext: Add Synquacer NetSec driver config: m68k-allyesconfig (attached as .config) compiler: m68

[patch iproute2 v9 1/2] lib/libnetlink: Add a new function rtnl_talk_iov

2018-01-10 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_iov that can send multiple messages to kernel. rtnl_talk_iov takes struct iovec * and iovlen as arguments. Signed-off-by: Chris Mi Signed-off-by: David Ahern --- include/libnetlink.h | 3 +++ lib/libnetlink.c

[patch iproute2 v9 0/2] tc: Add batchsize feature to batch mode

2018-01-10 Thread Chris Mi
Currently in tc batch mode, only one command is read from the batch file and sent to kernel to process. With this patchset, at most 128 commands can be accumulated before sending to kernel. We introduced two new functions in patch 1 to support for sending multiple messages. In patch 2, we add this

[patch iproute2 v9 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
Currently in tc batch mode, only one command is read from the batch file and sent to kernel to process. With this support, at most 128 commands can be accumulated before sending to kernel. Now it only works for the following successive commands: 1. filter add/delete/change/replace 2. actions add/c

[PATCH net-next 2/2] net: sched: red: don't reset the backlog on every stat dump

2018-01-10 Thread Jakub Kicinski
Commit 0dfb33a0d7e2 ("sch_red: report backlog information") copied child's backlog into RED's backlog. Back then RED did not maintain its own backlog counts. This has changed after commit 2f5fb43f ("net_sched: update hierarchical backlog too") and commit d7f4f332f082 ("sch_red: update backlog

[PATCH net-next 0/2] sched: improve behaviour of offloaded RED stats

2018-01-10 Thread Jakub Kicinski
Hi! This set attempts to improve the kernel API for TC qdisc offloads. The cumulative stats are handled nicely today, but the momentary stats like backlog and qlen are behaving a little less cleanly. v1: - reset the stats on destroy (incl. replace with unsupported params). Jakub Kicinski (2):

[PATCH net-next 1/2] net: sched: add qstats.qlen to qlen

2018-01-10 Thread Jakub Kicinski
AFAICT struct gnet_stats_queue.qlen is not used in Qdiscs. It may, however, be useful for offloads to report HW queue length there. Add that value to the result of qdisc_qlen_sum(). Signed-off-by: Jakub Kicinski --- include/net/sch_generic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

RE: [patch iproute2 v8 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Thursday, January 11, 2018 3:41 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: Re: [patch iproute2 v8 2/2] tc:

RE: [patch iproute2 v8 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov

2018-01-10 Thread Chris Mi
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Thursday, January 11, 2018 3:21 AM > To: Chris Mi ; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com; p...@nwl.cc > Subject: Re: [patch iproute2 v8 1/2] lib/

RE: [patch iproute2 v8 2/2] tc: Add batchsize feature for filter and actions

2018-01-10 Thread Chris Mi
> -Original Message- > From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] > Sent: Wednesday, January 10, 2018 7:42 PM > To: Chris Mi > Cc: netdev@vger.kernel.org; gerlitz...@gmail.com; > step...@networkplumber.org; dsah...@gmail.com; p...@nwl.cc > Subject: Re: [patch iproute2

RE: [RFC crypto v3 0/9] Chelsio Inline TLS

2018-01-10 Thread Atul Gupta
Would truly appreciate your feedback and make progress. Thanks and Regards Atul -Original Message- From: linux-crypto-ow...@vger.kernel.org [mailto:linux-crypto-ow...@vger.kernel.org] On Behalf Of Atul Gupta Sent: Wednesday, January 3, 2018 12:36 PM To: herb...@gondor.apana.org.au; linux

Re: [PATCH 03/32] fs: introduce new ->get_poll_head and ->poll_mask methods

2018-01-10 Thread Al Viro
On Wed, Jan 10, 2018 at 09:04:16PM +, Al Viro wrote: > On Wed, Jan 10, 2018 at 04:58:24PM +0100, Christoph Hellwig wrote: > > ->get_poll_head returns the waitqueue that the poll operation is going > > to sleep on. Note that this means we can only use a single waitqueue > > for the poll, unlike

linux-next: manual merge of the kspp tree with the net tree

2018-01-10 Thread Stephen Rothwell
Hi Kees, Today's linux-next merge of the kspp tree got a conflict in: net/sctp/socket.c between commit: c76f97c99ae6 ("sctp: make use of pre-calculated len") from the net tree and commit: 3511d716f5a8 ("sctp: Copy struct sctp_sock.autoclose to userspace using put_user()") from the ksp

Re: [PATCH net-next v2] xfrm: Add ESN support for IPSec HW offload

2018-01-10 Thread Shannon Nelson
On 1/10/2018 3:09 PM, Yossi Kuperman wrote: On 10 Jan 2018, at 19:36, Shannon Nelson wrote: On 1/10/2018 2:34 AM, yoss...@mellanox.com wrote: From: Yossef Efraim This patch adds ESN support to IPsec device offload. Adding new xfrm device operation to synchronize device ESN. Signed-off-by: Yos

Re: [PATCH net-next V2 2/2] tuntap: XDP transmission

2018-01-10 Thread Jason Wang
On 2018年01月11日 00:11, Tariq Toukan wrote: +EXPORT_SYMBOL(tun_ptr_to_xdp); + Hi Jason, I started getting the following compilation issues. + make -j24 -s net/socket.o: In function `tun_xdp_to_ptr': /images/autom/buildbot/worker/merge-net-next/build/./include/linux/if_tun.h:46: multiple defin

[PATCH 35/38] kvm: whitelist struct kvm_vcpu_arch

2018-01-10 Thread Kees Cook
From: Paolo Bonzini On x86, ARM and s390, struct kvm_vcpu_arch has a usercopy region that is read and written by the KVM_GET/SET_CPUID2 ioctls (x86) or KVM_GET/SET_ONE_REG (ARM/s390). Without whitelisting the area, KVM is completely broken on those architectures with usercopy hardening enabled.

[PATCH 33/38] arm64: Implement thread_struct whitelist for hardened usercopy

2018-01-10 Thread Kees Cook
This whitelists the FPU register state portion of the thread_struct for copying to userspace, instead of the default entire structure. Cc: Catalin Marinas Cc: Will Deacon Cc: Christian Borntraeger Cc: Ingo Molnar Cc: James Morse Cc: "Peter Zijlstra (Intel)" Cc: Dave Martin Cc: zijun_hu Cc:

[PATCH 16/38] befs: Define usercopy region in befs_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor befs symlink pathnames, stored in struct befs_inode_info.i_data.symlink and therefore contained in the befs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/befs/linuxvfs.c: befs_alloc_inode(...): ...

[PATCH 38/38] lkdtm: Update usercopy tests for whitelisting

2018-01-10 Thread Kees Cook
This updates the USERCOPY_HEAP_FLAG_* tests to USERCOPY_HEAP_WHITELIST_*, since the final form of usercopy whitelisting ended up using an offset/size window instead of the earlier proposed allocation flags. Signed-off-by: Kees Cook --- drivers/misc/lkdtm.h | 4 +- drivers/misc/lkdtm_co

[PATCH v5 00/38] Hardened usercopy whitelisting

2018-01-10 Thread Kees Cook
v5: - add Acks - split stddef changes into separate patch - further refactor reporting code for readability - adjust enforcement code for greater readability v4: - refactor reporting to include offset and remove %p - explicitly WARN by default for the whitelisting - add KVM whitelists and harden i

[PATCH 04/38] lkdtm/usercopy: Adjust test to include an offset to check reporting

2018-01-10 Thread Kees Cook
Instead of doubling the size, push the start position up by 16 bytes to still trigger an overflow. This allows to verify that offset reporting is working correctly. Signed-off-by: Kees Cook --- drivers/misc/lkdtm_usercopy.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) dif

[PATCH 02/38] usercopy: Enhance and rename report_usercopy()

2018-01-10 Thread Kees Cook
In preparation for refactoring the usercopy checks to pass offset to the hardened usercopy report, this renames report_usercopy() to the more accurate usercopy_abort(), marks it as noreturn because it is, adds a hopefully helpful comment for anyone investigating such reports, makes the function ava

[PATCH 03/38] usercopy: Include offset in hardened usercopy report

2018-01-10 Thread Kees Cook
This refactors the hardened usercopy code so that failure reporting can happen within the checking functions instead of at the top level. This simplifies the return value handling and allows more details and offsets to be included in the report. Having the offset can be much more helpful in underst

[PATCH 22/38] scsi: Define usercopy region in scsi_sense_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor SCSI sense buffers, stored in struct scsi_cmnd.sense and therefore contained in the scsi_sense_cache slab cache, need to be copied to/from userspace. cache object allocation: drivers/scsi/scsi_lib.c: scsi_select_sense_cache(...): return ... ? scsi_sens

[PATCH 05/38] stddef.h: Introduce sizeof_field()

2018-01-10 Thread Kees Cook
The size of fields within a structure is needed in a few places in the kernel already, and will be needed for the usercopy whitelisting when declaring whitelist regions within structures. This creates a dedicated macro and redefines offsetofend() to use it. Existing usage, ignoring the 1200+ lustr

[PATCH 20/38] vxfs: Define usercopy region in vxfs_inode slab cache

2018-01-10 Thread Kees Cook
From: David Windsor vxfs symlink pathnames, stored in struct vxfs_inode_info field vii_immed.vi_immed and therefore contained in the vxfs_inode slab cache, need to be copied to/from userspace. cache object allocation: fs/freevxfs/vxfs_super.c: vxfs_alloc_inode(...): ...

[PATCH 23/38] net: Define usercopy region in struct proto slab cache

2018-01-10 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. Some protocols need to copy objects to/from userspace, and they can declare the region via their proto structure with the new usersize a

[PATCH 26/38] sctp: Define usercopy region in SCTP proto slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The SCTP socket event notification subscription information need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. Additionally moves the usercopy fields

[PATCH 25/38] caif: Define usercopy region in caif proto slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The CAIF channel connection request parameters need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. example usage trace: net/caif/caif_socket.c:

[PATCH 36/38] kvm: x86: fix KVM_XEN_HVM_CONFIG ioctl

2018-01-10 Thread Kees Cook
From: Paolo Bonzini This ioctl is obsolete (it was used by Xenner as far as I know) but still let's not break it gratuitously... Its handler is copying directly into struct kvm. Go through a bounce buffer instead, with the added benefit that we can actually do something useful with the flags ar

[PATCH 37/38] usercopy: Restrict non-usercopy caches to size 0

2018-01-10 Thread Kees Cook
With all known usercopied cache whitelists now defined in the kernel, switch the default usercopy region of kmem_cache_create() to size 0. Any new caches with usercopy regions will now need to use kmem_cache_create_usercopy() instead of kmem_cache_create(). This patch is modified from Brad Spengle

[PATCH 21/38] cifs: Define usercopy region in cifs_request slab cache

2018-01-10 Thread Kees Cook
From: David Windsor CIFS request buffers, stored in the cifs_request slab cache, need to be copied to/from userspace. cache object allocation: fs/cifs/cifsfs.c: cifs_init_request_bufs(): ... cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,

[PATCH 27/38] sctp: Copy struct sctp_sock.autoclose to userspace using put_user()

2018-01-10 Thread Kees Cook
From: David Windsor The autoclose field can be copied with put_user(), so there is no need to use copy_to_user(). In both cases, hardened usercopy is being bypassed since the size is constant, and not open to runtime manipulation. This patch is verbatim from Brad Spengler/PaX Team's PAX_USERCOPY

pull-request: bpf-next 2018-01-11

2018-01-10 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Various BPF related improvements and fixes to nfp driver: i) do not register XDP RXQ structure to control queues, ii) round up program stack size to word size for nfp, iii) restrict

[PATCH 31/38] fork: Provide usercopy whitelisting for task_struct

2018-01-10 Thread Kees Cook
While the blocked and saved_sigmask fields of task_struct are copied to userspace (via sigmask_to_save() and setup_rt_frame()), it is always copied with a static length (i.e. sizeof(sigset_t)). The only portion of task_struct that is potentially dynamically sized and may be copied to userspace is

[PATCH 32/38] x86: Implement thread_struct whitelist for hardened usercopy

2018-01-10 Thread Kees Cook
This whitelists the FPU register state portion of the thread_struct for copying to userspace, instead of the default entire struct. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Mathias Krause Signed-off-by: Kees Cook

[PATCH 19/38] ufs: Define usercopy region in ufs_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The ufs symlink pathnames, stored in struct ufs_inode_info.i_u1.i_symlink and therefore contained in the ufs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ufs/super.c: ufs_alloc_inode(...): ... ei

[PATCH 30/38] fork: Define usercopy region in thread_stack slab caches

2018-01-10 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the thread_stack slab caches in which userspace copy operations are allowed. Since the entire thread_stack needs to be available to userspace, the entire slab contents are whitelisted. Note that the slab-based th

[PATCH 28/38] net: Restrict unwhitelisted proto caches to size 0

2018-01-10 Thread Kees Cook
Now that protocols have been annotated (the copy of icsk_ca_ops->name is of an ops field from outside the slab cache): $ git grep 'copy_.*_user.*sk.*->' caif/caif_socket.c: copy_from_user(&cf_sk->conn_req.param.data, ov, ol)) { ipv4/raw.c: if (copy_from_user(&raw_sk(sk)->filter, optval, optlen))

[PATCH 29/38] fork: Define usercopy region in mm_struct slab caches

2018-01-10 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the mm_struct slab caches in which userspace copy operations are allowed. Only the auxv field is copied to userspace. cache object allocation: kernel/fork.c: #define allocate_mm() (kmem_cache_all

[PATCH 18/38] orangefs: Define usercopy region in orangefs_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor orangefs symlink pathnames, stored in struct orangefs_inode_s.link_target and therefore contained in the orangefs_inode_cache, need to be copied to/from userspace. cache object allocation: fs/orangefs/super.c: orangefs_alloc_inode(...): ...

[PATCH 17/38] exofs: Define usercopy region in exofs_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The exofs short symlink names, stored in struct exofs_i_info.i_data and therefore contained in the exofs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/exofs/super.c: exofs_alloc_inode(...): ... oi

Re: [PATCH V2] ipvlan: fix ipvlan MTU limits

2018-01-10 Thread महेश बंडेवार
On Tue, Jan 9, 2018 at 11:21 PM, wrote: > From: Keefe Liu > > The MTU of ipvlan interface should not bigger than the phy device, When we > run following scripts, we will find there are some problems. > Step1: > ip link add link eth0 name ipv1 type ipvlan mode l2 > ip netns add ne

[PATCH 01/38] usercopy: Remove pointer from overflow report

2018-01-10 Thread Kees Cook
Using %p was already mostly useless in the usercopy overflow reports, so this removes it entirely to avoid confusion now that %p-hashing is enabled. Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Kees Cook --- mm/usercopy.c | 9 - 1 file changed, 4 inse

[PATCH 06/38] usercopy: Prepare for usercopy whitelisting

2018-01-10 Thread Kees Cook
From: David Windsor This patch prepares the slab allocator to handle caches having annotations (useroffset and usersize) defining usercopy regions. This patch is modified from Brad Spengler/PaX Team's PAX_USERCOPY whitelisting code in the last public patch of grsecurity/PaX based on my understan

[PATCH 10/38] dcache: Define usercopy region in dentry_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor When a dentry name is short enough, it can be stored directly in the dentry itself (instead in a separate kmalloc allocation). These dentry short names, stored in struct dentry.d_iname and therefore contained in the dentry_cache slab cache, need to be coped to userspace. cach

[PATCH 08/38] usercopy: Allow strict enforcement of whitelists

2018-01-10 Thread Kees Cook
This introduces CONFIG_HARDENED_USERCOPY_FALLBACK to control the behavior of hardened usercopy whitelist violations. By default, whitelist violations will continue to WARN() so that any bad or missing usercopy whitelists can be discovered without being too disruptive. If this config is disabled at

[PATCH 09/38] usercopy: Mark kmalloc caches as usercopy caches

2018-01-10 Thread Kees Cook
From: David Windsor Mark the kmalloc slab caches as entirely whitelisted. These caches are frequently used to fulfill kernel allocations that contain data to be copied to/from userspace. Internal-only uses are also common, but are scattered in the kernel. For now, mark all the kmalloc caches as w

[PATCH 07/38] usercopy: WARN() on slab cache usercopy region violations

2018-01-10 Thread Kees Cook
This patch adds checking of usercopy cache whitelisting, and is modified from Brad Spengler/PaX Team's PAX_USERCOPY whitelisting code in the last public patch of grsecurity/PaX based on my understanding of the code. Changes or omissions from the original code are mine and don't reflect the original

[PATCH 14/38] ext2: Define usercopy region in ext2_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The ext2 symlink pathnames, stored in struct ext2_inode_info.i_data and therefore contained in the ext2_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ext2/super.c: ext2_alloc_inode(...): struct ext2_inode_info

[PATCH 13/38] ext4: Define usercopy region in ext4_inode_cache slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The ext4 symlink pathnames, stored in struct ext4_inode_info.i_data and therefore contained in the ext4_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ext4/super.c: ext4_alloc_inode(...): struct ext4_inode_info

[PATCH 15/38] jfs: Define usercopy region in jfs_ip slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The jfs symlink pathnames, stored in struct jfs_inode_info.i_inline and therefore contained in the jfs_ip slab cache, need to be copied to/from userspace. cache object allocation: fs/jfs/super.c: jfs_alloc_inode(...): ... jfs_inode = kmem_c

[PATCH 34/38] arm: Implement thread_struct whitelist for hardened usercopy

2018-01-10 Thread Kees Cook
ARM does not carry FPU state in the thread structure, so it can declare no usercopy whitelist at all. Cc: Russell King Cc: Ingo Molnar Cc: Christian Borntraeger Cc: "Peter Zijlstra (Intel)" Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/Kconfig

[PATCH 12/38] vfs: Copy struct mount.mnt_id to userspace using put_user()

2018-01-10 Thread Kees Cook
From: David Windsor The mnt_id field can be copied with put_user(), so there is no need to use copy_to_user(). In both cases, hardened usercopy is being bypassed since the size is constant, and not open to runtime manipulation. This patch is verbatim from Brad Spengler/PaX Team's PAX_USERCOPY wh

[PATCH 24/38] ip: Define usercopy region in IP proto slab cache

2018-01-10 Thread Kees Cook
From: David Windsor The ICMP filters for IPv4 and IPv6 raw sockets need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. example usage trace: net/ipv4/raw.c: r

[PATCH 11/38] vfs: Define usercopy region in names_cache slab caches

2018-01-10 Thread Kees Cook
From: David Windsor VFS pathnames are stored in the names_cache slab cache, either inline or across an entire allocation entry (when approaching PATH_MAX). These are copied to/from userspace, so they must be entirely whitelisted. cache object allocation: include/linux/fs.h: #define _

Re: linux-next: build failure after merge of the net-next tree

2018-01-10 Thread Alexei Starovoitov
On Thu, Jan 11, 2018 at 11:53:55AM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the net-next tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > kernel/bpf/verifier.o: In function `bpf_check': > verifier.c:(.text+0xd86e): undefined reference to `bpf_patch_ca

[PATCH net] ibmvnic: Fix pending MAC address changes

2018-01-10 Thread Thomas Falcon
Due to architecture limitations, the IBM VNIC client driver is unable to perform MAC address changes unless the device has "logged in" to its backing device. Currently, pending MAC changes are handled before login, resulting in an error and failure to change the MAC address. Moving that chunk to th

Re: [bpf-next PATCH v2 3/7] bpf: sockmap sample, use fork() for send and recv

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 07:39 PM, John Fastabend wrote: > Currently for SENDMSG tests first send completes then recv runs. This > does not work well for large data sizes and/or many iterations. So > fork the recv and send handler so that we run both send and recv. In > the future we can add a parameter to do

Re: [bpf-next PATCH v2 2/7] bpf: add sendmsg option for testing BPF programs

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 07:39 PM, John Fastabend wrote: > When testing BPF programs using sockmap I often want to have more > control over how sendmsg is exercised. This becomes even more useful > as new sockmap program types are added. > > This adds a test type option to select type of test to run. Current

Re: [bpf-next PATCH v2 1/7] bpf: refactor sockmap sample program update for arg parsing

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 07:39 PM, John Fastabend wrote: > sockmap sample program takes arguments from cmd line but it reads them > in using offsets into the array. Because we want to add more arguments > in the future lets do proper argument handling. > > Also refactor code to pull apart sock init and ping/

linux-next: build failure after merge of the net-next tree

2018-01-10 Thread Stephen Rothwell
Hi all, After merging the net-next tree, today's linux-next build (x86_64 allmodconfig) failed like this: kernel/bpf/verifier.o: In function `bpf_check': verifier.c:(.text+0xd86e): undefined reference to `bpf_patch_call_args' Caused by commit 1ea47e01ad6e ("bpf: add support for bpf_call to in

[PATCH bpf-next v4 5/5] error-injection: Support fault injection framework

2018-01-10 Thread Masami Hiramatsu
Support in-kernel fault-injection framework via debugfs. This allows you to inject a conditional error to specified function using debugfs interfaces. Here is the result of test script described in Documentation/fault-injection/fault-injection.txt === # ./test_fail_function.sh 1+0 r

[PATCH bpf-next v4 4/5] error-injection: Add injectable error types

2018-01-10 Thread Masami Hiramatsu
Add injectable error types for each error-injectable function. One motivation of error injection test is to find software flaws, mistakes or mis-handlings of expectable errors. If we find such flaws by the test, that is a program bug, so we need to fix it. But if the tester miss input the error (

[PATCH bpf-next v4 3/5] error-injection: Separate error-injection from kprobe

2018-01-10 Thread Masami Hiramatsu
Since error-injection framework is not limited to be used by kprobes, nor bpf. Other kernel subsystems can use it freely for checking safeness of error-injection, e.g. livepatch, ftrace etc. So this separate error-injection framework from kprobes. Some differences has been made: - "kprobe" word i

[PATCH bpf-next v4 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-10 Thread Masami Hiramatsu
Check whether error injectable event is on function entry or not. Currently it checks the event is ftrace-based kprobes or not, but that is wrong. It should check if the event is on the entry of target function. Since error injection will override a function to just return with modified return valu

[PATCH bpf-next v4 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-10 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- ke

[PATCH bpf-next v4 0/5] Separate error injection table from kprobes

2018-01-10 Thread Masami Hiramatsu
Hi, Here are the 4th version of patches to moving error injection table from kprobes. This series changes error-injection.h including points for ALLOW_ERROR_INJECTION macro and add Reviewed-by from Josef Bacik (except [3/5]). Here is the previous version: https://patchwork.ozlabs.org/cover/85817

Re: [PATCH] net/9p: trans_xen: add missing MODULE_AUTHOR/DESCRIPTION/LICENSE

2018-01-10 Thread Stephen Hemminger
On Sun, 19 Nov 2017 22:28:29 -0800 Jesse Chan wrote: > Signed-off-by: Jesse Chan > --- > net/9p/trans_xen.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c > index 6ad3e043c617..90402e744fbf 100644 > --- a/net/9p/trans_xen.c > +++ b/net/9p/t

Re: [PATCH] net/9p: trans_xen: add missing MODULE_AUTHOR/DESCRIPTION/LICENSE

2018-01-10 Thread Stephen Hemminger
On Wed, 10 Jan 2018 17:37:47 +0100 Arnd Bergmann wrote: > From: Jesse Chan > > This change resolves a new compile-time warning > when built as a loadable module: > > WARNING: modpost: missing MODULE_LICENSE() in net/9p/9pnet_xen.o > see include/linux/module.h for more information > > This add

Re: [bpf-next PATCH] samples/bpf: xdp2skb_meta shows transferring info from XDP to SKB

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 06:21 PM, Jesper Dangaard Brouer wrote: > Creating a bpf sample that shows howto use the XDP 'data_meta' > infrastructure, created by Daniel Borkmann. Very few drivers support > this feature, but I wanted a functional sample to begin with, when > working on adding driver support. >

Re: sctp: memory leak in sctp_endpoint_init

2018-01-10 Thread Cong Wang
On Tue, Jan 9, 2018 at 9:44 AM, 'Dmitry Vyukov' via syzkaller wrote: > Hello, > > syzkaller has hit the following memory leak on 4.15-rc7. > Reproducer is attached. > > unferenced object 0x88007bbaa720 (size 32): > comm "syz-executor4", pid 12479, jiffies 4295951917 (age 9.779s) > hex dump

[git pull] regression fix

2018-01-10 Thread Al Viro
Fix a regression in "make sock_alloc_file() do sock_release() on failures" The following changes since commit 040ee69226f8a96b7943645d68f41d5d44b5ff7d: fix "netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'" (2018-01-05 11:43:39 -0500) are available in the git rep

Re: aio poll, io_pgetevents and a new in-kernel poll API V2

2018-01-10 Thread Jeff Moyer
"Michael Kerrisk (man-pages)" writes: Hi, Michael, > Are there some man pages patches already for these changes? https://patchwork.kernel.org/patch/10144129/ Cheers, Jeff

Re: [PATCH 30/32] aio: add delayed cancel support

2018-01-10 Thread Jeff Moyer
Jeff Moyer writes: > Christoph Hellwig writes: > >> The upcoming aio poll support would like to be able to complete the >> iocb inline from the cancellation context, but that would cause >> a lock order reversal. Add support for optionally moving the cancelation >> outside the context lock to a

Re: [PATCH net-next v2] xfrm: Add ESN support for IPSec HW offload

2018-01-10 Thread Yossi Kuperman
> On 10 Jan 2018, at 19:36, Shannon Nelson wrote: > >> On 1/10/2018 2:34 AM, yoss...@mellanox.com wrote: >> From: Yossef Efraim >> This patch adds ESN support to IPsec device offload. >> Adding new xfrm device operation to synchronize device ESN. >> Signed-off-by: Yossef Efraim >> --- >> Chan

Re: [PATCH 30/32] aio: add delayed cancel support

2018-01-10 Thread Jeff Moyer
Christoph Hellwig writes: > The upcoming aio poll support would like to be able to complete the > iocb inline from the cancellation context, but that would cause > a lock order reversal. Add support for optionally moving the cancelation > outside the context lock to avoid this reversal. > > Sign

Re: [PATCH bpf] bpf, array: fix overflow in max_entries and undefined behavior in index_mask

2018-01-10 Thread Alexei Starovoitov
On Wed, Jan 10, 2018 at 11:25:05PM +0100, Daniel Borkmann wrote: > syzkaller tried to alloc a map with 0xfffd entries out of a userns, > and thus unprivileged. With the recently added logic in b2157399cc98 > ("bpf: prevent out-of-bounds speculation") we round this up to the next > power of two

Re: [PATCH bpf] bpf: arsh is not supported in 32 bit alu thus reject it

2018-01-10 Thread Alexei Starovoitov
On Wed, Jan 10, 2018 at 08:04:37PM +0100, Daniel Borkmann wrote: > The following snippet was throwing an 'unknown opcode cc' warning > in BPF interpreter: > > 0: (18) r0 = 0x0 > 2: (7b) *(u64 *)(r10 -16) = r0 > 3: (cc) (u32) r0 s>>= (u32) r0 > 4: (95) exit > > Although a number of JITs do

Re: [PATCH][bpf-next] bpf: fix spelling mistake: "obusing" -> "abusing"

2018-01-10 Thread Alexei Starovoitov
On Wed, Jan 10, 2018 at 11:39:14AM +0100, Daniel Borkmann wrote: > On 01/10/2018 10:20 AM, Colin King wrote: > > From: Colin Ian King > > > > Trivial fix to spelling mistake in error message text. > > > > Signed-off-by: Colin Ian King > > --- > > kernel/bpf/verifier.c | 2 +- > > 1 file change

Re: [PATCH 29/32] aio: delete iocbs from the active_reqs list in kiocb_cancel

2018-01-10 Thread Jeff Moyer
Christoph Hellwig writes: > One we cancel an iocb there is no reason to keep it on the active_reqs > list, given that the list is only used to look for cancelation candidates. > > Signed-off-by: Christoph Hellwig Acked-by: Jeff Moyer

Re: [PATCH 28/32] aio: simplify cancellation

2018-01-10 Thread Jeff Moyer
Christoph Hellwig writes: > With the current aio code there is no need for the magic KIOCB_CANCELLED > value, as a cancelation just kicks the driver to queue the completion > ASAP, with all actual completion handling done in another thread. Given > that both the completion path and cancelation ta

Re: aio poll, io_pgetevents and a new in-kernel poll API V2

2018-01-10 Thread Michael Kerrisk (man-pages)
Hi Christoph, On 01/10/2018 04:58 PM, Christoph Hellwig wrote: > Hi all, > > this series adds support for the IOCB_CMD_POLL operation to poll for the > readyness of file descriptors using the aio subsystem. The API is based > on patches that existed in RHAS2.1 and RHEL3, which means it already i

Re: [PATCH bpf] bpf: prevent out-of-bounds speculation

2018-01-10 Thread Alexei Starovoitov
On 1/10/18 11:47 AM, Will Deacon wrote: Hi again Linus, Alexei, I can happily confirm that there aren't any (ARM architecture) CPUs where the masking approach is not sufficient, so there's no need to worry about value speculation breaking this. Awesome! Thank you for confirming.

Re: [PATCH bpf-next v3 3/5] error-injection: Separate error-injection from kprobe

2018-01-10 Thread Masami Hiramatsu
On Wed, 10 Jan 2018 10:36:15 -0500 Josef Bacik wrote: > On Wed, Jan 10, 2018 at 07:18:05PM +0900, Masami Hiramatsu wrote: > > Since error-injection framework is not limited to be used > > by kprobes, nor bpf. Other kernel subsystems can use it > > freely for checking safeness of error-injection,

Re: [PATCH net] ipv6: Fix cleanup ordering on inet6_init() error path

2018-01-10 Thread Cong Wang
On Tue, Jan 9, 2018 at 10:21 AM, Ben Hutchings wrote: > Commit 15e668070a64 reordered the initialisation in inet6_init() to > fix a crash on an error path further down the call stack. It also > reordered cleanup on the error path in inet6_init(), but the result > is not the reverse of the initial

[PATCH bpf] bpf, array: fix overflow in max_entries and undefined behavior in index_mask

2018-01-10 Thread Daniel Borkmann
syzkaller tried to alloc a map with 0xfffd entries out of a userns, and thus unprivileged. With the recently added logic in b2157399cc98 ("bpf: prevent out-of-bounds speculation") we round this up to the next power of two value for max_entries for unprivileged such that we can apply proper mask

[GIT] Networking

2018-01-10 Thread David Miller
1) BPF speculation prevention and BPF_JIT_ALWAYS_ON, from Alexei Starovoitov. 2) Revert dev_get_random_name() changes as adjust the error code returns seen by userspace definitely breaks stuff. 3) Fix TX DMA map/unmap on older iwlwifi devices, from Emmanuel Grumbach. 4) From wrong AF f

Re: [PATCH net-next 0/3] sfc: support 25G configuration with ethtool

2018-01-10 Thread David Miller
From: Edward Cree Date: Wed, 10 Jan 2018 17:58:10 + > Adds support for advertise bits beyond the 32-bit legacy masks, and plumbs in > translation of the new 25/50/100G bits to/from MCDI. Series applied, thank you.

Re: [PATCHv2 net-next 2/2] openvswitch: add erspan version II support

2018-01-10 Thread Jiri Benc
On Wed, 10 Jan 2018 22:35:14 +0100, Jiri Benc wrote: > The existing field must continue to work in the same way as before. It must > be accepted and *returned* by the kernel. You may add an additional field > but the existing behavior must be 100% preserved, both uABI and uAPI wise. Another way ar

Re: [PATCH net-next 2/2 v10] net: ethernet: Add a driver for Gemini gigabit ethernet

2018-01-10 Thread Linus Walleij
On Wed, Jan 10, 2018 at 9:43 PM, David Miller wrote: > Actually I had to revert these two patches, this stuff doesn't even > build. Sorry about that, I did build it before sending out but I guess not on enough architectures :( I will iterate with the help of the zeroday build servers, my own ma

Re: [PATCHv2 net-next 2/2] openvswitch: add erspan version II support

2018-01-10 Thread Jiri Benc
On Tue, 9 Jan 2018 17:51:22 -0800, William Tu wrote: > - [OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS] = { .len = sizeof(u32) }, > + [OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTSV1] = { .len = sizeof(u32) }, > + [OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS] = { .len = OVS_ATTR_NESTED, > +

Re: [PATCH 27/32] aio: sanitize ki_list handling

2018-01-10 Thread Jeff Moyer
Christoph Hellwig writes: > Instead of handcoded non-null checks always initialize ki_list to an > empty list and use list_empty / list_empty_careful on it. Yeah, who knows why list_empty wasn't used from the beginning. In the past, tricks were played by overwriting list pointers with non-null,

Re: [PATCHv2 net-next 2/2] openvswitch: add erspan version II support

2018-01-10 Thread Jiri Benc
On Tue, 9 Jan 2018 17:51:22 -0800, William Tu wrote: > --- a/include/uapi/linux/openvswitch.h > +++ b/include/uapi/linux/openvswitch.h > @@ -363,7 +373,8 @@ enum ovs_tunnel_key_attr { > OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 > address. */ > OVS_TUNNEL_KEY_

Re: [PATCH 26/32] aio: refactor read/write iocb setup

2018-01-10 Thread Jeff Moyer
Christoph Hellwig writes: > Don't reference the kiocb structure from the common aio code, and move > any use of it into helper specific to the read/write path. This is in > preparation for aio_poll support that wants to use the space for different > fields. > > Signed-off-by: Christoph Hellwig

Re: [PATCH 02/36] usercopy: Include offset in overflow report

2018-01-10 Thread Kees Cook
On Wed, Jan 10, 2018 at 7:25 AM, Christopher Lameter wrote: > On Tue, 9 Jan 2018, Kees Cook wrote: > >> -static void report_usercopy(unsigned long len, bool to_user, const char >> *type) >> +int report_usercopy(const char *name, const char *detail, bool to_user, >> + unsigned long

Re: [PATCH] net/9p: trans_xen: add missing MODULE_AUTHOR/DESCRIPTION/LICENSE

2018-01-10 Thread Arnd Bergmann
On Wed, Jan 10, 2018 at 6:27 PM, Akemi Yagi wrote: > On Wed, 10 Jan 2018 17:37:47 +0100, Arnd Bergmann wrote: >> >> MODULE_DESCRIPTION and MODULE_AUTHOR are also added. >> >> Signed-off-by: Jesse Chan >> Signed-off-by: Arnd Bergmann >> --- >> net/9p/trans_xen.c | 4 >> 1 file changed, 4 in

Re: [patch net-next 00/11] mlxsw qdisc refactoring

2018-01-10 Thread David Miller
From: Jiri Pirko Date: Wed, 10 Jan 2018 14:59:56 +0100 > From: Jiri Pirko > > This patchset refactors the qdisc handling in mlxsw driver in order to make > it more object oriented like. > It helps readability, laying the groundwork for the offloading of > additional qdiscs by the driver > This

Re: [patch net-next] mlxsw: spectrum: Fix typo in firmware upgrade message

2018-01-10 Thread David Miller
From: Jiri Pirko Date: Wed, 10 Jan 2018 14:56:54 +0100 > From: Ido Schimmel > > Signed-off-by: Ido Schimmel > Signed-off-by: Jiri Pirko Applied.

Re: [PATCH 04/36] usercopy: Prepare for usercopy whitelisting

2018-01-10 Thread Kees Cook
On Wed, Jan 10, 2018 at 10:28 AM, Christopher Lameter wrote: > On Tue, 9 Jan 2018, Kees Cook wrote: > >> +struct kmem_cache *kmem_cache_create_usercopy(const char *name, >> + size_t size, size_t align, slab_flags_t flags, >> + size_t useroffset, size_t users

  1   2   3   4   >