* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Eric Biggers @ 2018-08-25 6:29 UTC (permalink / raw)
To: Jason A. Donenfeld
Cc: linux-kernel, netdev, davem, Andy Lutomirski, Greg KH,
Samuel Neves, Jean-Philippe Aumasson, linux-crypto
In-Reply-To: <20180824213849.23647-3-Jason@zx2c4.com>
Hi Jason,
On Fri, Aug 24, 2018 at 03:38:34PM -0600, Jason A. Donenfeld wrote:
> Zinc stands for "Zinc Is Neat Crypto" or "Zinc as IN Crypto" or maybe
> just "Zx2c4's INsane Cryptolib." It's also short, easy to type, and
> plays nicely with the recent trend of naming crypto libraries after
> elements. The guiding principle is "don't overdo it". It's less of a
> library and more of a directory tree for organizing well-curated direct
> implementations of cryptography primitives.
>
> Zinc is a new cryptography API that is much more minimal and lower-level
> than the current one. It intends to complement it and provide a basis
> upon which the current crypto API might build, as the provider of
> software implementations of cryptographic primitives. It is motivated by
> three primary observations in crypto API design:
>
> * Highly composable "cipher modes" and related abstractions from
> 90s cryptographers did not turn out to be as terrific an idea as
> hoped, leading to a host of API misuse problems.
>
> * Most programmers are afraid of crypto code, and so prefer to
> integrate it into libraries in a highly abstracted manner, so as to
> shield themselves from implementation details. Cryptographers, on
> the other hand, prefer simple direct implementations, which they're
> able to verify for high assurance and optimize in accordance with
> their expertise.
>
> * Overly abstracted and flexible cryptography APIs lead to a host of
> dangerous problems and performance issues. The kernel is in the
> business usually not of coming up with new uses of crypto, but
> rather implementing various constructions, which means it essentially
> needs a library of primitives, not a highly abstracted enterprise-ready
> pluggable system, with a few particular exceptions.
>
> This last observation has seen itself play out several times over and
> over again within the kernel:
>
> * The perennial move of actual primitives away from crypto/ and into
> lib/, so that users can actually call these functions directly with
> no overhead and without lots of allocations, function pointers,
> string specifier parsing, and general clunkiness. For example:
> sha256, chacha20, siphash, sha1, and so forth live in lib/ rather
> than in crypto/. Zinc intends to stop the cluttering of lib/ and
> introduce these direct primitives into their proper place, lib/zinc/.
>
> * An abundance of misuse bugs with the present crypto API that have
> been very unpleasant to clean up.
>
> * A hesitance to even use cryptography, because of the overhead and
> headaches involved in accessing the routines.
>
> Zinc goes in a rather different direction. Rather than providing a
> thoroughly designed and abstracted API, Zinc gives you simple functions,
> which implement some primitive, or some particular and specific
> construction of primitives. It is not dynamic in the least, though one
> could imagine implementing a complex dynamic dispatch mechanism (such as
> the current crypto API) on top of these basic functions. After all,
> dynamic dispatch is usually needed for applications with cipher agility,
> such as IPsec, dm-crypt, AF_ALG, and so forth, and the existing crypto
> API will continue to play that role. However, Zinc will provide a non-
> haphazard way of directly utilizing crypto routines in applications
> that do have neither the need nor desire for abstraction and dynamic
> dispatch.
>
> It also organizes the implementations in a simple, straight-forward,
> and direct manner, making it enjoyable and intuitive to work on.
> Rather than moving optimized assembly implementations into arch/, it
> keeps them all together in lib/zinc/, making it simple and obvious to
> compare and contrast what's happening. This is, notably, exactly what
> the lib/raid6/ tree does, and that seems to work out rather well. It's
> also the pattern of most successful crypto libraries. The architecture-
> specific glue-code is made a part of each translation unit, rather than
> being in a separate one, so that generic and architecture-optimized code
> are combined at compile-time, and incompatibility branches compiled out by
> the optimizer.
>
> All implementations have been extensively tested and fuzzed, and are
> selected for their quality, trustworthiness, and performance. Wherever
> possible and performant, formally verified implementations are used,
> such as those from HACL* [1] and Fiat-Crypto [2]. The routines also take
> special care to zero out secrets using memzero_explicit (and future work
> is planned to have gcc do this more reliably and performantly with
> compiler plugins). The performance of the selected implementations is
> state-of-the-art and unrivaled on a broad array of hardware, though of
> course we will continue to fine tune these to the hardware demands
> needed by kernel contributors. Each implementation also comes with
> extensive self-tests and crafted test vectors, pulled from various
> places such as Wycheproof [9].
>
> Regularity of function signatures is important, so that users can easily
> "guess" the name of the function they want. Though, individual
> primitives are oftentimes not trivially interchangeable, having been
> designed for different things and requiring different parameters and
> semantics, and so the function signatures they provide will directly
> reflect the realities of the primitives' usages, rather than hiding it
> behind (inevitably leaky) abstractions. Also, in contrast to the current
> crypto API, Zinc functions can work on stack buffers, and can be called
> with different keys, without requiring allocations or locking.
>
> SIMD is used automatically when available, though some routines may
> benefit from either having their SIMD disabled for particular
> invocations, or to have the SIMD initialization calls amortized over
> several invocations of the function, and so Zinc utilizes function
> signatures enabling that in conjunction with the recently introduced
> simd_context_t.
>
> More generally, Zinc provides function signatures that allow just what
> is required by the various callers. This isn't to say that users of the
> functions will be permitted to pollute the function semantics with weird
> particular needs, but we are trying very hard not to overdo it, and that
> means looking carefully at what's actually necessary, and doing just that,
> and not much more than that. Remember: practicality and cleanliness rather
> than over-zealous infrastructure.
>
> Zinc provides also an opening for the best implementers in academia to
> contribute their time and effort to the kernel, by being sufficiently
> simple and inviting. In discussing this commit with some of the best and
> brightest over the last few years, there are many who are eager to
> devote rare talent and energy to this effort.
>
> Following the merging of this, I expect for the primitives that
> currently exist in lib/ to work their way into lib/zinc/, after intense
> scrutiny of each implementation, potentially replacing them with either
> formally-verified implementations, or better studied and faster
> state-of-the-art implementations.
>
> Also following the merging of this, I expect for the old crypto API
> implementations to be ported over to use Zinc for their software-based
> implementations.
>
> As Zinc is simply library code, its config options are un-menued, with
> the exception of CONFIG_ZINC_DEBUG, which enables various selftests and
> BUG_ONs.
>
> [1] https://github.com/project-everest/hacl-star
> [2] https://github.com/mit-plv/fiat-crypto
> [3] https://cr.yp.to/ecdh.html
> [4] https://cr.yp.to/chacha.html
> [5] https://cr.yp.to/snuffle/xsalsa-20081128.pdf
> [6] https://cr.yp.to/mac.html
> [7] https://blake2.net/
> [8] https://tools.ietf.org/html/rfc8439
> [9] https://github.com/google/wycheproof
>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> Cc: Samuel Neves <sneves@dei.uc.pt>
> Cc: Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
> Cc: linux-crypto@vger.kernel.org
I think the crypto portion of the patchset is looking *slightly* better from v1.
(Thanks for getting rid of the #ifdef mazes!) But here are some more comments,
with the caveat that I haven't really reviewed any actual implementations yet,
and it's a *lot* of new code so this is really just scratching the surface...:
I thought you were going to wrap lines at 80 characters? It's hard to read the
extremely long lines, and they encourage deep nesting.
As I said before, I still think you need to switch the crypto API ChaCha20 and
Poly1305 over to use the new implementations. It's not okay to have two
completely different sets of ChaCha20 and Poly1305 implementations just because
you want a different API, so you might as well get started on it... The thing
is that before you try it, it's not clear what problems will come up that
require changes to the design. So, this really ought to be addressed up-front.
It's also not clearly explained whether/why/how the new ChaCha20 and Poly1305
implementations are better than the existing ones. The patch adding the ARM and
ARM64 ChaCha, for example, just says who wrote them, with no mention of why the
particular implementations were chosen.
You've also documented a lot of stuff in commit messages which will be lost as
it isn't being added to the source itself. There are various examples of this,
such as information about where the various implementations came from, what you
changed, why a particular implementation isn't used on Skylake or whatever, etc.
Can you please make sure that any important information is in comments, e.g. at
the top of the files? There maybe should even be a Documentation/ file for
"Zinc", rather than only a long commit message.
I still think the "Zinc" name is confusing and misleading, and people are going
to forget that it means "crypto". lib/crypto/ would be more intuitive.
But I don't care *that* much myself, and you should see what others think...
It seems you still don't explicitly clarify anywhere in the source itself that
the copyright holders of the code from OpenSSL have relicensed it under GPLv2.
I only see a GPLv2 license slapped on the files, yet no such license is presence
in the OpenSSL originals, at least in the one I checked. If you did receive
explicit permission, then you should include an explicit clarification in each
file like the one in arch/arm/crypto/sha1-armv4-large.S. Otherwise people will
be confused and come asking about the license status.
As Ard and I discussed recently on my patch
"crypto: arm/poly1305 - add NEON accelerated Poly1305 implementation"
which proposed adding the exact same poly1305-arm.S file, for all the OpenSSL
assembly it would probably be better to include the .pl file and generate the .S
file as part of the build process. For one, there is semantic information like
register names in the .pl script that is lost in the .S file, thereby making the
.S file less readable.
There are still some alignment bugs where integers are loaded from byte arrays
without using the unaligned access macros, e.g. in chacha20_init(),
hchacha20_generic(), and fe_frombytes_impl(). I found these grepping for
le32_to_cpu. Interestingly, that last one is in "formally verified" code :-)
Thanks!
Eric
^ permalink raw reply
* Re: [PATCH 4.4 18/31] r8152: napi hangup fix after disconnect
From: Jiri Slaby @ 2018-08-25 7:43 UTC (permalink / raw)
To: Ben Hutchings, linux-usb, netdev, David S. Miller
Cc: stable, Greg Kroah-Hartman, LKML
In-Reply-To: <1535128726.2902.32.camel@codethink.co.uk>
On 08/24/2018, 06:38 PM, Ben Hutchings wrote:
> On Fri, 2018-07-20 at 14:13 +0200, Greg Kroah-Hartman wrote:
>> 4.4-stable review patch. If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Jiri Slaby <jslaby@suse.cz>
>>
>> [ Upstream commit 0ee1f4734967af8321ecebaf9c74221ace34f2d5 ]
> [...]
>> --- a/drivers/net/usb/r8152.c
>> +++ b/drivers/net/usb/r8152.c
>> @@ -3139,7 +3139,8 @@ static int rtl8152_close(struct net_devi
>> #ifdef CONFIG_PM_SLEEP
>> unregister_pm_notifier(&tp->pm_notifier);
>> #endif
>> - napi_disable(&tp->napi);
>> + if (!test_bit(RTL8152_UNPLUG, &tp->flags))
>> + napi_disable(&tp->napi);
>> clear_bit(WORK_ENABLE, &tp->flags);
>> usb_kill_urb(tp->intr_urb);
>> cancel_delayed_work_sync(&tp->schedule);
>
> This flag appears to be set only if the USB device is actually
> disconnected. In case the driver is unbound for some other reason
> (like the module is removed), the same problem will occur.
Could you elaborate? I thought this would happen:
module_exit -> usb_deregister -> usb_unbind_device -> rtl8152_disconnect
-> unregister_netdev -> rtl8152_close
Am I missing something?
thanks,
--
js
suse labs
^ permalink raw reply
* Re: [PATCH v2 01/29] nvmem: add support for cell lookups
From: Boris Brezillon @ 2018-08-25 6:27 UTC (permalink / raw)
To: Andrew Lunn
Cc: linux-doc, Sekhar Nori, Bartosz Golaszewski, Srinivas Kandagatla,
linux-i2c, Mauro Carvalho Chehab, Rob Herring, Florian Fainelli,
Kevin Hilman, Richard Weinberger, Bartosz Golaszewski,
Russell King, Marek Vasut, Paolo Abeni, Dan Carpenter,
Grygorii Strashko, David Lechner, Arnd Bergmann,
Sven Van Asbroeck, linux-mtd
In-Reply-To: <20180824152740.GD27483@lunn.ch>
On Fri, 24 Aug 2018 17:27:40 +0200
Andrew Lunn <andrew@lunn.ch> wrote:
> On Fri, Aug 24, 2018 at 05:08:48PM +0200, Boris Brezillon wrote:
> > Hi Bartosz,
> >
> > On Fri, 10 Aug 2018 10:04:58 +0200
> > Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > > +struct nvmem_cell_lookup {
> > > + struct nvmem_cell_info info;
> > > + struct list_head list;
> > > + const char *nvmem_name;
> > > +};
> >
> > Hm, maybe I don't get it right, but this looks suspicious. Usually the
> > consumer lookup table is here to attach device specific names to
> > external resources.
> >
> > So what I'd expect here is:
> >
> > struct nvmem_cell_lookup {
> > /* The nvmem device name. */
> > const char *nvmem_name;
> >
> > /* The nvmem cell name */
> > const char *nvmem_cell_name;
> >
> > /*
> > * The local resource name. Basically what you have in the
> > * nvmem-cell-names prop.
> > */
> > const char *conid;
> > };
> >
> > struct nvmem_cell_lookup_table {
> > struct list_head list;
> >
> > /* ID of the consumer device. */
> > const char *devid;
> >
> > /* Array of cell lookup entries. */
> > unsigned int ncells;
> > const struct nvmem_cell_lookup *cells;
> > };
> >
> > Looks like your nvmem_cell_lookup is more something used to attach cells
> > to an nvmem device, which is NVMEM provider's responsibility not the
> > consumer one.
>
> Hi Boris
>
> There are cases where there is not a clear providier/consumer split. I
> have an x86 platform, with a few at24 EEPROMs on it. It uses an off
> the shelf Komtron module, placed on a custom carrier board. One of the
> EEPROMs contains the hardware variant information. Once i know the
> variant, i need to instantiate other I2C, SPI, MDIO devices, all using
> platform devices, since this is x86, no DT available.
>
> So the first thing my x86 platform device does is instantiate the
> first i2c device for the AT24. Once the EEPROM pops into existence, i
> need to add nvmem cells onto it. So at that point, the x86 platform
> driver is playing the provider role. Once the cells are added, i can
> then use nvmem consumer interfaces to get the contents of the cell,
> run a checksum, and instantiate the other devices.
>
> I wish the embedded world was all DT, but the reality is that it is
> not :-(
Actually, I'm not questioning the need for this feature (being able to
attach NVMEM cells to an NVMEM device on a platform that does not use
DT). What I'm saying is that this functionality is provider related,
not consumer related. Also, I wonder if defining such NVMEM cells
shouldn't go through the provider driver instead of being passed
directly to the NVMEM layer, because nvmem_config already have a fields
to pass cells at registration time, plus, the name of the NVMEM cell
device is sometimes created dynamically and can be hard to guess at
platform_device registration time.
I also think non-DT consumers will need a way to reference exiting
NVMEM cells, but this consumer-oriented nvmem cell lookup table should
look like the gpio or pwm lookup table (basically what I proposed in my
previous email).
^ permalink raw reply
* Re: [net 00/11][pull request] Intel Wired LAN Driver Updates 2018-08-24
From: David Miller @ 2018-08-25 7:03 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <20180824184735.32175-1-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 24 Aug 2018 11:47:24 -0700
> This series contains fixes to e1000, igb, ixgb, ixgbe and i40e.
Pulled, thanks Jeff.
^ permalink raw reply
* [PATCH 1/1] net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6
From: Zhu Yanjun @ 2018-08-25 7:19 UTC (permalink / raw)
To: santosh.shilimkar, davem, netdev, linux-rdma, rds-devel; +Cc: Zhu Yanjun
In IPv4, the newly introduced rdma_read_gids is used to read the SGID/DGID
for the connection which returns GID correctly for RoCE transport as well.
In IPv6, rdma_read_gids is also used. The following are why rdma_read_gids
is introduced.
rdma_addr_get_dgid() for RoCE for client side connections returns MAC
address, instead of DGID.
rdma_addr_get_sgid() for RoCE doesn't return correct SGID for IPv6 and
when more than one IP address is assigned to the netdevice.
So the transport agnostic rdma_read_gids() API is provided by rdma_cm
module.
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
net/rds/ib.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/net/rds/ib.c b/net/rds/ib.c
index c1d97640c0be..eba75c1ba359 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -341,15 +341,10 @@ static int rds6_ib_conn_info_visitor(struct rds_connection *conn,
if (rds_conn_state(conn) == RDS_CONN_UP) {
struct rds_ib_device *rds_ibdev;
- struct rdma_dev_addr *dev_addr;
ic = conn->c_transport_data;
- dev_addr = &ic->i_cm_id->route.addr.dev_addr;
- rdma_addr_get_sgid(dev_addr,
- (union ib_gid *)&iinfo6->src_gid);
- rdma_addr_get_dgid(dev_addr,
- (union ib_gid *)&iinfo6->dst_gid);
-
+ rdma_read_gids(ic->i_cm_id, (union ib_gid *)&iinfo6->src_gid,
+ (union ib_gid *)&iinfo6->dst_gid);
rds_ibdev = ic->rds_ibdev;
iinfo6->max_send_wr = ic->i_send_ring.w_nr;
iinfo6->max_recv_wr = ic->i_recv_ring.w_nr;
--
2.17.1
^ permalink raw reply related
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Ard Biesheuvel @ 2018-08-25 10:17 UTC (permalink / raw)
To: Jason A. Donenfeld
Cc: Linux Kernel Mailing List, <netdev@vger.kernel.org>,
David S. Miller, Andy Lutomirski, Greg KH, Samuel Neves,
Jean-Philippe Aumasson,
open list:HARDWARE RANDOM NUMBER GENERATOR CORE
In-Reply-To: <20180824213849.23647-3-Jason@zx2c4.com>
Hi Jason,
On 24 August 2018 at 22:38, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Zinc stands for "Zinc Is Neat Crypto" or "Zinc as IN Crypto" or maybe
> just "Zx2c4's INsane Cryptolib." It's also short, easy to type, and
> plays nicely with the recent trend of naming crypto libraries after
> elements. The guiding principle is "don't overdo it". It's less of a
> library and more of a directory tree for organizing well-curated direct
> implementations of cryptography primitives.
>
> Zinc is a new cryptography API that is much more minimal and lower-level
> than the current one. It intends to complement it and provide a basis
> upon which the current crypto API might build, as the provider of
> software implementations of cryptographic primitives. It is motivated by
> three primary observations in crypto API design:
>
> * Highly composable "cipher modes" and related abstractions from
> 90s cryptographers did not turn out to be as terrific an idea as
> hoped, leading to a host of API misuse problems.
>
> * Most programmers are afraid of crypto code, and so prefer to
> integrate it into libraries in a highly abstracted manner, so as to
> shield themselves from implementation details. Cryptographers, on
> the other hand, prefer simple direct implementations, which they're
> able to verify for high assurance and optimize in accordance with
> their expertise.
>
> * Overly abstracted and flexible cryptography APIs lead to a host of
> dangerous problems and performance issues. The kernel is in the
> business usually not of coming up with new uses of crypto, but
> rather implementing various constructions, which means it essentially
> needs a library of primitives, not a highly abstracted enterprise-ready
> pluggable system, with a few particular exceptions.
>
Do we really need a new crypto API for WireGuard? Surely, you yourself
are not affected by these concerns, and I don't anticipate an
explosion of new crypto use cases in the kernel that would justify
maintaining two parallel crypto stacks.
Also, I take it this means that WireGuard will only work with your
routines? We don't usually impose that kind of policy in the kernel:
on my arm64 systems, AES/GCM runs at 2.3 cycles per byte, which is a
good enough reason to prefer it over a ChaCha20/Poly1305 based AEAD,
even if your code is faster than the current code (which is debatable,
as you know)
It also means that users of the crypto API will not benefit from your
better code. I'm sure you agree that it is a bad idea to force those
same crypto-impaired programmers to port their code to a new API.
I also suggested that we work with Andy Polyakov (as I have in the
past) to make the changes required for the kernel in the OpenSSL
upstream. That way, we can take the .pl files unmodified, and benefit
from the maintenance and review upstream. Dumping 10,000s of lines of
generated assembler in the kernel tree like that is really
unacceptable IMO.
I think you will have to engage with the kernel community to identify
the problems with the current crypto API, and get them fixed. I think
it makes a lot of sense to have crypto primitives in lib/ (and
arch-specific accelerated versions in arch/<arch>/lib), and layer many
of the current crypto API drivers on top of that. Also, having more
test cases is useful as well. I'm not sure what the relevance of
formally verified implementations is, though, since it only proves
that the code is true to the algorithm, not that the algorithm is
secure. Or am I missing something?
Upstreaming your code is a lot easier if you don't cater for your own
needs only but also for the needs of others. Please work with us to
fix the problems in the current crypto API before parachuting in a new
one.
> This last observation has seen itself play out several times over and
> over again within the kernel:
>
> * The perennial move of actual primitives away from crypto/ and into
> lib/, so that users can actually call these functions directly with
> no overhead and without lots of allocations, function pointers,
> string specifier parsing, and general clunkiness. For example:
> sha256, chacha20, siphash, sha1, and so forth live in lib/ rather
> than in crypto/. Zinc intends to stop the cluttering of lib/ and
> introduce these direct primitives into their proper place, lib/zinc/.
>
> * An abundance of misuse bugs with the present crypto API that have
> been very unpleasant to clean up.
>
> * A hesitance to even use cryptography, because of the overhead and
> headaches involved in accessing the routines.
>
> Zinc goes in a rather different direction. Rather than providing a
> thoroughly designed and abstracted API, Zinc gives you simple functions,
> which implement some primitive, or some particular and specific
> construction of primitives. It is not dynamic in the least, though one
> could imagine implementing a complex dynamic dispatch mechanism (such as
> the current crypto API) on top of these basic functions. After all,
> dynamic dispatch is usually needed for applications with cipher agility,
> such as IPsec, dm-crypt, AF_ALG, and so forth, and the existing crypto
> API will continue to play that role. However, Zinc will provide a non-
> haphazard way of directly utilizing crypto routines in applications
> that do have neither the need nor desire for abstraction and dynamic
> dispatch.
>
> It also organizes the implementations in a simple, straight-forward,
> and direct manner, making it enjoyable and intuitive to work on.
> Rather than moving optimized assembly implementations into arch/, it
> keeps them all together in lib/zinc/, making it simple and obvious to
> compare and contrast what's happening. This is, notably, exactly what
> the lib/raid6/ tree does, and that seems to work out rather well. It's
> also the pattern of most successful crypto libraries. The architecture-
> specific glue-code is made a part of each translation unit, rather than
> being in a separate one, so that generic and architecture-optimized code
> are combined at compile-time, and incompatibility branches compiled out by
> the optimizer.
>
> All implementations have been extensively tested and fuzzed, and are
> selected for their quality, trustworthiness, and performance. Wherever
> possible and performant, formally verified implementations are used,
> such as those from HACL* [1] and Fiat-Crypto [2]. The routines also take
> special care to zero out secrets using memzero_explicit (and future work
> is planned to have gcc do this more reliably and performantly with
> compiler plugins). The performance of the selected implementations is
> state-of-the-art and unrivaled on a broad array of hardware, though of
> course we will continue to fine tune these to the hardware demands
> needed by kernel contributors. Each implementation also comes with
> extensive self-tests and crafted test vectors, pulled from various
> places such as Wycheproof [9].
>
> Regularity of function signatures is important, so that users can easily
> "guess" the name of the function they want. Though, individual
> primitives are oftentimes not trivially interchangeable, having been
> designed for different things and requiring different parameters and
> semantics, and so the function signatures they provide will directly
> reflect the realities of the primitives' usages, rather than hiding it
> behind (inevitably leaky) abstractions. Also, in contrast to the current
> crypto API, Zinc functions can work on stack buffers, and can be called
> with different keys, without requiring allocations or locking.
>
> SIMD is used automatically when available, though some routines may
> benefit from either having their SIMD disabled for particular
> invocations, or to have the SIMD initialization calls amortized over
> several invocations of the function, and so Zinc utilizes function
> signatures enabling that in conjunction with the recently introduced
> simd_context_t.
>
> More generally, Zinc provides function signatures that allow just what
> is required by the various callers. This isn't to say that users of the
> functions will be permitted to pollute the function semantics with weird
> particular needs, but we are trying very hard not to overdo it, and that
> means looking carefully at what's actually necessary, and doing just that,
> and not much more than that. Remember: practicality and cleanliness rather
> than over-zealous infrastructure.
>
> Zinc provides also an opening for the best implementers in academia to
> contribute their time and effort to the kernel, by being sufficiently
> simple and inviting. In discussing this commit with some of the best and
> brightest over the last few years, there are many who are eager to
> devote rare talent and energy to this effort.
>
> Following the merging of this, I expect for the primitives that
> currently exist in lib/ to work their way into lib/zinc/, after intense
> scrutiny of each implementation, potentially replacing them with either
> formally-verified implementations, or better studied and faster
> state-of-the-art implementations.
>
> Also following the merging of this, I expect for the old crypto API
> implementations to be ported over to use Zinc for their software-based
> implementations.
>
> As Zinc is simply library code, its config options are un-menued, with
> the exception of CONFIG_ZINC_DEBUG, which enables various selftests and
> BUG_ONs.
>
> [1] https://github.com/project-everest/hacl-star
> [2] https://github.com/mit-plv/fiat-crypto
> [3] https://cr.yp.to/ecdh.html
> [4] https://cr.yp.to/chacha.html
> [5] https://cr.yp.to/snuffle/xsalsa-20081128.pdf
> [6] https://cr.yp.to/mac.html
> [7] https://blake2.net/
> [8] https://tools.ietf.org/html/rfc8439
> [9] https://github.com/google/wycheproof
>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> Cc: Samuel Neves <sneves@dei.uc.pt>
> Cc: Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
> Cc: linux-crypto@vger.kernel.org
> ---
> MAINTAINERS | 8 ++++++++
> lib/Kconfig | 2 ++
> lib/Makefile | 2 ++
> lib/zinc/Kconfig | 20 ++++++++++++++++++++
> lib/zinc/Makefile | 7 +++++++
> lib/zinc/main.c | 31 +++++++++++++++++++++++++++++++
> 6 files changed, 70 insertions(+)
> create mode 100644 lib/zinc/Kconfig
> create mode 100644 lib/zinc/Makefile
> create mode 100644 lib/zinc/main.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 955463f8d518..f194eda86011 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16103,6 +16103,14 @@ Q: https://patchwork.linuxtv.org/project/linux-media/list/
> S: Maintained
> F: drivers/media/dvb-frontends/zd1301_demod*
>
> +ZINC CRYPTOGRAPHY LIBRARY
> +M: Jason A. Donenfeld <Jason@zx2c4.com>
> +M: Samuel Neves <sneves@dei.uc.pt>
> +S: Maintained
> +F: lib/zinc/
> +F: include/zinc/
> +L: linux-crypto@vger.kernel.org
> +
> ZPOOL COMPRESSED PAGE STORAGE API
> M: Dan Streetman <ddstreet@ieee.org>
> L: linux-mm@kvack.org
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 706836ec314d..7ea5437e9f7d 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -478,6 +478,8 @@ config GLOB_SELFTEST
> module load) by a small amount, so you're welcome to play with
> it, but you probably don't need it.
>
> +source "lib/zinc/Kconfig"
> +
> #
> # Netlink attribute parsing support is select'ed if needed
> #
> diff --git a/lib/Makefile b/lib/Makefile
> index d95bb2525101..ee41151cba7a 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -212,6 +212,8 @@ obj-$(CONFIG_PERCPU_TEST) += percpu_test.o
>
> obj-$(CONFIG_ASN1) += asn1_decoder.o
>
> +obj-$(CONFIG_ZINC) += zinc/
> +
> obj-$(CONFIG_FONT_SUPPORT) += fonts/
>
> obj-$(CONFIG_PRIME_NUMBERS) += prime_numbers.o
> diff --git a/lib/zinc/Kconfig b/lib/zinc/Kconfig
> new file mode 100644
> index 000000000000..aa4f8d449d6b
> --- /dev/null
> +++ b/lib/zinc/Kconfig
> @@ -0,0 +1,20 @@
> +config ZINC
> + tristate
> + select CRYPTO_BLKCIPHER
> + select VFP
> + select VFPv3
> + select NEON
> + select KERNEL_MODE_NEON
> +
> +config ZINC_DEBUG
> + bool "Zinc cryptography library debugging and self-tests"
> + depends on ZINC
> + help
> + This builds a series of self-tests for the Zinc crypto library, which
> + help diagnose any cryptographic algorithm implementation issues that
> + might be at the root cause of potential bugs. It also adds various
> + debugging traps.
> +
> + Unless you're developing and testing cryptographic routines, or are
> + especially paranoid about correctness on your hardware, you may say
> + N here.
> diff --git a/lib/zinc/Makefile b/lib/zinc/Makefile
> new file mode 100644
> index 000000000000..8e30115217db
> --- /dev/null
> +++ b/lib/zinc/Makefile
> @@ -0,0 +1,7 @@
> +ccflags-y := -O3
> +ccflags-y += -Wframe-larger-than=8192
> +ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
> +
> +zinc-y += main.o
> +
> +obj-$(CONFIG_ZINC) := zinc.o
> diff --git a/lib/zinc/main.c b/lib/zinc/main.c
> new file mode 100644
> index 000000000000..590872563955
> --- /dev/null
> +++ b/lib/zinc/main.c
> @@ -0,0 +1,31 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + *
> + * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/module.h>
> +
> +#ifdef CONFIG_ZINC_DEBUG
> +#define selftest(which) do { \
> + if (!which ## _selftest()) \
> + return -ENOTRECOVERABLE; \
> +} while (0)
> +#else
> +#define selftest(which)
> +#endif
> +
> +static int __init mod_init(void)
> +{
> + return 0;
> +}
> +
> +static void __exit mod_exit(void)
> +{
> +}
> +
> +module_init(mod_init);
> +module_exit(mod_exit);
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("Zinc cryptography library");
> +MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
> --
> 2.18.0
>
^ permalink raw reply
* [net-next] ipv6:sr: Use the right next-hop value for neighbor discovery in End.DX4
From: Ahmed Abdelsalam @ 2018-08-25 14:15 UTC (permalink / raw)
To: davem, dlebrun, netdev; +Cc: linux-kernel, amsalam20
The SRv6 End.DX4 behaviour supports the use-case of L3VPN,
where a FIB lookup in a specific tenant table at the egress
PE is not required [1].
In the implementation of the behaviour, after the packet being
decapsulated, the lookup in the routing sub-system is done based
on next-hop specified form the control plane (using iproute2) or
the destination address of the packet.
However, the neighbour discovery process always fall back on the
destination address of the packet (in ip_finish_output2 ()),
if "rt_gateway" value is not present in the "struct rtable rt".
nexthop = (__force u32) rt_nexthop(rt, ip_hdr(skb)->daddr);
This patch makes sure that "rt_gateway" has the value of
the next-hop configured from the control plane.
The patch is tested for inner IPv4 packets having destination
address different from the next-hop configured using iproute2
[1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-05
Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>
---
net/ipv6/seg6_local.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 60325dbfe88b..d346f0d19c09 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -374,6 +374,8 @@ static int input_action_end_dx4(struct sk_buff *skb,
if (err)
goto drop;
+ ((struct rtable *)skb_dst(skb))->rt_gateway = nhaddr;
+
return dst_input(skb);
drop:
--
2.11.0
^ permalink raw reply related
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Andrew Lunn @ 2018-08-25 16:16 UTC (permalink / raw)
To: Eric Biggers
Cc: Jason A. Donenfeld, linux-kernel, netdev, davem, Andy Lutomirski,
Greg KH, Samuel Neves, Jean-Philippe Aumasson, linux-crypto
In-Reply-To: <20180825062951.GC726@sol.localdomain>
> It seems you still don't explicitly clarify anywhere in the source itself that
> the copyright holders of the code from OpenSSL have relicensed it under GPLv2.
> I only see a GPLv2 license slapped on the files, yet no such license is presence
> in the OpenSSL originals, at least in the one I checked. If you did receive
> explicit permission, then you should include an explicit clarification in each
> file like the one in arch/arm/crypto/sha1-armv4-large.S.
Better yet, get the copyright holders to publicly send a
signed-off-by: or acked-by: so it is clear they agree to this.
Andrew
^ permalink raw reply
* Re: broken behaviour of TC filter delete
From: Jiri Pirko @ 2018-08-25 13:02 UTC (permalink / raw)
To: Cong Wang
Cc: Roman Mashak, Linux Kernel Network Developers, Jiri Pirko,
Jamal Hadi Salim
In-Reply-To: <CAM_iQpXDG4YdiUrqFhn7fxsbTBMBdR4x-ZQQ3U5E_xSPf-PANQ@mail.gmail.com>
Fri, Aug 24, 2018 at 08:11:07PM CEST, xiyou.wangcong@gmail.com wrote:
>On Fri, Aug 24, 2018 at 9:21 AM Roman Mashak <mrv@mojatatu.com> wrote:
>>
>> So _before_ commit f71e0ca4db187af7c44987e9d21e9042c3046070 step 6 would
>> return -ENOENT with "Error: Filter with specified priority/protocol not
>> found." and _after_ the commit it returns -EINVAL (Error: Cannot find
>> specified filter chain.)
>>
>> ENOENT seems to be more logical to return when there's no more filter to delete.
>
>Yeah, at least we should keep ENOENT for compatibility.
>
>The bug here is chain 0 is gone after the last filter is gone,
>so when you delete the filter again, it treats it as you specify
>chain 0 which does not exist, so it hits EINVAL before ENOENT.
I understand. My concern is about consistency with other chains. Perhaps
-ENOENT for all chains in this case would be doable. What do you think?
>
>I am not sure how to fix this properly.
^ permalink raw reply
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Jason A. Donenfeld @ 2018-08-25 17:06 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Linux Kernel Mailing List, <netdev@vger.kernel.org>,
David S. Miller, Andy Lutomirski, Greg KH, Samuel Neves,
Jean-Philippe Aumasson,
open list:HARDWARE RANDOM NUMBER GENERATOR CORE
In-Reply-To: <CAKv+Gu-u7vPkU49AzToGHyf_cWp0MiOmpD3cRUt8260QC2wj-Q@mail.gmail.com>
Hello Ard,
On Sat, Aug 25, 2018 at 11:17:42AM +0100, Ard Biesheuvel wrote:
> Do we really need a new crypto API for WireGuard? Surely, you yourself
> are not affected by these concerns, and I don't anticipate an
> explosion of new crypto use cases in the kernel that would justify
> maintaining two parallel crypto stacks.
Yes, we really do. And the new API won't be useful for WireGuard but
also for the majority of cryptography users within the kernel, which
will gradually be ported to use the new API.
> Also, I take it this means that WireGuard will only work with your
> routines? We don't usually impose that kind of policy in the kernel:
> on my arm64 systems, AES/GCM runs at 2.3 cycles per byte, which is a
> good enough reason to prefer it over a ChaCha20/Poly1305 based AEAD,
> even if your code is faster than the current code (which is debatable,
> as you know)
WireGuard is a protocol that specifies ChaPoly, and I am proposing an
implementation of that protocol. The protocol explicitly does not
specify other ciphers. Please read the whitepaper for extensive
discussion and feel free to come on over to wireguard@lists.zx2c4.com if
you really want to hardcore bikeshed on protocol particulars. The short
answer, however, is: no WireGuard won't be adding cipher negotiation,
and no, this isn't considered a good feature, and no, you won't have
any luck changing that. I am certain, though, that pushing this point
will be a terrific means of steering this implementation thread far off
course, as various folks with their various opinions feel compelled to
jump in about their thoughts on cipher negotiation. Yawn.
Besides, your claim about "impos[ing] that kind of policy in the kernel"
is bogus: with the exception of IPsec, dm-crypt, and AF_ALG, basically
all users of cryptography I can find are using a very particular set of
ciphers. For example, Bluetooth uses a particular elliptic curve that
has been specified by the Bluetooth people, and the kernel therefore
implements a driver that does computations over that elliptic curve.
Nobody on LKML is clamoring for that driver to also support Curve448 or
something, since that's not what Bluetooth specifies or how Bluetooth
works. So too, that's not what WireGuard specifies or how WireGuard
works.
> It also means that users of the crypto API will not benefit from your
> better code. I'm sure you agree that it is a bad idea to force those
> same crypto-impaired programmers to port their code to a new API.
As mentioned, I think we'll certainly be gradually porting existing
crypto API users over to the new API where appropriate. As always, this
is a gradual thing, and won't ever come all at once in the first
patchset, but I'm pretty confident we can get there somewhat quickly,
especially as new primitives become available in the new API.
> I also suggested that we work with Andy Polyakov (as I have in the
> past) to make the changes required for the kernel in the OpenSSL
> upstream. That way, we can take the .pl files unmodified, and benefit
> from the maintenance and review upstream. Dumping 10,000s of lines of
> generated assembler in the kernel tree like that is really
> unacceptable IMO.
I'm happy to do that, and indeed I do enjoy working with Andy. However,
I don't think your characterization of the current situation is at all
accurate. Rather, those .S files have been extensively worked with and
crafted. They're far from being merely generated, and they've been
pretty heavily reviewed.
> I'm not sure what the relevance of
> formally verified implementations is, though, since it only proves
> that the code is true to the algorithm, not that the algorithm is
> secure. Or am I missing something?
You are indeed missing something.
When the code is not true to the algorithm, that is very bad.
When the code is true to the algorithm, that is very good.
Formally verified implementations intend to increase our confidence
in the latter.
Meanwhile on the algorithm side of thing, the WireGuard protocol has a
number of proofs that the protocol is secure:
- https://www.wireguard.com/papers/wireguard-formal-verification.pdf
- https://www.wireguard.com/papers/dowling-paterson-computational-2018.pdf
- https://www.wireguard.com/formal-verification/
Before you get too excited though, keep in mind that this is a proof of
the protocol, and not of each primitive, like, say, "ChaCha20" or
"Curve25519." However, academic literature is full of all sorts of
curious and fascinating security analyses of the various primitives if
this is something you're interested in.
Jason
^ permalink raw reply
* Re: [PATCH] chtls: fix null dereference chtls_free_uld()
From: Herbert Xu @ 2018-08-25 13:27 UTC (permalink / raw)
To: Ganesh Goudar; +Cc: linux-crypto, netdev, davem, indranil, dt, Atul Gupta
In-Reply-To: <1533905861-27339-1-git-send-email-ganeshgr@chelsio.com>
On Fri, Aug 10, 2018 at 06:27:41PM +0530, Ganesh Goudar wrote:
> call chtls_free_uld() only for the initialized cdev,
> this fixes NULL dereference in chtls_free_uld()
>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
> Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Jason A. Donenfeld @ 2018-08-25 17:17 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: LKML, Netdev, David Miller, Andrew Lutomirski, Greg Kroah-Hartman,
Samuel Neves, Jean-Philippe Aumasson, Linux Crypto Mailing List
In-Reply-To: <20180825170629.GA8971@zx2c4.com>
Pressed send too fast.
On Sat, Aug 25, 2018 at 11:06 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> - https://www.wireguard.com/papers/wireguard-formal-verification.pdf
> - https://www.wireguard.com/papers/dowling-paterson-computational-2018.pdf
> - https://www.wireguard.com/formal-verification/
- https://www.wireguard.com/papers/lipp-computational-2018.pdf
- https://eprint.iacr.org/2018/766.pdf
^ permalink raw reply
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Andrew Lunn @ 2018-08-25 17:26 UTC (permalink / raw)
To: Jason A. Donenfeld
Cc: Eric Biggers, linux-kernel, netdev, davem, Andy Lutomirski,
Greg KH, Samuel Neves, Jean-Philippe Aumasson, linux-crypto
In-Reply-To: <20180825164005.GA7748@zx2c4.com>
On Sat, Aug 25, 2018 at 10:40:06AM -0600, Jason A. Donenfeld wrote:
> Hey Eric,
>
> On Fri, Aug 24, 2018 at 11:29:52PM -0700, Eric Biggers wrote:
> > I thought you were going to wrap lines at 80 characters? It's hard to read the
> > extremely long lines, and they encourage deep nesting.
>
> I somehow noted this for the WireGuard side of things but assumed I
> didn't need to do so for Zinc. Hah, such wishful thinking. I'll have
> this wrapped at 80 for v3.
Hi Jason
The coding style document applies to all code in the tree. Plus some
out of tree stuff, like iproute2 if, you need user space patches for
that.
I've been running checkpatch on just the network parts. But i expect
at some point, somebody will run it on the crypto stuff as well, and
ask you to fix up some of the errors and warning.
There is also a general trend that you won't get in detail human
reviews until the automated review tools indicate the code is O.K.,
Andrew
^ permalink raw reply
* TRADING ACCOUNT
From: KELLY ALAN @ 2018-08-25 14:32 UTC (permalink / raw)
To: kellyalan
Dear sir ,
I KELLY ALAN purchasing and sales manager of CFM INTERNATIONAL .Our
Company specialised in Supplying computer hardware and Electronic .We
want to extend our supplier list because of concurrency in prices on the
international market. We are seeking a supplier with whom we can to have
partnered long-term in order to have competitive prices . we are
interested to buy the products you sell and want to place an order with
you in big quantities.
Can you give us payment facilities ( 14 , 30 or 60 days payment terms )
?
What is the procedure for our account opening and credit line
application ?
Cordially
KELLY ALAN
CFM INTERNATIONAL
2 BOULEVARD DU GAL MARTIAL VALIN
75015 PARIS
REG N° 302 527 700
VAT N° FR90 302527700
TEL +33171025367
FAX +33177759149
https://www.cfmaeroengines.com
^ permalink raw reply
* Regression: youtube-dl hanging on download
From: Jan Janssen @ 2018-08-25 15:23 UTC (permalink / raw)
To: dsahern; +Cc: davem, kuznet, yoshfuji, netdev
Hi,
youtube-dl hangs trying to download videos from youtube. The commit below is
my regression test result. Disabling ipv6 indeed does fix this for me.
Jan
---
d4ead6b34b67fd711639324b6465a050bcb197d4 is the first bad commit
commit d4ead6b34b67fd711639324b6465a050bcb197d4
Author: David Ahern <dsahern@gmail.com>
Date: Tue Apr 17 17:33:16 2018 -0700
net/ipv6: move metrics from dst to rt6_info
Similar to IPv4, add fib metrics to the fib struct, which at the moment
is rt6_info. Will be moved to fib6_info in a later patch. Copy metrics
into dst by reference using refcount.
To make the transition:
- add dst_metrics to rt6_info. Default to dst_default_metrics if no
metrics are passed during route add. No need for a separate pmtu
entry; it can reference the MTU slot in fib6_metrics
- ip6_convert_metrics allocates memory in the FIB entry and uses
ip_metrics_convert to copy from netlink attribute to metrics entry
- the convert metrics call is done in ip6_route_info_create simplifying
the route add path
+ fib6_commit_metrics and fib6_copy_metrics and the temporary
mx6_config are no longer needed
- add fib6_metric_set helper to change the value of a metric in the
fib entry since dst_metric_set can no longer be used
- cow_metrics for IPv6 can drop to dst_cow_metrics_generic
- rt6_dst_from_metrics_check is no longer needed
- rt6_fill_node needs the FIB entry and dst as separate arguments to
keep compatibility with existing output. Current dst address is
renamed to dest.
(to be consistent with IPv4 rt6_fill_node really should be split
into 2 functions similar to fib_dump_info and rt_fill_info)
- rt6_fill_node no longer needs the temporary metrics variable
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
:040000 040000 1256a75be6bb5b9f3ef5b38ff75cfd10aba1a856
d6cc99cbefe99bb3a5c1b73b6dcccd8ec0816ec5 M include
:040000 040000 36a3fa59bea55e68c88a4fe2d1ac653fa8a50705
cdbd8a8aa4d8bc2e8abf6bdf18b30388a957183c M net
^ permalink raw reply
* Re: Regression: youtube-dl hanging on download
From: David Ahern @ 2018-08-25 15:47 UTC (permalink / raw)
To: Jan Janssen; +Cc: davem, kuznet, yoshfuji, netdev
In-Reply-To: <36553198.DNrMIUSMyK@minako>
On 8/25/18 9:23 AM, Jan Janssen wrote:
> Hi,
>
> youtube-dl hangs trying to download videos from youtube. The commit below is
> my regression test result. Disabling ipv6 indeed does fix this for me.
>
Thanks for the report. Can you boot a pre-4.18 kernel and send me,
offlist, the output of 'ip -6 ro ls table all'?
^ permalink raw reply
* Re: [net 01/11] ixgb: use dma_zalloc_coherent instead of allocator/memset
From: Joe Perches @ 2018-08-25 15:49 UTC (permalink / raw)
To: Jeff Kirsher, davem; +Cc: YueHaibing, netdev, nhorman, sassmann, jogreene
In-Reply-To: <20180824184735.32175-2-jeffrey.t.kirsher@intel.com>
On Fri, 2018-08-24 at 11:47 -0700, Jeff Kirsher wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Use dma_zalloc_coherent instead of dma_alloc_coherent
> followed by memset 0.
Unrelated trivia: above this, perhaps the
size = sizeof(struct ixgb_buffer) * txdr->count;
txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info)
return -ENOMEM;
should be changed to kvzalloc to avoid using vzalloc where
possible, with the appropriate vfree/kvfree conversions.
Perhaps across all intel drivers:
$ git grep -n "\bv.alloc(" drivers/net/ethernet/intel
drivers/net/ethernet/intel/e1000/e1000_main.c:1499: txdr->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/e1000/e1000_main.c:1689: rxdr->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/e1000e/ethtool.c:705: temp_tx = vmalloc(size);
drivers/net/ethernet/intel/e1000e/ethtool.c:712: temp_rx = vmalloc(size);
drivers/net/ethernet/intel/e1000e/netdev.c:2328: tx_ring->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/e1000e/netdev.c:2363: rx_ring->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c:561: temp_ring = vmalloc(array_size(i, sizeof(struct fm10k_ring)));
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c:22: tx_ring->tx_buffer = vzalloc(size);
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c:90: rx_ring->rx_buffer = vzalloc(size);
drivers/net/ethernet/intel/igb/igb_ethtool.c:905: temp_ring = vmalloc(array_size(sizeof(struct igb_ring),
drivers/net/ethernet/intel/igb/igb_ethtool.c:908: temp_ring = vmalloc(array_size(sizeof(struct igb_ring),
drivers/net/ethernet/intel/igb/igb_main.c:4075: tx_ring->tx_buffer_info = vmalloc(size);
drivers/net/ethernet/intel/igb/igb_main.c:4224: rx_ring->rx_buffer_info = vmalloc(size);
drivers/net/ethernet/intel/igbvf/ethtool.c:226: temp_ring = vmalloc(sizeof(struct igbvf_ring));
drivers/net/ethernet/intel/igbvf/netdev.c:421: tx_ring->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/igbvf/netdev.c:459: rx_ring->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/ixgb/ixgb_main.c:682: txdr->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/ixgb/ixgb_main.c:765: rxdr->buffer_info = vzalloc(size);
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c:1074: temp_ring = vmalloc(array_size(i, sizeof(struct ixgbe_ring)));
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:6352: tx_ring->tx_buffer_info = vmalloc(size);
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:6446: rx_ring->rx_buffer_info = vmalloc(size);
drivers/net/ethernet/intel/ixgbevf/ethtool.c:285: tx_ring = vmalloc(array_size(sizeof(*tx_ring),
drivers/net/ethernet/intel/ixgbevf/ethtool.c:331: rx_ring = vmalloc(array_size(sizeof(*rx_ring),
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:3373: tx_ring->tx_buffer_info = vmalloc(size);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:3451: rx_ring->rx_buffer_info = vmalloc(size);
^ permalink raw reply
* Re: [PATCH v2 02/17] zinc: introduce minimal cryptography library
From: Jason A. Donenfeld @ 2018-08-25 16:40 UTC (permalink / raw)
To: Eric Biggers
Cc: linux-kernel, netdev, davem, Andy Lutomirski, Greg KH,
Samuel Neves, Jean-Philippe Aumasson, linux-crypto
In-Reply-To: <20180825062951.GC726@sol.localdomain>
Hey Eric,
On Fri, Aug 24, 2018 at 11:29:52PM -0700, Eric Biggers wrote:
> I thought you were going to wrap lines at 80 characters? It's hard to read the
> extremely long lines, and they encourage deep nesting.
I somehow noted this for the WireGuard side of things but assumed I
didn't need to do so for Zinc. Hah, such wishful thinking. I'll have
this wrapped at 80 for v3.
> As I said before, I still think you need to switch the crypto API ChaCha20 and
> Poly1305 over to use the new implementations. It's not okay to have two
> completely different sets of ChaCha20 and Poly1305 implementations just because
> you want a different API, so you might as well get started on it... The thing
> is that before you try it, it's not clear what problems will come up that
> require changes to the design. So, this really ought to be addressed up-front.
It was my hope that this entire series could enter the tree through
Dave's net-next, and that I wouldn't have to touch anything in crypto/ or
touch any of Herbert's stuff at all in anyway. However, if you want, I
can start to play with that in another branch for a separate patchset,
and of course I'd really value your feedback on that and on doing it
right.
> It's also not clearly explained whether/why/how the new ChaCha20 and Poly1305
> implementations are better than the existing ones. The patch adding the ARM and
> ARM64 ChaCha, for example, just says who wrote them, with no mention of why the
> particular implementations were chosen.
I can expand on that, sure. One primary advantage that I do touch on on
the big introductory commit message, though, is that sharing code means
that we benefit from the eyeballs and fuzzing hours spent on OpenSSL,
and I think this general advantage is extremely compelling.
> You've also documented a lot of stuff in commit messages which will be lost as
> it isn't being added to the source itself. There are various examples of this,
> such as information about where the various implementations came from, what you
> changed, why a particular implementation isn't used on Skylake or whatever, etc.
> Can you please make sure that any important information is in comments, e.g. at
> the top of the files?
Good idea. I'll do that for v3.
> I still think the "Zinc" name is confusing and misleading, and people are going
> to forget that it means "crypto". lib/crypto/ would be more intuitive.
> But I don't care *that* much myself, and you should see what others think...
I'd like to keep it. It also enables a natural path for a corresponding
userspace library that shares all of the same code, and one that I think
will be compelling to attract academics and developers to contributing
to these efforts. Plus, can't I name what I made?
> It seems you still don't explicitly clarify anywhere in the source itself that
> the copyright holders of the code from OpenSSL have relicensed it under GPLv2.
> I only see a GPLv2 license slapped on the files, yet no such license is presence
> in the OpenSSL originals, at least in the one I checked.
The SPDX headers for those came out of a discussion on how to encode
CRYPTOGAMS into SPDX from the SPDX mailing list several months ago.
> If you did receive
> explicit permission, then you should include an explicit clarification in each
> file like the one in arch/arm/crypto/sha1-armv4-large.S.
That's a good idea.
> As Ard and I discussed recently on my patch
> "crypto: arm/poly1305 - add NEON accelerated Poly1305 implementation"
> which proposed adding the exact same poly1305-arm.S file, for all the OpenSSL
> assembly it would probably be better to include the .pl file and generate the .S
> file as part of the build process. For one, there is semantic information like
> register names in the .pl script that is lost in the .S file, thereby making the
> .S file less readable.
But on the other hand, the .S files have been modified and changed to
fit kernel constraints and conventions. They're very much no longer
merely "generated". This is most apparent with the x86_64 files, but is
present too with the ARM files. We're still, I believe, bug-for-bug
similar to the originals -- keeping with the point of going with Andy's
implementations in the first place -- and we've been able to pretty
trivially track OpenSSL changes -- but nonetheless important tweaks have
been done to make this suitable to kernel space.
> There are still some alignment bugs where integers are loaded from byte arrays
> without using the unaligned access macros, e.g. in chacha20_init(),
> hchacha20_generic(), and fe_frombytes_impl(). I found these grepping for
> le32_to_cpu. Interestingly, that last one is in "formally verified" code :-)
Thanks. I'll do another pass at these for v3.
Jason
^ permalink raw reply
* Re: [PATCH NET 3/3] net: hns: add configuration constraints for 1000M half
From: Andrew Lunn @ 2018-08-25 18:07 UTC (permalink / raw)
To: lipeng (Y)
Cc: davem, netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta
In-Reply-To: <7c40c758-2ef2-665d-f429-0cc4e63a7a38@huawei.com>
> This patch is a theoretical protect, and the problem does not really
> happen.
>
> I think you really get the point, do you think we need this patch?
I think it is not needed.
And if it was needed, it would indicate there is a bug somewhere else.
Andrew
^ permalink raw reply
* Re: [PATCH 1/1] net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6
From: santosh.shilimkar @ 2018-08-25 19:24 UTC (permalink / raw)
To: Zhu Yanjun, davem, netdev, linux-rdma, rds-devel
In-Reply-To: <20180825071905.2749-1-yanjun.zhu@oracle.com>
On 8/25/18 12:19 AM, Zhu Yanjun wrote:
> In IPv4, the newly introduced rdma_read_gids is used to read the SGID/DGID
> for the connection which returns GID correctly for RoCE transport as well.
>
> In IPv6, rdma_read_gids is also used. The following are why rdma_read_gids
> is introduced.
>
> rdma_addr_get_dgid() for RoCE for client side connections returns MAC
> address, instead of DGID.
> rdma_addr_get_sgid() for RoCE doesn't return correct SGID for IPv6 and
> when more than one IP address is assigned to the netdevice.
>
> So the transport agnostic rdma_read_gids() API is provided by rdma_cm
> module.
>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
Looks ok.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
^ permalink raw reply
* Re: [PATCH v2] Revert "net: stmmac: fix build failure due to missing COMMON_CLK dependency"
From: David Miller @ 2018-08-26 0:33 UTC (permalink / raw)
To: geert
Cc: peppe.cavallaro, alexandre.torgue, joabreu, arnd, netdev,
linux-kernel
In-Reply-To: <20180822132723.30047-1-geert@linux-m68k.org>
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 22 Aug 2018 15:27:23 +0200
> This reverts commit bde4975310eb1982bd0bbff673989052d92fd481.
>
> All legacy clock implementations now implement clk_set_rate() (Some
> implementations may be dummies, though).
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Acked-by: Arnd Bergmann <arnd@arnd.de>
> Acked-by: Jose Abreu <joabreu@synopsys.com>
> ---
> Marked "RFC", as this depends on "m68k: coldfire: Normalize clk API" and
> "MIPS: AR7: Normalize clk API".
>
> v2:
> - Add Acked-by,
> - Dropped RFC state, as all dependencies are now upstream:
> - commit eec85fa9d98a889e ("m68k: coldfire: Normalize clk API"),
> - commit 6b5939d2e528525a ("MIPS: AR7: Normalize clk API").
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net] tipc: fix the big/little endian issue in tipc_dest
From: David Miller @ 2018-08-26 0:36 UTC (permalink / raw)
To: Haiqing.Bai; +Cc: netdev, jon.maloy, ying.xue, zhenbo.gao, linux-kernel
In-Reply-To: <1535014158-18578-1-git-send-email-Haiqing.Bai@windriver.com>
From: Haiqing Bai <Haiqing.Bai@windriver.com>
Date: Thu, 23 Aug 2018 16:49:18 +0800
> Fixes: d06b2fa34f18 ("tipc: improve destination linked list")
Please fix this:
[davem@localhost net]$ git describe d06b2fa34f18
fatal: Not a valid object name d06b2fa34f18
^ permalink raw reply
* Re: [PATCH net] vhost: correctly check the iova range when waking virtqueue
From: David Miller @ 2018-08-26 0:40 UTC (permalink / raw)
To: jasowang; +Cc: mst, kvm, virtualization, netdev, linux-kernel, peterx
In-Reply-To: <20180824085313.21798-1-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Fri, 24 Aug 2018 16:53:13 +0800
> We don't wakeup the virtqueue if the first byte of pending iova range
> is the last byte of the range we just got updated. This will lead a
> virtqueue to wait for IOTLB updating forever. Fixing by correct the
> check and wake up the virtqueue in this case.
>
> Fixes: 6b1e6cc7855b ("vhost: new device IOTLB API")
> Reported-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> The patch is needed for -stable.
Applied and queued up for -stable, thanks Jason.
^ permalink raw reply
* Re: [PATCH] qed: fix spelling mistake "comparsion" -> "comparison"
From: David Miller @ 2018-08-26 0:41 UTC (permalink / raw)
To: colin.king
Cc: Ariel.Elior, everest-linux-l2, netdev, kernel-janitors,
linux-kernel
In-Reply-To: <20180824111830.8657-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Fri, 24 Aug 2018 12:18:30 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in DP_ERR error message
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks Colin.
^ permalink raw reply
* Re: [PATCH net] mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge
From: David Miller @ 2018-08-25 23:29 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, petrm, alexpe, mlxsw
In-Reply-To: <20180824124135.5203-1-idosch@mellanox.com>
From: Ido Schimmel <idosch@mellanox.com>
Date: Fri, 24 Aug 2018 15:41:35 +0300
> When a bridge device is removed, the VLANs are flushed from each
> configured port. This causes the ports to decrement the reference count
> on the associated FIDs (filtering identifier). If the reference count of
> a FID is 1 and it has a RIF (router interface), then this RIF is
> destroyed.
>
> However, if no port is member in the VLAN for which a RIF exists, then
> the RIF will continue to exist after the removal of the bridge. To
> reproduce:
>
> # ip link add name br0 type bridge vlan_filtering 1
> # ip link set dev swp1 master br0
> # ip link add link br0 name br0.10 type vlan id 10
> # ip address add 192.0.2.0/24 dev br0.10
> # ip link del dev br0
>
> The RIF associated with br0.10 continues to exist.
>
> Fix this by iterating over all the bridge device uppers when it is
> destroyed and take care of destroying their RIFs.
>
> Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Reviewed-by: Petr Machata <petrm@mellanox.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox