18 Jul, 2016

5 commits

  • The blkcipher null object is no longer used and can now be removed.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch adds an skcipher null object alongside the existing
    null blkcipher so that IV generators using it can switch over
    to skcipher.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch adds a chunk size parameter to aead algorithms, just
    like the chunk size for skcipher algorithms.

    However, unlike skcipher we do not currently export this to AEAD
    users. It is only meant to be used by AEAD implementors for now.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • Current the default null skcipher is actually a crypto_blkcipher.
    This patch creates a synchronous crypto_skcipher version of the
    null cipher which unfortunately has to settle for the name skcipher2.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch allows skcipher algorithms and instances to be created
    and registered with the crypto API. They are accessible through
    the top-level skcipher interface, along with ablkcipher/blkcipher
    algorithms and instances.

    This patch also introduces a new parameter called chunk size
    which is meant for ciphers such as CTR and CTS which ostensibly
    can handle arbitrary lengths, but still behave like block ciphers
    in that you can only process a partial block at the very end.

    For these ciphers the block size will continue to be set to 1
    as it is now while the chunk size will be set to the underlying
    block size.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

05 Jul, 2016

1 commit


01 Jul, 2016

2 commits

  • Every implementation of RSA that we have naturally generates
    output with leading zeroes. The one and only user of RSA,
    pkcs1pad wants to have those leading zeroes in place, in fact
    because they are currently absent it has to write those zeroes
    itself.

    So we shouldn't be stripping leading zeroes in the first place.
    In fact this patch makes rsa-generic produce output with fixed
    length so that pkcs1pad does not need to do any extra work.

    This patch also changes DH to use the new interface.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch adds the helper crypto_inst_setname because the current
    helper crypto_alloc_instance2 is no longer useful given that we
    now look up the algorithm after we allocate the instance object.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

23 Jun, 2016

5 commits

  • * Implement ECDH under kpp API
    * Provide ECC software support for curve P-192 and
    P-256.
    * Add kpp test for ECDH with data generated by OpenSSL

    Signed-off-by: Salvatore Benedetto
    Signed-off-by: Herbert Xu

    Salvatore Benedetto
     
  • * Implement MPI based Diffie-Hellman under kpp API
    * Test provided uses data generad by OpenSSL

    Signed-off-by: Salvatore Benedetto
    Signed-off-by: Herbert Xu

    Salvatore Benedetto
     
  • Add key-agreement protocol primitives (kpp) API which allows to
    implement primitives required by protocols such as DH and ECDH.
    The API is composed mainly by the following functions
    * set_secret() - It allows the user to set his secret, also
    referred to as his private key, along with the parameters
    known to both parties involved in the key-agreement session.
    * generate_public_key() - It generates the public key to be sent to
    the other counterpart involved in the key-agreement session. The
    function has to be called after set_params() and set_secret()
    * generate_secret() - It generates the shared secret for the session

    Other functions such as init() and exit() are provided for allowing
    cryptographic hardware to be inizialized properly before use

    Signed-off-by: Salvatore Benedetto
    Signed-off-by: Herbert Xu

    Salvatore Benedetto
     
  • Herbert wants the sha1-mb algorithm to have an async implementation:
    https://lkml.org/lkml/2016/4/5/286.
    Currently, sha1-mb uses an async interface for the outer algorithm
    and a sync interface for the inner algorithm. This patch introduces
    a async interface for even the inner algorithm.

    Signed-off-by: Megha Dey
    Signed-off-by: Tim Chen
    Signed-off-by: Herbert Xu

    Megha Dey
     
  • This patch adds helpers to check whether a given tfm is currently
    queued. This is meant to be used by ablk_helper and similar
    entities to ensure that no reordering is introduced because of
    requests queued in cryptd with respect to requests being processed
    in softirq context.

    The per-cpu queue length limit is also increased to 1000 in line
    with network limits.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

20 Jun, 2016

1 commit

  • This patch adds the implementation of SHA3 algorithm
    in software and it's based on original implementation
    pushed in patch https://lwn.net/Articles/518415/ with
    additional changes to match the padding rules specified
    in SHA-3 specification.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Raveendra Padasalagi
    Signed-off-by: Herbert Xu

    Jeff Garzik
     

15 Jun, 2016

3 commits

  • Return the raw key with no other processing so that the caller
    can copy it or MPI parse it, etc.

    The scope is to have only one ANS.1 parser for all RSA
    implementations.

    Update the RSA software implementation so that it does
    the MPI conversion on top.

    Signed-off-by: Tudor Ambarus
    Signed-off-by: Herbert Xu

    Tudor Ambarus
     
  • Hardware cipher implementation may require aligned buffers. All buffers
    that potentially are processed with a cipher are now aligned.

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     
  • The CTR DRBG derives its random data from the CTR that is encrypted with
    AES.

    This patch now changes the CTR DRBG implementation such that the
    CTR AES mode is employed. This allows the use of steamlined CTR AES
    implementation such as ctr-aes-aesni.

    Unfortunately there are the following subtile changes we need to apply
    when using the CTR AES mode:

    - the CTR mode increments the counter after the cipher operation, but
    the CTR DRBG requires the increment before the cipher op. Hence, the
    crypto_inc is applied to the counter (drbg->V) once it is
    recalculated.

    - the CTR mode wants to encrypt data, but the CTR DRBG is interested in
    the encrypted counter only. The full CTR mode is the XOR of the
    encrypted counter with the plaintext data. To access the encrypted
    counter, the patch uses a NULL data vector as plaintext to be
    "encrypted".

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     

07 Jun, 2016

1 commit


31 May, 2016

3 commits

  • mpi_set_buffer() has no in-tree users and similar functionality is provided
    by mpi_read_raw_data().

    Remove mpi_set_buffer().

    Signed-off-by: Nicolai Stange
    Signed-off-by: Herbert Xu

    Nicolai Stange
     
  • This will allow device drivers to consistently use io{read,write}XX
    also for 64-bit accesses.

    Acked-by: Arnd Bergmann
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Horia Geantă
     
  • While reviewing the addition of io{read,write}64be accessors, Arnd

    -finds a potential problem:
    "If an architecture overrides readq/writeq to have barriers but does
    not override ioread64be/iowrite64be, this will lack the barriers and
    behave differently from the little-endian version. I think the only
    affected architecture is ARC, since ARM and ARM64 both override the
    big-endian accessors to have the correct barriers, and all others
    don't use barriers at all."

    -suggests a fix for the same problem in existing code (16/32-bit
    accessors); the fix leads "to a double-swap on architectures that
    don't override the io{read,write}{16,32}be accessors, but it will
    work correctly on all architectures without them having to override
    these accessors."

    Suggested-by: Arnd Bergmann
    Acked-by: Arnd Bergmann
    Signed-off-by: Horia Geantă
    Signed-off-by: Herbert Xu

    Horia Geantă
     

29 May, 2016

11 commits

  • Pull string hash improvements from George Spelvin:
    "This series does several related things:

    - Makes the dcache hash (fs/namei.c) useful for general kernel use.

    (Thanks to Bruce for noticing the zero-length corner case)

    - Converts the string hashes in to use the
    above.

    - Avoids 64-bit multiplies in hash_64() on 32-bit platforms. Two
    32-bit multiplies will do well enough.

    - Rids the world of the bad hash multipliers in hash_32.

    This finishes the job started in commit 689de1d6ca95 ("Minimal
    fix-up of bad hashing behavior of hash_64()")

    The vast majority of Linux architectures have hardware support for
    32x32-bit multiply and so derive no benefit from "simplified"
    multipliers.

    The few processors that do not (68000, h8/300 and some models of
    Microblaze) have arch-specific implementations added. Those
    patches are last in the series.

    - Overhauls the dcache hash mixing.

    The patch in commit 0fed3ac866ea ("namei: Improve hash mixing if
    CONFIG_DCACHE_WORD_ACCESS") was an off-the-cuff suggestion.
    Replaced with a much more careful design that's simultaneously
    faster and better. (My own invention, as there was noting suitable
    in the literature I could find. Comments welcome!)

    - Modify the hash_name() loop to skip the initial HASH_MIX(). This
    would let us salt the hash if we ever wanted to.

    - Sort out partial_name_hash().

    The hash function is declared as using a long state, even though
    it's truncated to 32 bits at the end and the extra internal state
    contributes nothing to the result. And some callers do odd things:

    - fs/hfs/string.c only allocates 32 bits of state
    - fs/hfsplus/unicode.c uses it to hash 16-bit unicode symbols not bytes

    - Modify bytemask_from_count to handle inputs of 1..sizeof(long)
    rather than 0..sizeof(long)-1. This would simplify users other
    than full_name_hash"

    Special thanks to Bruce Fields for testing and finding bugs in v1. (I
    learned some humbling lessons about "obviously correct" code.)

    On the arch-specific front, the m68k assembly has been tested in a
    standalone test harness, I've been in contact with the Microblaze
    maintainers who mostly don't care, as the hardware multiplier is never
    omitted in real-world applications, and I haven't heard anything from
    the H8/300 world"

    * 'hash' of git://ftp.sciencehorizons.net/linux:
    h8300: Add
    microblaze: Add
    m68k: Add
    : Add support for architecture-specific functions
    fs/namei.c: Improve dcache hash function
    Eliminate bad hash multipliers from hash_32() and hash_64()
    Change hash_64() return value to 32 bits
    : Define hash_str() in terms of hashlen_string()
    fs/namei.c: Add hashlen_string() function
    Pull out string hash to

    Linus Torvalds
     
  • This is just the infrastructure; there are no users yet.

    This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
    the existence of .

    That file may define its own versions of various functions, and define
    HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.

    Included is a self-test (in lib/test_hash.c) that verifies the basics.
    It is NOT in general required that the arch-specific functions compute
    the same thing as the generic, but if a HAVE_* symbol is defined with
    the value 1, then equality is tested.

    Signed-off-by: George Spelvin
    Cc: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc: Andreas Schwab
    Cc: Philippe De Muyter
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: Alistair Francis
    Cc: Michal Simek
    Cc: Yoshinori Sato
    Cc: uclinux-h8-devel@lists.sourceforge.jp

    George Spelvin
     
  • The "simplified" prime multipliers made very bad hash functions, so get rid
    of them. This completes the work of 689de1d6ca.

    To avoid the inefficiency which was the motivation for the "simplified"
    multipliers, hash_64() on 32-bit systems is changed to use a different
    algorithm. It makes two calls to hash_32() instead.

    drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
    for some horrible reason, so it inherits a copy of the old definition.

    Signed-off-by: George Spelvin
    Cc: Antti Palosaari
    Cc: Mauro Carvalho Chehab

    George Spelvin
     
  • That's all that's ever asked for, and it makes the return
    type of hash_long() consistent.

    It also allows (upcoming patch) an optimized implementation
    of hash_64 on 32-bit machines.

    I tried adding a BUILD_BUG_ON to ensure the number of bits requested
    was never more than 32 (most callers use a compile-time constant), but
    adding to breaks the tools/perf compiler
    unless tools/perf/MANIFEST is updated, and understanding that code base
    well enough to update it is too much trouble. I did the rest of an
    allyesconfig build with such a check, and nothing tripped.

    Signed-off-by: George Spelvin

    George Spelvin
     
  • Finally, the first use of previous two patches: eliminate the
    separate ad-hoc string hash functions in the sunrpc code.

    Now hash_str() is a wrapper around hash_string(), and hash_mem() is
    likewise a wrapper around full_name_hash().

    Note that sunrpc code *does* call hash_mem() with a zero length, which
    is why the previous patch needed to handle that in full_name_hash().
    (Thanks, Bruce, for finding that!)

    This also eliminates the only caller of hash_long which asks for
    more than 32 bits of output.

    The comment about the quality of hashlen_string() and full_name_hash()
    is jumping the gun by a few patches; they aren't very impressive now,
    but will be improved greatly later in the series.

    Signed-off-by: George Spelvin
    Tested-by: J. Bruce Fields
    Acked-by: J. Bruce Fields
    Cc: Jeff Layton
    Cc: linux-nfs@vger.kernel.org

    George Spelvin
     
  • We'd like to make more use of the highly-optimized dcache hash functions
    throughout the kernel, rather than have every subsystem create its own,
    and a function that hashes basic null-terminated strings is required
    for that.

    (The name is to emphasize that it returns both hash and length.)

    It's actually useful in the dcache itself, specifically d_alloc_name().
    Other uses in the next patch.

    full_name_hash() is also tweaked to make it more generally useful:
    1) Take a "char *" rather than "unsigned char *" argument, to
    be consistent with hash_name().
    2) Handle zero-length inputs. If we want more callers, we don't want
    to make them worry about corner cases.

    Signed-off-by: George Spelvin

    George Spelvin
     
  • ... so they can be used without the rest of

    The hashlen_* macros will make sense next patch.

    Signed-off-by: George Spelvin

    George Spelvin
     
  • Pull chrome platform updates from Olof Johansson
    "A handful of Chrome driver and binding changes this merge window:

    - a few patches to fix probing and configuration of pstore

    - a few patches adding Elan touchpad registration on a few devices

    - EC changes: a security fix dealing with max message sizes and
    addition of compat_ioctl support.

    - keyboard backlight control support

    There was also an accidential duplicate registration of trackpads on
    'Leon', which was reverted just recently"

    * tag 'chrome-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
    Revert "platform/chrome: chromeos_laptop: Add Leon Touch"
    platform/chrome: chromeos_laptop - Add Elan touchpad for Wolf
    platform/chrome: chromeos_laptop - Add elan trackpad option for C720
    platform/chrome: cros_ec_dev - Populate compat_ioctl
    platform/chrome: cros_ec_lightbar - use name instead of ID to hide lightbar attributes
    platform/chrome: cros_ec_dev - Fix security issue
    platform/chrome: Add Chrome OS keyboard backlight LEDs support
    platform/chrome: use to_platform_device()
    platform/chrome: pstore: Move to larger record size.
    platform/chrome: pstore: probe for ramoops buffer using acpi
    platform/chrome: chromeos_laptop: Add Leon Touch

    Linus Torvalds
     
  • Pull more sound updates from Takashi Iwai:
    "This is the second update round for 4.7-rc1. Most of changes are
    about the pending ASoC updates and fixes, including a few new drivers.
    Below are some highlights:

    ASoC:
    - New drivers for MAX98371 and TAS5720
    - SPI support for TLV320AIC32x4, along with the module split
    - TDM support for STI Uniperf IPs
    - Remaining topology API fixes / updates

    HDA:
    - A couple of Dell quirks and new Realtek codec support"

    * tag 'sound-4.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (63 commits)
    ALSA: hda - Fix headset mic detection problem for one Dell machine
    spi: spi-ep93xx: Fix the PTR_ERR() argument
    ALSA: hda/realtek - Add support for ALC295/ALC3254
    ASoC: kirkwood: fix build failure
    ALSA: hda - Fix headphone noise on Dell XPS 13 9360
    ASoC: ak4642: Enable cache usage to fix crashes on resume
    ASoC: twl6040: Disconnect AUX output pads on digital mute
    ASoC: tlv320aic32x4: Properly implement the positive and negative pins into the mixers
    rcar: src: skip disabled-SRC nodes
    ASoC: max98371 Remove duplicate entry in max98371_reg
    ASoC: twl6040: Select LPPLL during standby
    ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS
    ASoC: simple-card: Add pm callbacks to platform driver
    ASoC: pxa: Fix module autoload for platform drivers
    ASoC: topology: Fix memory leak in widget creation
    ASoC: Add max98371 codec driver
    ASoC: rsnd: count .probe/.remove for rsnd_mod_call()
    ASoC: topology: Check size mismatch of ABI objects before parsing
    ASoC: topology: Check failure to create a widget
    ASoC: add support for TAS5720 digital amplifier
    ...

    Linus Torvalds
     
  • Pull SCSI target updates from Nicholas Bellinger:
    "Here are the outstanding target pending updates for v4.7-rc1.

    The highlights this round include:

    - Allow external PR/ALUA metadata path be defined at runtime via top
    level configfs attribute (Lee)
    - Fix target session shutdown bug for ib_srpt multi-channel (hch)
    - Make TFO close_session() and shutdown_session() optional (hch)
    - Drop se_sess->sess_kref + convert tcm_qla2xxx to internal kref
    (hch)
    - Add tcm_qla2xxx endpoint attribute for basic FC jammer (Laurence)
    - Refactor iscsi-target RX/TX PDU encode/decode into common code
    (Varun)
    - Extend iscsit_transport with xmit_pdu, release_cmd, get_rx_pdu,
    validate_parameters, and get_r2t_ttt for generic ISO offload
    (Varun)
    - Initial merge of cxgb iscsi-segment offload target driver (Varun)

    The bulk of the changes are Chelsio's new driver, along with a number
    of iscsi-target common code improvements made by Varun + Co along the
    way"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (29 commits)
    iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race
    cxgbit: Use type ISCSI_CXGBIT + cxgbit tpg_np attribute
    iscsi-target: Convert transport drivers to signal rdma_shutdown
    iscsi-target: Make iscsi_tpg_np driver show/store use generic code
    tcm_qla2xxx Add SCSI command jammer/discard capability
    iscsi-target: graceful disconnect on invalid mapping to iovec
    target: need_to_release is always false, remove redundant check and kfree
    target: remove sess_kref and ->shutdown_session
    iscsi-target: remove usage of ->shutdown_session
    tcm_qla2xxx: introduce a private sess_kref
    target: make close_session optional
    target: make ->shutdown_session optional
    target: remove acl_stop
    target: consolidate and fix session shutdown
    cxgbit: add files for cxgbit.ko
    iscsi-target: export symbols
    iscsi-target: call complete on conn_logout_comp
    iscsi-target: clear tx_thread_active
    iscsi-target: add new offload transport type
    iscsi-target: use conn_transport->transport_type in text rsp
    ...

    Linus Torvalds
     
  • Pull more rdma updates from Doug Ledford:
    "This is the second group of code for the 4.7 merge window. It looks
    large, but only in one sense. I'll get to that in a minute. The list
    of changes here breaks down as follows:

    - Dynamic counter infrastructure in the IB drivers

    This is a sysfs based code to allow free form access to the
    hardware counters RDMA devices might support so drivers don't need
    to code this up repeatedly themselves

    - SendOnlyFullMember multicast support

    - IB router support

    - A couple misc fixes

    - The big item on the list: hfi1 driver updates, plus moving the hfi1
    driver out of staging

    There was a group of 15 patches in the hfi1 list that I thought I had
    in the first pull request but they weren't. So that added to the
    length of the hfi1 section here.

    As far as these go, everything but the hfi1 is pretty straight
    forward.

    The hfi1 is, if you recall, the driver that Al had complaints about
    how it used the write/writev interfaces in an overloaded fashion. The
    write portion of their interface behaved like the write handler in the
    IB stack proper and did bi-directional communications. The writev
    interface, on the other hand, only accepts SDMA request structures.
    The completions for those structures are sent back via an entirely
    different event mechanism.

    With the security patch, we put security checks on the write
    interface, however, we also knew they would be going away soon. Now,
    we've converted the write handler in the hfi1 driver to use ioctls
    from the IB reserved magic area for its bidirectional communications.
    With that change, Intel has addressed all of the items originally on
    their TODO when they went into staging (as well as many items added to
    the list later).

    As such, I moved them out, and since they were the last item in the
    staging/rdma directory, and I don't have immediate plans to use the
    staging area again, I removed the staging/rdma area.

    Because of the move out of staging, as well as a series of 5 patches
    in the hfi1 driver that removed code people thought should be done in
    a different way and was optional to begin with (a snoop debug
    interface, an eeprom driver for an eeprom connected directory to their
    hfi1 chip and not via an i2c bus, and a few other things like that),
    the line count, especially the removal count, is high"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (56 commits)
    staging/rdma: Remove the entire rdma subdirectory of staging
    IB/core: Make device counter infrastructure dynamic
    IB/hfi1: Fix pio map initialization
    IB/hfi1: Correct 8051 link parameter settings
    IB/hfi1: Update pkey table properly after link down or FM start
    IB/rdamvt: Fix rdmavt s_ack_queue sizing
    IB/rdmavt: Max atomic value should be a u8
    IB/hfi1: Fix hard lockup due to not using save/restore spin lock
    IB/hfi1: Add tracing support for send with invalidate opcode
    IB/hfi1, qib: Add ieth to the packet header definitions
    IB/hfi1: Move driver out of staging
    IB/hfi1: Do not free hfi1 cdev parent structure early
    IB/hfi1: Add trace message in user IOCTL handling
    IB/hfi1: Remove write(), use ioctl() for user cmds
    IB/hfi1: Add ioctl() interface for user commands
    IB/hfi1: Remove unused user command
    IB/hfi1: Remove snoop/diag interface
    IB/hfi1: Remove EPROM functionality from data device
    IB/hfi1: Remove UI char device
    IB/hfi1: Remove multiple device cdev
    ...

    Linus Torvalds
     

28 May, 2016

8 commits

  • Pull more i2c updates from Wolfram Sang:
    "Here is the second pull request from I2C for this merge window:

    - one new feature (which nearly fell through the cracks): i2c-dev
    does now use the cdev API so it can handle >256 minors. Seems
    people do need that.

    - two fixes for the just added DMA feature for i2c-rcar

    - some typo fixes"

    * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
    i2c: dev: don't start function name with 'return'
    i2c: dev: switch from register_chrdev to cdev API
    i2c: xlr: rename ARCH_TANGOX to ARCH_TANGO
    i2c: at91: change log when dma configuration fails
    misc: at24: Fix typo in at24 header file
    i2c: rcar: should depend on HAS_DMA
    i2c: rcar: use dma_request_chan()

    Linus Torvalds
     
  • Pull vfs fixes from Al Viro:
    "Followups to the parallel lookup work:

    - update docs

    - restore killability of the places that used to take ->i_mutex
    killably now that we have down_write_killable() merged

    - Additionally, it turns out that I missed a prerequisite for
    security_d_instantiate() stuff - ->getxattr() wasn't the only thing
    that could be called before dentry is attached to inode; with smack
    we needed the same treatment applied to ->setxattr() as well"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    switch ->setxattr() to passing dentry and inode separately
    switch xattr_handler->set() to passing dentry and inode separately
    restore killability of old mutex_lock_killable(&inode->i_mutex) users
    add down_write_killable_nested()
    update D/f/directory-locking

    Linus Torvalds
     
  • smack ->d_instantiate() uses ->setxattr(), so to be able to call it before
    we'd hashed the new dentry and attached it to inode, we need ->setxattr()
    instances getting the inode as an explicit argument rather than obtaining
    it from dentry.

    Similar change for ->getxattr() had been done in commit ce23e64. Unlike
    ->getxattr() (which is used by both selinux and smack instances of
    ->d_instantiate()) ->setxattr() is used only by smack one and unfortunately
    it got missed back then.

    Reported-by: Seung-Woo Kim
    Tested-by: Casey Schaufler
    Signed-off-by: Al Viro

    Al Viro
     
  • Now that the allmodconfig x86-64 build is clean wrt IS_ERR_VALUE() uses
    on integers, add a cast to a pointer and back to the argument, so that
    any new mis-uses of IS_ERR_VALUE() will cause warnings like

    warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

    so that we don't re-introduce any bogus uses.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • The do_brk() and vm_brk() return value was "unsigned long" and returned
    the starting address on success, and an error value on failure. The
    reasons are entirely historical, and go back to it basically behaving
    like the mmap() interface does.

    However, nobody actually wanted that interface, and it causes totally
    pointless IS_ERR_VALUE() confusion.

    What every single caller actually wants is just the simpler integer
    return of zero for success and negative error number on failure.

    So just convert to that much clearer and more common calling convention,
    and get rid of all the IS_ERR_VALUE() uses wrt vm_brk().

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • The register_page_bootmem_info_node() function needs to be marked __init
    in order to avoid a new warning introduced by commit f65e91df25aa ("mm:
    use early_pfn_to_nid in register_page_bootmem_info_node").

    Otherwise you'll get a warning about how a non-init function calls
    early_pfn_to_nid (which is __meminit)

    Cc: Yang Shi
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull block fixes from Jens Axboe:
    "A set of fixes that wasn't included in the first merge window pull
    request. This pull request contains:

    - A set of NVMe fixes from Keith, and one from Nic for the integrity
    side of it.

    - Fix from Ming, clearing ->mq_ops if we don't successfully setup a
    queue for multiqueue.

    - A set of stability fixes for bcache from Jiri, and also marking
    bcache as orphaned as it's no longer actively maintained (in
    mainline, at least)"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    blk-mq: clear q->mq_ops if init fail
    MAINTAINERS: mark bcache as orphan
    bcache: bch_gc_thread() is not freezable
    bcache: bch_allocator_thread() is not freezable
    bcache: bch_writeback_thread() is not freezable
    nvme/host: Add missing blk_integrity tag_size + flags assignments
    NVMe: Add device ID's with stripe quirk
    NVMe: Short-cut removal on surprise hot-unplug
    NVMe: Allow user initiated rescan
    NVMe: Reduce driver log spamming
    NVMe: Unbind driver on failure
    NVMe: Delete only created queues
    NVMe: Allocate queues only for online cpus

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:

    - one IMX built-in regression fix

    - a set of amdgpu fixes, mostly powerplay and polaris GPU stuff

    - a set of i915 fixes all over, many cc'ed to stable.

    The i915 batch contain support for DP++ dongle detection, which is
    used to fix some regressions in the HDMI color depth area

    * tag 'drm-fixes-v4.7-rc1' of git://people.freedesktop.org/~airlied/linux: (44 commits)
    drm/amd: add Kconfig dependency for ACP on DRM_AMDGPU
    drm/amdgpu: Fix hdmi deep color support.
    drm/amdgpu: fix bug in fence driver fini
    drm/i915: Stop automatically retiring requests after a GPU hang
    drm/i915: Unify intel_ring_begin()
    drm/i915: Ignore stale wm register values on resume on ilk-bdw (v2)
    drm/i915/psr: Try to program link training times correctly
    drm/imx: Match imx-ipuv3-crtc components using device node in platform data
    drm/i915/bxt: Adjusting the error in horizontal timings retrieval
    drm/i915: Don't leave old junk in ilk active watermarks on readout
    drm/i915: s/DPPL/DPLL/ for SKL DPLLs
    drm/i915: Fix gen8 semaphores id for legacy mode
    drm/i915: Set crtc_state->lane_count for HDMI
    drm/i915/BXT: Retrieving the horizontal timing for DSI
    drm/i915: Protect gen7 irq_seqno_barrier with uncore lock
    drm/i915: Re-enable GGTT earlier during resume on pre-gen6 platforms
    drm/i915: Determine DP++ type 1 DVI adaptor presence based on VBT
    drm/i915: Enable/disable TMDS output buffers in DP++ adaptor as needed
    drm/i915: Respect DP++ adaptor TMDS clock limit
    drm: Add helper for DP++ adaptors
    ...

    Linus Torvalds