RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 14 December 2016 22:03 > On 14.12.2016 13:46, Jason A. Donenfeld wrote: > > Hi David, > > > > On Wed, Dec 14, 2016 at 10:56 AM, David Laight <david.lai...@aculab.com> > > wrote: > >> ... > >>> +u64

RE: [PATCH v3 1/3] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Linus Torvalds > Sent: 15 December 2016 00:11 > On Wed, Dec 14, 2016 at 3:34 PM, Jason A. Donenfeld wrote: > > > > Or does your reasonable dislike of "word" still allow for the use of > > dword and qword, so that the current function names of: > > dword really is confusing

RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 15 December 2016 12:23 ... > Hmm? Even the Intel ABI expects alignment of unsigned long long to be 8 > bytes on 32 bit. Do you question that? Yes. The linux ABI for x86 (32 bit) only requires 32bit alignment for u64 (etc). David

RE: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-16 Thread David Laight
From: George Spelvin > Sent: 15 December 2016 23:29 > > If a halved version of SipHash can bring significant performance boost > > (with 32b words instead of 64b words) with an acceptable security level > > (64-bit enough?) then we may design such a version. > > I was thinking if the key could be

RE: Misalignment, MIPS, and ip_hdr(skb)->version

2016-12-12 Thread David Laight
From: Måns Rullgård > Sent: 10 December 2016 13:25 ... > I solved this problem in an Ethernet driver by copying the initial part > of the packet to an aligned skb and appending the remainder using > skb_add_rx_frag(). The kernel network stack only cares about the > headers, so the alignment of

RE: [PATCH v2 8/8] crypto/testmgr: Allocate only the required output size for hash tests

2017-01-11 Thread David Laight
From: Andy Lutomirski > Sent: 10 January 2017 23:25 > There are some hashes (e.g. sha224) that have some internal trickery > to make sure that only the correct number of output bytes are > generated. If something goes wrong, they could potentially overrun > the output buffer. > > Make the test

RE: Problem on SCTP

2017-01-12 Thread David Laight
From: Sun Paul [mailto:paul...@gmail.com] > Sent: 12 January 2017 09:31 > Let me clear the understanding. below is the flow. > > 1. Client sends to Linux Router: 192.168.206.83 -> 192.168.206.56, > 2. Linux router sends to SERVER where the source IP is unchanged: > 192.168.206.83 ->

RE: [PATCH net-next v2 05/10] drivers: base: Add device_find_class()

2017-01-13 Thread David Laight
From: Florian Fainelli > Sent: 12 January 2017 22:51 > On 01/12/2017 01:21 PM, David Miller wrote: > > From: Florian Fainelli > > Date: Wed, 11 Jan 2017 19:41:16 -0800 > > > >> Add a helper function to lookup a device reference given a class name. > >> This is a preliminary

RE: [PATCH] usb: gadget: udc: atmel: used managed kasprintf

2016-12-05 Thread David Laight
From: Alexandre Belloni > Sent: 02 December 2016 16:19 > On 02/12/2016 at 15:59:57 +, David Laight wrote : > > From: Alexandre Belloni > > > Sent: 01 December 2016 10:27 > > > Use devm_kasprintf instead of simple kasprintf to free the allocated > > > m

RE: [PATCH] usb: gadget: udc: atmel: used managed kasprintf

2016-12-02 Thread David Laight
From: Alexandre Belloni > Sent: 01 December 2016 10:27 > Use devm_kasprintf instead of simple kasprintf to free the allocated memory > when needed. s/when needed/when the device is freed/ > Suggested-by: Peter Rosin > Signed-off-by: Alexandre Belloni

RE: [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode

2017-01-04 Thread David Laight
From: Harisangam, Sharvari (S.) > Sent: 28 December 2016 11:07 > Corrected the condition to check if ssi is configured for AC97 > mode. Other modes like dsp_a also satisfy the ANDing condition. Under the assumption that the constants have 1 bit set nothing is wrong. David ... > -

RE: [RFC 1/4] mm: remove unused TASK_SIZE_OF()

2017-01-05 Thread David Laight
From: Dmitry Safonov > Sent: 30 December 2016 15:57 > All users of TASK_SIZE_OF(tsk) have migrated to mm->task_size or > TASK_SIZE_MAX since: > commit d696ca016d57 ("x86/fsgsbase/64: Use TASK_SIZE_MAX for > FSBASE/GSBASE upper limits"), > commit a06db751c321 ("pagemap: check permissions and

RE: Problem on SCTP

2017-01-09 Thread David Laight
From: Sun Paul > Sent: 09 January 2017 02:08 > >> I am setting up a lab where the SCTP traffics from client is passing > >> through a linux router before reaching to the SCTP server running > >> LKSCTP. > >> > >> The linux router did not change the source address of the client, so > >> when it

RE: [RFC PATCH] intel: Use upper_32_bits and lower_32_bits

2017-01-09 Thread David Laight
From: Joe Perches > Sent: 07 January 2017 18:33 > Shifting and masking various types can be made a bit > simpler to read by using the available kernel macros. ... > - ew32(TDBAH, (tdba >> 32)); > - ew32(TDBAL, (tdba & 0xULL)); > + ew32(TDBAH,

RE: [PATCH v2 net-next 3/4] secure_seq: use SipHash in place of MD5

2017-01-09 Thread David Laight
From: Eric Biggers > Sent: 07 January 2017 22:09 .. > Out of curiosity, is this actually a solvable problem, e.g. by making the code > using the XMM registers responsible for saving and restoring the ones > clobbered, > or by optimizing kernel_fpu_begin()/kernel_fpu_end()? Or does it in fact >

RE: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-19 Thread David Laight
From: George Spelvin > Sent: 17 December 2016 15:21 ... > uint32_t > hsiphash24(char const *in, size_t len, uint32_t const key[2]) > { > uint32_t c = key[0]; > uint32_t d = key[1]; > uint32_t a = 0x6c796765 ^ 0x736f6d65; > uint32_t b = d ^ 0x74656462 ^ 0x646f7261; I've

RE: [PATCH v5 3/4] secure_seq: use SipHash in place of MD5

2016-12-16 Thread David Laight
From: Jason A. Donenfeld > Sent: 15 December 2016 20:30 > This gives a clear speed and security improvement. Siphash is both > faster and is more solid crypto than the aging MD5. > > Rather than manually filling MD5 buffers, for IPv6, we simply create > a layout by a simple anonymous struct, for

RE: [PATCH v5 2/4] siphash: add Nu{32,64} helpers

2016-12-16 Thread David Laight
From: Jason A. Donenfeld > Sent: 15 December 2016 20:30 > These restore parity with the jhash interface by providing high > performance helpers for common input sizes. ... > +#define PREAMBLE(len) \ > + u64 v0 = 0x736f6d6570736575ULL; \ > + u64 v1 = 0x646f72616e646f6dULL; \ > + u64 v2

RE: [PATCH 06/16] drivers, net, mlx5: convert mlx5_cq.refcount from atomic_t to refcount_t

2017-03-28 Thread David Laight
From: Elena Reshetova > Sent: 28 March 2017 09:57 > > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. I can't help

RE: [PATCH] net: netfilter: Remove multiple assignment.

2017-03-27 Thread David Laight
From: Pablo Neira Ayuso > Sent: 27 March 2017 13:08 > On Sat, Mar 25, 2017 at 06:19:47PM +0530, Arushi Singhal wrote: > > This patch removes multiple assignments. > > Done using coccinelle. > > @@ > > identifier i1,i2; > > constant c; > > @@ > > - i1=i2=c; > > + i1=c; > > + i2=c; > > You have to

RE: [PATCH] netfilter: ipset: Use max macro instead of ternary operator

2017-03-28 Thread David Laight
From: simran singhal > Sent: 28 March 2017 14:33 > This patch replaces ternary operator with macro max as it shorter and > thus increases code readability. Macro max return the maximum of the two > compared values. ... > /* Convert error codes to nomatch */ > - return (ret < 0 ? 0 :

RE: [PATCH v3 2/2] PCI: Add tango PCIe host bridge support

2017-03-29 Thread David Laight
> > For my education, what is the API to send an IPI? > > And the API to handle an IPI? > > There are a few ways you could implement some custom cross-call, > although in this case I think stop_machine() would probably be the most > appropriate candidate. However, you're right that in general it

RE: [PATCH net-next] r8152: simply the arguments

2017-03-16 Thread David Laight
From: Hayes Wang > Sent: 16 March 2017 06:28 > Replace >napi with napi and tp->netdev with netdev. > > Signed-off-by: Hayes Wang > --- > drivers/net/usb/r8152.c | 44 +++- > 1 file changed, 27 insertions(+), 17 deletions(-) > >

RE: [PATCH v2 net-next 4/5] sunvnet: count multicast packets

2017-03-15 Thread David Laight
From: Shannon Nelson > Sent: 14 March 2017 17:25 ... > + if (unlikely(is_multicast_ether_addr(eth_hdr(skb)->h_dest))) > + dev->stats.multicast++; I'd guess that: dev->stats.multicast += is_multicast_ether_addr(eth_hdr(skb)->h_dest); generates faster code. Especially if

RE: [PATCH v2 net-next 4/5] sunvnet: count multicast packets

2017-03-16 Thread David Laight
From: Shannon Nelson > Sent: 16 March 2017 00:18 > To: David Laight; net...@vger.kernel.org; da...@davemloft.net > On 3/15/2017 1:50 AM, David Laight wrote: > > From: Shannon Nelson > >> Sent: 14 March 2017 17:25 > > ... > >> + if (unlikely(is_mu

RE: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t

2017-03-20 Thread David Laight
From: Herbert Xu > Sent: 20 March 2017 13:16 > On Mon, Mar 20, 2017 at 11:39:37AM +0100, Peter Zijlstra wrote: > > > > Can we at least give a benchmark and have someone run numbers? We should > > be able to quantify these things. > > Do you realise how many times this thing gets hit at 10Gb/s or

RE: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t

2017-03-20 Thread David Laight
From: Peter Zijlstra > Sent: 20 March 2017 14:28 > On Mon, Mar 20, 2017 at 02:10:24PM +, David Laight wrote: > > On x86 the cpu flags from the 'lock inc/dec' could be used to reasonably > > cheaply detect errors - provided you actually generate a forwards branch. >

RE: [PATCH net-next] r8152: simply the arguments

2017-03-17 Thread David Laight
From: Hayes Wang > Sent: 17 March 2017 03:00 > To: David Laight; net...@vger.kernel.org > Cc: nic_swsd; linux-kernel@vger.kernel.org; linux-...@vger.kernel.org > Subject: RE: [PATCH net-next] r8152: simply the arguments > > David Laight [mailto:david.lai...@aculab.com] > &g

RE: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-10 Thread David Laight
From: Matthias Kaehlcke > Sent: 06 April 2017 19:57 > Clang raises a warning about the expression 'strlen(CONFIG_XXX)' being > used in a logical operation. Clangs' builtin strlen function resolves the > expression to a constant at compile time, which causes clang to generate > a

RE: [PATCH] powerpc/32: Move entry_32 functions just after HEAD functions.

2017-04-19 Thread David Laight
From: Christophe Leroy > By default, PPC8xx PINs an ITLB on the first 8M of memory in order > to avoid any ITLB miss on kernel code. > However, with some debug functions like DEBUG_PAGEALLOC and > (soon to come) DEBUG_RODATA, the PINned TLB is invalidated soon > after startup so ITLB missed start

RE: [PATCH v3 4/7] powerpc: kprobes: use safer string functions in kprobe_lookup_name()

2017-04-21 Thread David Laight
From: Naveen N. Rao > Sent: 19 April 2017 13:51 ... > dot_name[0] = '\0'; > - strncat(dot_name, name, sizeof(dot_name) - 1); > + strlcat(dot_name, name, sizeof(dot_name)); ... Is that really zeroing the first byte just so it can append

RE: [PATCH 16/22] xen-blkfront: Make use of the new sg_map helper function

2017-04-18 Thread David Laight
From: Logan Gunthorpe > Sent: 13 April 2017 23:05 > Straightforward conversion to the new helper, except due to > the lack of error path, we have to warn if unmapable memory > is ever present in the sgl. > > Signed-off-by: Logan Gunthorpe > --- >

RE: [PATCH v2 1/5] kprobes: convert kprobe_lookup_name() to a function

2017-04-18 Thread David Laight
From: Naveen N. Rao > Sent: 12 April 2017 11:58 ... > +kprobe_opcode_t *kprobe_lookup_name(const char *name) > +{ ... > + char dot_name[MODULE_NAME_LEN + 1 + KSYM_NAME_LEN]; > + const char *modsym; > + bool dot_appended = false; > + if ((modsym = strchr(name, ':')) != NULL) { > +

RE: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation

2017-03-03 Thread David Laight
From: Andrey Ryabinin > Sent: 03 March 2017 13:50 ... > noinline_iff_kasan might be a better name. noinline_for_kasan gives the > impression > that we always noinline function for the sake of kasan, while > noinline_iff_kasan > clearly indicates that function is noinline only if kasan is used.

RE: [PATCH net-next 09/12] net: bcmgenet: return EOPNOTSUPP for unknown ioctl commands

2017-03-14 Thread David Laight
From: Doug Berger > Sent: 14 March 2017 00:42 > This commit changes the ioctl handling behavior to return the > EOPNOTSUPP error code instead of the EINVAL error code when an > unknown ioctl command value is detected. > > It also removes some redundant parsing of the ioctl command value > and

RE: [PATCH v2 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

2017-03-06 Thread David Laight
From: Peter Zijlstra > Sent: 06 March 2017 11:22 > To: Madhavan Srinivasan > Cc: Wang Nan; Alexander Shishkin; linux-kernel@vger.kernel.org; Arnaldo > Carvalho de Melo; Alexei > Starovoitov; Ingo Molnar; Stephane Eranian; Sukadev Bhattiprolu; > linuxppc-...@lists.ozlabs.org > Subject: Re: [PATCH

RE: [PATCH v2 1/5] kprobes: convert kprobe_lookup_name() to a function

2017-04-19 Thread David Laight
From: Naveen N. Rao > Sent: 19 April 2017 09:09 > To: David Laight; Michael Ellerman > Cc: linux-kernel@vger.kernel.org; linuxppc-...@lists.ozlabs.org; Masami > Hiramatsu; Ingo Molnar > Subject: RE: [PATCH v2 1/5] kprobes: convert kprobe_lookup_name() to a > function >

RE: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

2017-04-24 Thread David Laight
From: Shuah Khan > Sent: 22 April 2017 00:15 > Define CLEAN macro to allow Makefiles to override common clean target > in lib.mk. This will help fix the following failures: > > warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > >

RE: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

2017-04-24 Thread David Laight
From: Linuxppc-dev Michael Ellerman > Shuah Khan writes: > > > Add override for lib.mk clean to fix the following warnings from clean > > target run. > > > > Makefile:44: warning: overriding recipe for target 'clean' > > ../lib.mk:55: warning: ignoring old recipe for

RE: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-31 Thread David Laight
From: Florian Fainelli > Sent: 28 July 2017 18:05 ... > +EXPORT_SYMBOL(lan9303_indirect_phy_ops); > >>> > >>> Isn't EXPORT_SYMBOL_GPL prefered over EXPORT_SYMBOL? > >> > >> I have no opinion. I just used the same variant as the other EXPORTS > >> in the file. > > > > If there is no concern

RE: [PATCH 1/5] Fix packed and aligned attribute warnings.

2017-07-31 Thread David Laight
From: SZ Lin > Sent: 29 July 2017 08:24 ... > diff --git a/drivers/char/tpm/tpm_ibmvtpm.h b/drivers/char/tpm/tpm_ibmvtpm.h > index 91dfe766d080..9f708ca3dc84 100644 > --- a/drivers/char/tpm/tpm_ibmvtpm.h > +++ b/drivers/char/tpm/tpm_ibmvtpm.h > @@ -25,7 +25,7 @@ struct ibmvtpm_crq { > __be16

RE: [RESEND][PATCH V10 0/3] powernv : Add support for OPAL-OCC command/response interface

2017-08-01 Thread David Laight
From: Shilpasri G Bhat > Sent: 31 July 2017 08:43 > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL ^ typo > command buffer and OCC response buffer that can be used to send > inband commands to OCC. The

RE: [PATCH] netfilter: fix stringop-overflow warning with UBSAN

2017-08-01 Thread David Laight
From: Arnd Bergmann > Sent: 31 July 2017 11:09 > Using gcc-7 with UBSAN enabled, we get this false-positive warning: > > net/netfilter/ipset/ip_set_core.c: In function 'ip_set_sockfn_get': > net/netfilter/ipset/ip_set_core.c:1998:3: error: 'strncpy' writing 32 bytes > into a region of size 2 >

RE: [PATCH v2] iwlwifi: Demote messages about fw flags size to info

2017-08-03 Thread David Laight
From: João Paulo Rechi Vita > Sent: 03 August 2017 15:30 > These messages are not reporting a real error, just the fact that the > firmware knows about more flags then the driver. than > > Currently these messages are presented to the user during boot if there >

RE: [PATCH] New Chapter on CodingStyle .

2017-08-15 Thread David Laight
From: Stephen Hemminger > Sent: 15 August 2017 17:21 > On Tue, 15 Aug 2017 10:42:39 +0000 > David Laight <david.lai...@aculab.com> wrote: > > > From: Jonathan Corbet > > > Sent: 12 August 2017 15:55 > > ... > > > > + Chapt

RE: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table

2017-08-15 Thread David Laight
From: Benjamin Herrenschmidt > Sent: 15 August 2017 02:34 > On Tue, 2017-08-15 at 09:16 +0800, Jike Song wrote: > > > Taking a step back, though, why does vfio-pci perform this check in the > > > first place? If a malicious guest already has control of a device, any > > > kind of interrupt

RE: [PATCH] New Chapter on CodingStyle .

2017-08-15 Thread David Laight
From: Jonathan Corbet > Sent: 12 August 2017 15:55 ... > > + Chapter 20: Put values on initialisers without exception > > + > > +When declaring variables on functions must put values: > > Thanks for sending a patch for the kernel's documentation. > Unfortunately, I can't accept this

RE: [RFC PATCH 2/2] bpf: Initialise mod[] in bpf_trace_printk

2017-08-14 Thread David Laight
From: Daniel Borkmann > Sent: 11 August 2017 17:47 > On 08/09/2017 10:34 PM, Daniel Borkmann wrote: > > On 08/09/2017 09:39 AM, James Hogan wrote: > > [...] > >> time (but please consider looking at the other patch which is certainly > >> a more real issue). > > > > Sorry for the delay, started

RE: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table

2017-08-17 Thread David Laight
From: Alex Williamson > Sent: 16 August 2017 17:56 ... > Firmware pissing match... Processors running with 8k or less page size > fall within the recommendations of the PCI spec for register alignment > of MMIO regions of the device and this whole problem becomes less of an > issue. Actually if

RE: [PATCH 04/22] scsi: fusion: fix string overflow warning

2017-07-17 Thread David Laight
From: Arnd Bergmann > Sent: 14 July 2017 13:07 > gcc points out a theorerical string overflow: > > drivers/message/fusion/mptbase.c: In function 'mpt_detach': > drivers/message/fusion/mptbase.c:2103:17: error: '%s' directive writing up to > 31 bytes into a region > of size 28

RE: [PATCH] tty: Fix TIOCGPTPEER ioctl definition

2017-07-11 Thread David Laight
From: Linuxppc-dev Gleb Fotengauer-Malinovskiy > Sent: 11 July 2017 01:12 > This ioctl does nothing to justify an _IOC_READ or _IOC_WRITE flag > because it doesn't copy anything from/to userspace to access the > argument. > > Fixes: 54ebbfb1 ("tty: add TIOCGPTPEER ioctl") ... > -#define

RE: [PATCH 3/3] fpga manager: Add FT232H driver for Altera FPP

2017-07-07 Thread David Laight
From: Anatolij Gustschin > Sent: 06 July 2017 21:49 > > Add FPGA manager driver for loading Altera FPGAs via fast > passive parallel (FPP) interface using FTDI FT232H chip. I can't help feeling this is very specific for a particular card. While all(?) Altera (now Intel) FPGA support FPP

RE: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver

2017-07-25 Thread David Laight
From: Rustad, Mark D > Sent: 24 July 2017 21:32 > > On Jul 23, 2017, at 10:05 AM, Florian Fainelli wrote: > >> + > >> + strncpy(drvinfo->version, HNAE_DRIVER_VERSION, > >> + sizeof(drvinfo->version)); > >> + drvinfo->version[sizeof(drvinfo->version) - 1] = '\0'; >

RE: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active

2017-07-25 Thread David Laight
From: Brijesh Singh > Sent: 24 July 2017 20:08 > From: Tom Lendacky > > Secure Encrypted Virtualization (SEV) does not support string I/O, so > unroll the string I/O operation into a loop operating on one element at > a time. > > Signed-off-by: Tom Lendacky

RE: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active

2017-07-27 Thread David Laight
From: Brijesh Singh > Sent: 26 July 2017 21:07 ... > I am not sure if I understand your concern. > > Are you commenting on amount of code duplication ? If so, I can certainly > improve > and use the similar macro used into header file to generate the functions > body. If you are careful the

RE: [RFC Part1 PATCH v3 07/17] x86/mm: Include SEV for encryption memory attribute changes

2017-07-28 Thread David Laight
From: Borislav Petkov > Sent: 27 July 2017 15:59 > On Mon, Jul 24, 2017 at 02:07:47PM -0500, Brijesh Singh wrote: > > From: Tom Lendacky > > > > The current code checks only for sme_active() when determining whether > > to perform the encryption attribute change. Include

RE: [PATCH 3/4] powerpc: pseries: only store the device node basename in full_name

2017-07-26 Thread David Laight
From: Rob Herring > Sent: 25 July 2017 22:44 > With dependencies on full_name containing the entire device node path > removed, stop storing the full_name in nodes created by > dlpar_configure_connector() and pSeries_reconfig_add_node(). ... > dn = kzalloc(sizeof(*dn), GFP_KERNEL); >

RE: [PATCH 1/3] mfd: Add support for FTDI FT232H devices

2017-07-19 Thread David Laight
From: Anatolij Gustschin > Sent: 19 July 2017 14:30 ... > >Stupid question, I know, but I cannot help thinking: If you have an > >EEPROM then why the h... don't you use an application specific device > >ID? > > It would make sense for adapter devices that you can buy and plug. > In my particular

RE: [PATCH v2 0/9] Remove spin_unlock_wait()

2017-07-06 Thread David Laight
From: Paul E. McKenney > Sent: 06 July 2017 00:30 > There is no agreed-upon definition of spin_unlock_wait()'s semantics, > and it appears that all callers could do just as well with a lock/unlock > pair. This series therefore removes spin_unlock_wait() and changes > its users to instead use a

RE: [PATCH 4/8] usb: bdc: Small code cleanup

2017-06-29 Thread David Laight
From: Al Cooper > Sent: 28 June 2017 15:56 > On Wed, Jun 28, 2017 at 4:47 AM, David Laight <david.lai...@aculab.com> wrote: > >> > >> temp = bdc_readl(bdc->regs, BDC_BDCSC); > >> if ((temp & BDC_P64) && > >>

RE: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow

2017-04-27 Thread David Laight
From: Jason A. Donenfeld > On Thu, Apr 27, 2017 at 1:30 PM, Sabrina Dubroca wrote: > > Hmm, I think this can actually happen: > > Alright, perhaps better to err on the side of caution, then. You only need to recurse if both pointers are set. David

RE: [PATCH] macsec: avoid heap overflow in skb_to_sgvec

2017-04-24 Thread David Laight
From: Jason A. Donenfeld > Sent: 21 April 2017 22:15 > While this may appear as a humdrum one line change, it's actually quite > important. An sk_buff stores data in three places: > > 1. A linear chunk of allocated memory in skb->data. This is the easiest >one to work with, but it precludes

RE: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-25 Thread David Laight
From: Naveen N. Rao > Sent: 25 April 2017 17:18 > 1. Fail early for invalid/zero length symbols. > 2. Detect names of the form and skip checking for kernel > symbols in that case. > > Signed-off-by: Naveen N. Rao > --- > Masami, Michael, > I have added two very

RE: [PATCH] iov_iter: don't revert if csum error

2017-04-28 Thread David Laight
From: Sabrina Dubroca > Sent: 28 April 2017 14:17 ... > > if (__skb_checksum_complete(skb)) > > - goto csum_error; > > + goto fault; > > With this patch, skb_copy_and_csum_datagram_msg() will return -EFAULT > for an incorrect checksum, that doesn't

RE: [PATCH net] tcp: avoid bogus gcc-7 array-bounds warning

2017-07-28 Thread David Laight
From: Arnd Bergmann > Sent: 28 July 2017 15:42 ... > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -2202,9 +2202,10 @@ static bool tcp_small_queue_check(struct sock *sk, > const struct sk_buff *skb, > static void tcp_chrono_set(struct tcp_sock *tp, const enum tcp_chrono new) >

RE: [PATCH] Adding Agile-SD TCP module and modifying Kconfig and Makefile

2017-08-02 Thread David Laight
From: mohamedalrshah > Sent: 02 August 2017 05:44 > Published: > Alrshah, M.A., Othman, M., Ali, B. and Hanapi, Z.M., 2015. Agile-SD: a > Linux-based > TCP congestion control algorithm for supporting high-speed and short-distance > networks. > Journal of Network and Computer Applications, 55,

RE: [v6 11/15] arm64/kasan: explicitly zero kasan shadow memory

2017-08-08 Thread David Laight
From: Pasha Tatashin > Sent: 08 August 2017 12:49 > Thank you for looking at this change. What you described was in my > previous iterations of this project. > > See for example here: https://lkml.org/lkml/2017/5/5/369 > > I was asked to remove that flag, and only zero memory in place when >

RE: [PATCH v7 2/3] PCI: Enable PCIe Relaxed Ordering if supported

2017-08-07 Thread David Laight
From: Casey Leedom > Sent: 04 August 2017 21:49 ... > Whenever our Hardware Designers implement new functionality in our hardware, > they almost always put in A. several "knobs" which can control fundamental > parameters of the new Hardware Feature, and B. a mechanism of completely > disabling it

RE: [PATCH 1/3] Fix ERROR: trailing statements should be on next line

2017-05-15 Thread David Laight
From: Alex Williamson > Sent: 15 May 2017 04:21 ... > > > /* Find end of list, sew whole thing into vi->rq.pages. */ > > > - for (end = page; end->private; end = (struct page *)end->private); > > > + for (end = page; end->private; end = (struct page *)end->private) > > > + ; > > FWIW, I

RE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()

2017-05-10 Thread David Laight
From: SF Markus Elfring > Sent: 09 May 2017 15:22 > A bit of data was put into a sequence by two separate function calls. > Print the same data by a single function call instead. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring

RE: sky2: Use seq_putc() in sky2_debug_show()

2017-05-09 Thread David Laight
From: Stephen Hemminger > Sent: 09 May 2017 06:50 > On Mon, 8 May 2017 19:42:46 +0200 > SF Markus Elfring wrote: > > > > Which issue do you mean? I dont see any issue you fix here. > > > > Are the run time characteristics a bit nicer for the function seq_putc > >

RE: [PATCH 00/51] rtc: stop using rtc deprecated functions

2017-06-21 Thread David Laight
From: Russell King - ARM Linux > Sent: 20 June 2017 22:16 .. > Consider that at the moment, we define the 32-bit RTC representation to > start at a well known epoch. We _could_ decide that when it wraps to > 0x8000 seconds, we'll define the lower 0x4000 seconds to mean > dates in the

RE: remove dma_alloc_noncoherent

2017-06-20 Thread David Laight
From: Christoph Hellwig > Sent: 16 June 2017 08:17 > > For many years we've had the dma_alloc_attrs API that is more flexible > than dma_alloc_noncoherent. This series moves the remaining users over > to the attrs API. And most of the callers probably only want to specify 'noncoherent'. Grepping

RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies.

2017-06-26 Thread David Laight
From: Karim Eshapa > Sent: 25 June 2017 16:14 > Use msleep() instead of stucking with > long delay will be more efficient. ... > --- a/drivers/soc/fsl/qbman/qman.c > +++ b/drivers/soc/fsl/qbman/qman.c > @@ -1084,11 +1084,7 @@ static int drain_mr_fqrni(struct qm_portal *p) >*

RE: [PATCH 2/9] timers: provide a "modern" variant of timers

2017-05-19 Thread David Laight
From: Christoph Hellwig > Sent: 16 May 2017 12:48 > > The new callback gets a pointer to the timer_list itself, which can > then be used to get the containing structure using container_of > instead of casting from and to unsigned long all the time. What about sensible drivers that put some other

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Jim Baxter > Sent: 16 May 2017 18:41 > > The CDC-NCM driver can require large amounts of memory to create > skb's and this can be a problem when the memory becomes fragmented. > > This especially affects

RE: RFC: better timer interface

2017-05-23 Thread David Laight
From: Thomas Gleixner > Sent: 23 May 2017 12:59 > On Tue, 23 May 2017, David Laight wrote: > > > From: Thomas Gleixner > > > Sent: 21 May 2017 19:15 > > ... > > > > timer_start(timer, ms, abs) > > > > > > I'm not even sure, whether we

RE: RFC: better timer interface

2017-05-23 Thread David Laight
From: Thomas Gleixner > Sent: 21 May 2017 19:15 ... > > timer_start(timer, ms, abs) > > I'm not even sure, whether we need absolute timer wheel timers at > all, because most use cases are relative to now. Posix requires absolute timers for some userspace calls (annoying because the code often

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: Bjørn Mork > Sent: 19 May 2017 14:56 ... > Unless someone has a nice way to just collect a list of skbs and have > them converted to proper framing on the fly when transmitting, without > having to care about USB packet boundaries. skb can be linked into arbitrary chains (or even trees),

RE: [PATCH 3/3] EDAC: mv64x60: replace in_le32/out_le32 with ioread32/iowrite32

2017-05-19 Thread David Laight
From: Arnd Bergmann > Sent: 17 May 2017 22:40 > > On Wed, May 17, 2017 at 11:16 PM, Chris Packham > wrote: > > On 18/05/17 06:18, Borislav Petkov wrote: > > One thing I would like confirmation on is is in_le32 -> ioread32 the > > correct change? I tossed up

RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity

2017-05-31 Thread David Laight
From: Wolfram Sang > Sent: 28 May 2017 17:04 > > On Fri, May 05, 2017 at 02:08:31PM -0700, Florian Fainelli wrote: > > On 04/25/2017 05:56 PM, Florian Fainelli wrote: > > > Changes in v3: > > > > > > - added check in usb_gadget_map_request_by_dev (Felipe), new patch > > > - improved commit

RE: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread David Laight
From: Christophe JAILLET > Sent: 06 May 2017 06:30 > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. ... > --- a/drivers/net/dsa/dsa_loop.c > +++ b/drivers/net/dsa/dsa_loop.c > @@ -256,6

RE: Question about SOCK_SEQPACKET

2017-05-05 Thread David Laight
From: Steven Whitehouse > Sent: 05 May 2017 11:34 ... > Just before the part that you've quoted, the description for > SOCK_SEQPACKET says: > "The SOCK_SEQPACKET socket type is similar to the SOCK_STREAM type, and > is also connection-oriented. The only difference between these types is > that

RE: [PATCH] x86/asm: Don't use rbp as temp register in csum_partial_copy_generic()

2017-05-04 Thread David Laight
From: Josh Poimboeuf > Sent: 04 May 2017 15:52 > Andrey Konovalov reported the following warning while fuzzing the kernel > with syzkaller: > > WARNING: kernel stack regs at 8800686869f8 in a.out:4933 has bad 'bp' > value c3fc855a10167ec0 > > The unwinder dump revealed that rbp had a bad

RE: Asmedia USB 1343 crashes

2017-05-02 Thread David Laight
From: Thomas Fjellstrom > Sent: 01 May 2017 14:40 > I've got a 970 Pro gaming aura motherboard with an Asmedia 1343 Usb 3.1 > controller. It's been consistently throwing errors and eventually crashing and > becomming unresponsive. ... I've an earlier Asmedia 1042 controller. It has a bug (which I

RE: [PATCH 4/8] usb: bdc: Small code cleanup

2017-06-28 Thread David Laight
From: Al Cooper > Sent: 27 June 2017 19:23 > Signed-off-by: Al Cooper > --- > drivers/usb/gadget/udc/bdc/bdc_core.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c >

RE: [PATCH] net_sched: use explicit size of struct tcmsg, remove need to declare tcm

2017-09-18 Thread David Laight
From: Eric Dumazet > Sent: 18 September 2017 16:01 ... > > > - err = nlmsg_parse(nlh, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); > > > + err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX, NULL, NULL); > > > > Would sizeof(*nlmsg_data(nlh)) be cleaner?? > > Not really, since > > static

RE: [PATCH] net_sched: use explicit size of struct tcmsg, remove need to declare tcm

2017-09-18 Thread David Laight
From: Colin King > Sent: 18 September 2017 12:41 > Pointer tcm is being initialized and is never read, it is only being used > to determine the size of struct tcmsg. Clean this up by removing > variable tcm and explicitly using the sizeof struct tcmsg rather than *tcm. > Cleans up clang warning:

RE: [PATCH 0/5] [RFC] printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers

2017-09-19 Thread David Laight
From: Sergey Senozhatsky > Sent: 19 September 2017 03:06 ... > I'll simply convert everything to `unsigned long'. including the > dereference_function_descriptor() function [I believe there are > still some casts happening when we pass addr from kernel/module > dereference functions to

RE: [PATCH 0/5] [RFC] printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers

2017-09-20 Thread David Laight
From: Helge Deller > Sent: 19 September 2017 21:08 ... > > Using 'unsigned long' for any kind of pointer is an accident > > waiting do happen. > > It also makes it difficult to typecheck the function calls. > > Using 'void *' isn't any better. > > Either a pointer to an undefined struct, or a

RE: [PATCH 04/11] ia64: make dma_cache_sync a no-op

2017-10-04 Thread David Laight
From: Christoph Hellwig > Sent: 03 October 2017 11:43 > > ia64 does not implement DMA_ATTR_NON_CONSISTENT allocations, so it doesn't > make any sense to do any work in dma_cache_sync given that it must be a > no-op when dma_alloc_attrs returns coherent memory. > > Signed-off-by: Christoph Hellwig

RE: [PATCH net-next v2 2/4] net: dsa: mv88e6060: setup random mac address

2017-10-16 Thread David Laight
From: woojung@microchip.com > Sent: 13 October 2017 18:59 > > >> > + REG_WRITE(REG_GLOBAL, GLOBAL_MAC_01, (addr[0] << 9) | > > >> addr[1]); > > >> > > >> Is that supposed to be 9 ? > > > > > > Looks like it. > > > Check > >

RE: [PATCH net-next v3 3/5] net: dsa: mv88e6060: setup random mac address

2017-10-16 Thread David Laight
From: Vivien Didelot > Sent: 13 October 2017 19:18 > As for mv88e6xxx, setup the switch from within the mv88e6060 driver with > a random MAC address, and remove the .set_addr implementation. > > Signed-off-by: Vivien Didelot > --- >

RE: [PATCH] rsi: fix integer overflow warning

2017-10-05 Thread David Laight
From: Joe Perches > Sent: 05 October 2017 13:19 > On Thu, 2017-10-05 at 14:05 +0200, Arnd Bergmann wrote: > > gcc produces a harmless warning about a recently introduced > > signed integer overflow: > > > > drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_prepare_mgmt_desc': > >

RE: [PATCH v10 09/10] mm: stop zeroing memory during allocation in vmemmap

2017-10-06 Thread David Laight
From: Michal Hocko > Sent: 06 October 2017 12:47 > On Fri 06-10-17 11:10:14, David Laight wrote: > > From: Pavel Tatashin > > > Sent: 05 October 2017 22:11 > > > vmemmap_alloc_block() will no longer zero the block, so zero memory > > > at its call sites for

RE: [PATCH v10 09/10] mm: stop zeroing memory during allocation in vmemmap

2017-10-06 Thread David Laight
From: Pavel Tatashin > Sent: 05 October 2017 22:11 > vmemmap_alloc_block() will no longer zero the block, so zero memory > at its call sites for everything except struct pages. Struct page memory > is zero'd by struct page initialization. It seems dangerous to change an allocator to stop zeroing

RE: [PATCH net-next v3 0/5] net: dsa: remove .set_addr

2017-10-16 Thread David Laight
From: Andrew Lunn > Sent: 16 October 2017 17:10 ... > So, received Pause frames never leave the MAC. They don't get bridged, > nor do they get passed up for host processing. They are purely point > to point between two MAC peers. The destination is unambiguous. It is > simple the other MAC peer.

RE: [PATCH] PCI: dwc: dra7xx: Print link state to console for debug

2017-10-17 Thread David Laight
From: Joe Perches > Sent: 17 October 2017 07:35 > On Tue, 2017-10-17 at 11:13 +0530, Faiz Abbas wrote: > > Enable support for printing the LTSSM link state for debugging PCI > > when link is down. > [] > > diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c > > index

RE: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-17 Thread David Laight
From: Daniel Borkmann > Sent: 17 October 2017 15:56 > > The set fixes a splat in devmap percpu allocation when we alloc > the flush bitmap. Patch 1 is a prerequisite for the fix in patch 2, > patch 1 is rather small, so if this could be routed via -net, for > example, with Tejun's Ack that would

RE: [PATCH net-next 5/5] net: dsa: split dsa_port's netdev member

2017-10-13 Thread David Laight
From: Vivien Didelot > Sent: 13 October 2017 16:29 > Vivien Didelot writes: > > >>> How about using: > >>> > >>> union { > >>> struct net_device *master; > >>> struct net_device *slave; > >>> } netdev; > >> ... > >> > >> You can remove

<    1   2   3   4   5   6   7   8   9   10   >