12 Aug, 2017

1 commit

  • If mISDN_FsmNew() fails to allocate memory for jumpmatrix
    then null pointer dereference will occur on any write to
    jumpmatrix.

    The patch adds check on successful allocation and
    corresponding error handling.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Anton Vasilyev
    Signed-off-by: David S. Miller

    Anton Vasilyev
     

10 Aug, 2017

1 commit

  • Pull networking fixes from David Miller:
    "The pull requests are getting smaller, that's progress I suppose :-)

    1) Fix infinite loop in CIPSO option parsing, from Yujuan Qi.

    2) Fix remote checksum handling in VXLAN and GUE tunneling drivers,
    from Koichiro Den.

    3) Missing u64_stats_init() calls in several drivers, from Florian
    Fainelli.

    4) TCP can set the congestion window to an invalid ssthresh value
    after congestion window reductions, from Yuchung Cheng.

    5) Fix BPF jit branch generation on s390, from Daniel Borkmann.

    6) Correct MIPS ebpf JIT merge, from David Daney.

    7) Correct byte order test in BPF test_verifier.c, from Daniel
    Borkmann.

    8) Fix various crashes and leaks in ASIX driver, from Dean Jenkins.

    9) Handle SCTP checksums properly in mlx4 driver, from Davide
    Caratti.

    10) We can potentially enter tcp_connect() with a cached route
    already, due to fastopen, so we have to explicitly invalidate it.

    11) skb_warn_bad_offload() can bark in legitimate situations, fix from
    Willem de Bruijn"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
    net: avoid skb_warn_bad_offload false positives on UFO
    qmi_wwan: fix NULL deref on disconnect
    ppp: fix xmit recursion detection on ppp channels
    rds: Reintroduce statistics counting
    tcp: fastopen: tcp_connect() must refresh the route
    net: sched: set xt_tgchk_param par.net properly in ipt_init_target
    net: dsa: mediatek: add adjust link support for user ports
    net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets
    qed: Fix a memory allocation failure test in 'qed_mcp_cmd_init()'
    hysdn: fix to a race condition in put_log_buffer
    s390/qeth: fix L3 next-hop in xmit qeth hdr
    asix: Fix small memory leak in ax88772_unbind()
    asix: Ensure asix_rx_fixup_info members are all reset
    asix: Add rx->ax_skb = NULL after usbnet_skb_return()
    bpf: fix selftest/bpf/test_pkt_md_access on s390x
    netvsc: fix race on sub channel creation
    bpf: fix byte order test in test_verifier
    xgene: Always get clk source, but ignore if it's missing for SGMII ports
    MIPS: Add missing file for eBPF JIT.
    bpf, s390: fix build for libbpf and selftest suite
    ...

    Linus Torvalds
     

08 Aug, 2017

1 commit

  • The synchronization type that was used earlier to guard the loop that
    deletes unused log buffers may lead to a situation that prevents any
    thread from going through the loop.

    The patch deletes previously used synchronization mechanism and moves
    the loop under the spin_lock so the similar cases won't be feasible in
    the future.

    Found by by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Anton Volkov
    Signed-off-by: David S. Miller

    Anton Volkov
     

03 Aug, 2017

1 commit

  • This fixes a potential buffer overflow in isdn_net.c caused by an
    unbounded strcpy.

    [ ISDN seems to be effectively unmaintained, and the I4L driver in
    particular is long deprecated, but in case somebody uses this..
    - Linus ]

    Signed-off-by: Jiten Thakkar
    Signed-off-by: Annie Cherkaev
    Cc: Karsten Keil
    Cc: Kees Cook
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Annie Cherkaev
     

16 Jul, 2017

10 commits

  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    11803 544 1 12348 303c isdn/hardware/avm/c4.o

    File size After adding 'const':
    text data bss dec hex filename
    11931 416 1 12348 303c isdn/hardware/avm/c4.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    21656 1024 96 22776 58f8 isdn/hardware/mISDN/hfcpci.o

    File size After adding 'const':
    text data bss dec hex filename
    22424 256 96 22776 58f8 isdn/hardware/mISDN/hfcpci.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    9963 1936 16 11915 2e8b isdn/hardware/mISDN/avmfritz.o

    File size After adding 'const':
    text data bss dec hex filename
    10091 1808 16 11915 2e8b isdn/hardware/mISDN/avmfritz.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    13959 4080 24 18063 468f isdn/hardware/mISDN/w6692.o

    File size After adding 'const':
    text data bss dec hex filename
    14087 3952 24 18063 468f isdn/hardware/mISDN/w6692.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    63450 1536 1492 66478 103ae isdn/hardware/mISDN/hfcmulti.o

    File size After adding 'const':
    text data bss dec hex filename
    64698 288 1492 66478 103ae isdn/hardware/mISDN/hfcmulti.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    10941 1776 16 12733 31bd isdn/hardware/mISDN/netjet.o

    File size After adding 'const':
    text data bss dec hex filename
    11005 1712 16 12733 31bd isdn/hardware/mISDN/netjet.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    6224 655 8 6887 1ae7 isdn/hardware/eicon/divasmain.o

    File size After adding 'const':
    text data bss dec hex filename
    6608 271 8 6887 1ae7 isdn/hardware/eicon/divasmain.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    5989 576 0 6565 19a5 isdn/hisax/hisax_fcpcipnp.o

    File size After adding 'const':
    text data bss dec hex filename
    6085 480 0 6565 19a5 isdn/hisax/hisax_fcpcipnp.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    10512 536 4 11052 2b2c drivers/isdn/hisax/hfc4s8s_l1.o

    File size After adding 'const':
    text data bss dec hex filename
    10672 376 4 11052 2b2c drivers/isdn/hisax/hfc4s8s_l1.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    13686 2064 4416 20166 4ec6 drivers/isdn/hisax/config.o

    File size After adding 'const':
    text data bss dec hex filename
    15030 720 4416 20166 4ec6 drivers/isdn/hisax/config.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     

15 Jul, 2017

1 commit

  • One string we pass into the cs->info buffer might be too long,
    as pointed out by gcc:

    drivers/isdn/divert/isdn_divert.c: In function 'll_callback':
    drivers/isdn/divert/isdn_divert.c:488:22: error: '%d' directive writing between 1 and 3 bytes into a region of size between 1 and 69 [-Werror=format-overflow=]
    sprintf(cs->info, "%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/isdn/divert/isdn_divert.c:488:22: note: directive argument in the range [0, 255]
    drivers/isdn/divert/isdn_divert.c:488:4: note: 'sprintf' output 25 or more bytes (assuming 129) into a destination of size 90

    This is unlikely to actually cause problems, so let's use snprintf
    as a simple workaround to shut up the warning and truncate the
    buffer instead.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

06 Jul, 2017

1 commit

  • Pull misc user access cleanups from Al Viro:
    "The first pile is assorted getting rid of cargo-culted access_ok(),
    cargo-culted set_fs() and field-by-field copyouts.

    The same description applies to a lot of stuff in other branches -
    this is just the stuff that didn't fit into a more specific topical
    branch"

    * 'work.misc-set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    Switch flock copyin/copyout primitives to copy_{from,to}_user()
    fs/fcntl: return -ESRCH in f_setown when pid/pgid can't be found
    fs/fcntl: f_setown, avoid undefined behaviour
    fs/fcntl: f_setown, allow returning error
    lpfc debugfs: get rid of pointless access_ok()
    adb: get rid of pointless access_ok()
    isdn: get rid of pointless access_ok()
    compat statfs: switch to copy_to_user()
    fs/locks: don't mess with the address limit in compat_fcntl64
    nfsd_readlink(): switch to vfs_get_link()
    drbd: ->sendpage() never needed set_fs()
    fs/locks: pass kernel struct flock to fcntl_getlk/setlk
    fs: locks: Fix some troubles at kernel-doc comments

    Linus Torvalds
     

01 Jul, 2017

1 commit

  • refcount_t type and corresponding API should be
    used instead of atomic_t when the variable is used as
    a reference counter. This allows to avoid accidental
    refcounter overflows that might lead to use-after-free
    situations.

    Signed-off-by: Elena Reshetova
    Signed-off-by: Hans Liljestrand
    Signed-off-by: Kees Cook
    Signed-off-by: David Windsor
    Signed-off-by: David S. Miller

    Reshetova, Elena
     

21 Jun, 2017

3 commits

  • in my commit b952f4dff2751252db073c27c0f8a16a416a2ddc,
    - *(u8 *)skb_put(skb_out, 1) = (u8)(accm >> 24); \
    + skb_put(skb_out, (u8)(accm >> 24)); \
    it should skb_put_u8()

    Fixes: b952f4dff275 ("net: manual clean code which call skb_put_[data:zero])")
    Signed-off-by: yuan linyu
    Signed-off-by: David S. Miller

    yuan linyu
     
  • Signed-off-by: yuan linyu
    Signed-off-by: David S. Miller

    yuan linyu
     
  • follow Johannes Berg, semantic patch file as below,
    @@
    identifier p, p2;
    expression len;
    expression skb;
    type t, t2;
    @@
    (
    -p = __skb_put(skb, len);
    +p = __skb_put_zero(skb, len);
    |
    -p = (t)__skb_put(skb, len);
    +p = __skb_put_zero(skb, len);
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, len);
    |
    -memset(p, 0, len);
    )

    @@
    identifier p;
    expression len;
    expression skb;
    type t;
    @@
    (
    -t p = __skb_put(skb, len);
    +t p = __skb_put_zero(skb, len);
    )
    ... when != p
    (
    -memset(p, 0, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb;
    @@
    t *p;
    ...
    (
    -p = __skb_put(skb, sizeof(t));
    +p = __skb_put_zero(skb, sizeof(t));
    |
    -p = (t *)__skb_put(skb, sizeof(t));
    +p = __skb_put_zero(skb, sizeof(t));
    )
    ... when != p
    (
    p2 = (t2)p;
    -memset(p2, 0, sizeof(*p));
    |
    -memset(p, 0, sizeof(*p));
    )

    @@
    expression skb, len;
    @@
    -memset(__skb_put(skb, len), 0, len);
    +__skb_put_zero(skb, len);

    @@
    expression skb, len, data;
    @@
    -memcpy(__skb_put(skb, len), data, len);
    +__skb_put_data(skb, data, len);

    @@
    expression SKB, C, S;
    typedef u8;
    identifier fn = {__skb_put};
    fresh identifier fn2 = fn ## "_u8";
    @@
    - *(u8 *)fn(SKB, S) = C;
    + fn2(SKB, C);

    Signed-off-by: yuan linyu
    Signed-off-by: David S. Miller

    yuan linyu
     

16 Jun, 2017

5 commits

  • Joe and Bjørn suggested that it'd be nicer to not have the
    cast in the fairly common case of doing
    *(u8 *)skb_put(skb, 1) = c;

    Add skb_put_u8() for this case, and use it across the code,
    using the following spatch:

    @@
    expression SKB, C, S;
    typedef u8;
    identifier fn = {skb_put};
    fresh identifier fn2 = fn ## "_u8";
    @@
    - *(u8 *)fn(SKB, S) = C;
    + fn2(SKB, C);

    Note that due to the "S", the spatch isn't perfect, it should
    have checked that S is 1, but there's also places that use a
    sizeof expression like sizeof(var) or sizeof(u8) etc. Turns
    out that nobody ever did something like
    *(u8 *)skb_put(skb, 2) = c;

    which would be wrong anyway since the second byte wouldn't be
    initialized.

    Suggested-by: Joe Perches
    Suggested-by: Bjørn Mork
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

    Note that the last part there converts from push(...)[0] to the
    more idiomatic *(u8 *)push(...).

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = {
    skb_pull,
    __skb_pull,
    skb_pull_inline,
    __pskb_pull_tail,
    __pskb_pull,
    pskb_pull
    };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = {
    skb_pull,
    __skb_pull,
    skb_pull_inline,
    __pskb_pull_tail,
    __pskb_pull,
    pskb_pull
    };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions (skb_put, __skb_put and pskb_put) return void *
    and remove all the casts across the tree, adding a (u8 *) cast only
    where the unsigned char pointer was used directly, all done with the
    following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    which actually doesn't cover pskb_put since there are only three
    users overall.

    A handful of stragglers were converted manually, notably a macro in
    drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
    instances in net/bluetooth/hci_sock.c. In the former file, I also
    had to fix one whitespace problem spatch introduced.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • A common pattern with skb_put() is to just want to memcpy()
    some data into the new space, introduce skb_put_data() for
    this.

    An spatch similar to the one for skb_put_zero() converts many
    of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

    (again, manually post-processed to retain some comments)

    Reviewed-by: Stephen Hemminger
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

08 Jun, 2017

1 commit


05 Jun, 2017

1 commit


02 Jun, 2017

1 commit

  • The driver may sleep under a read spin lock, and the function call path is:
    send_socklist (acquire the lock by read_lock)
    skb_copy(GFP_KERNEL) --> may sleep

    To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".

    Signed-off-by: Jia-Ju Bai
    Signed-off-by: David S. Miller

    Jia-Ju Bai
     

01 Jun, 2017

1 commit

  • The driver may sleep under a spin lock, the function call path is:
    isdn_ppp_mp_receive (acquire the lock)
    isdn_ppp_mp_reassembly
    isdn_ppp_push_higher
    isdn_ppp_decompress
    isdn_ppp_ccp_reset_trans
    isdn_ppp_ccp_reset_alloc_state
    kzalloc(GFP_KERNEL) --> may sleep

    To fixed it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".

    Signed-off-by: Jia-Ju Bai
    Signed-off-by: David S. Miller

    Jia-Ju Bai
     

11 May, 2017

1 commit

  • Pull hw lockdown support from David Howells:
    "Annotation of module parameters that configure hardware resources
    including ioports, iomem addresses, irq lines and dma channels.

    This allows a future patch to prohibit the use of such module
    parameters to prevent that hardware from being abused to gain access
    to the running kernel image as part of locking the kernel down under
    UEFI secure boot conditions.

    Annotations are made by changing:

    module_param(n, t, p)
    module_param_named(n, v, t, p)
    module_param_array(n, t, m, p)

    to:

    module_param_hw(n, t, hwtype, p)
    module_param_hw_named(n, v, t, hwtype, p)
    module_param_hw_array(n, t, hwtype, m, p)

    where the module parameter refers to a hardware setting

    hwtype specifies the type of the resource being configured. This can
    be one of:

    ioport Module parameter configures an I/O port
    iomem Module parameter configures an I/O mem address
    ioport_or_iomem Module parameter could be either (runtime set)
    irq Module parameter configures an I/O port
    dma Module parameter configures a DMA channel
    dma_addr Module parameter configures a DMA buffer address
    other Module parameter configures some other value

    Note that the hwtype is compile checked, but not currently stored (the
    lockdown code probably won't require it). It is, however, there for
    future use.

    A bonus is that the hwtype can also be used for grepping.

    The intention is for the kernel to ignore or reject attempts to set
    annotated module parameters if lockdown is enabled. This applies to
    options passed on the boot command line, passed to insmod/modprobe or
    direct twiddling in /sys/module/ parameter files.

    The module initialisation then needs to handle the parameter not being
    set, by (1) giving an error, (2) probing for a value or (3) using a
    reasonable default.

    What I can't do is just reject a module out of hand because it may
    take a hardware setting in the module parameters. Some important
    modules, some ipmi stuff for instance, both probe for hardware and
    allow hardware to be manually specified; if the driver is aborts with
    any error, you don't get any ipmi hardware.

    Further, trying to do this entirely in the module initialisation code
    doesn't protect against sysfs twiddling.

    [!] Note that in and of itself, this series of patches should have no
    effect on the the size of the kernel or code execution - that is
    left to a patch in the next series to effect. It does mark
    annotated kernel parameters with a KERNEL_PARAM_FL_HWPARAM flag in
    an already existing field"

    * tag 'hwparam-20170420' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: (38 commits)
    Annotate hardware config module parameters in sound/pci/
    Annotate hardware config module parameters in sound/oss/
    Annotate hardware config module parameters in sound/isa/
    Annotate hardware config module parameters in sound/drivers/
    Annotate hardware config module parameters in fs/pstore/
    Annotate hardware config module parameters in drivers/watchdog/
    Annotate hardware config module parameters in drivers/video/
    Annotate hardware config module parameters in drivers/tty/
    Annotate hardware config module parameters in drivers/staging/vme/
    Annotate hardware config module parameters in drivers/staging/speakup/
    Annotate hardware config module parameters in drivers/staging/media/
    Annotate hardware config module parameters in drivers/scsi/
    Annotate hardware config module parameters in drivers/pcmcia/
    Annotate hardware config module parameters in drivers/pci/hotplug/
    Annotate hardware config module parameters in drivers/parport/
    Annotate hardware config module parameters in drivers/net/wireless/
    Annotate hardware config module parameters in drivers/net/wan/
    Annotate hardware config module parameters in drivers/net/irda/
    Annotate hardware config module parameters in drivers/net/hamradio/
    Annotate hardware config module parameters in drivers/net/ethernet/
    ...

    Linus Torvalds
     

20 Apr, 2017

1 commit

  • When the kernel is running in secure boot mode, we lock down the kernel to
    prevent userspace from modifying the running kernel image. Whilst this
    includes prohibiting access to things like /dev/mem, it must also prevent
    access by means of configuring driver modules in such a way as to cause a
    device to access or modify the kernel image.

    To this end, annotate module_param* statements that refer to hardware
    configuration and indicate for future reference what type of parameter they
    specify. The parameter parser in the core sees this information and can
    skip such parameters with an error message if the kernel is locked down.
    The module initialisation then runs as normal, but just sees whatever the
    default values for those parameters is.

    Note that we do still need to do the module initialisation because some
    drivers have viable defaults set in case parameters aren't specified and
    some drivers support automatic configuration (e.g. PNP or PCI) in addition
    to manually coded parameters.

    This patch annotates drivers in drivers/isdn/.

    Suggested-by: Alan Cox
    Signed-off-by: David Howells
    cc: Karsten Keil
    cc: netdev@vger.kernel.org

    David Howells
     

06 Apr, 2017

1 commit


29 Mar, 2017

1 commit

  • gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized
    value ending up in the cardnr parameter:

    drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer':
    drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.cardnr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cparams.cardnr = cdef.cardnr;

    This has been broken since before the start of the git history, so
    either the value is not used for anything important, or the ioctl
    command doesn't get called in practice.

    Setting the cardnr to zero avoids the warning and makes sure
    we have consistent behavior.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

25 Mar, 2017

1 commit


17 Mar, 2017

1 commit

  • CONFIG_8xx is deprecated and should soon be removed in favor
    of CONFIG_PPC_8xx.
    Anyway, hfc_multi_8xx.h only uses 8xx I/O ports which are
    linked to the CPM1 communication processor included in the 8xx
    rather than the 8xx itself.

    This patch therefore makes it dependent on CONFIG_CPM1 instead,
    like several other drivers.

    Signed-off-by: Christophe Leroy
    Signed-off-by: David S. Miller

    Christophe Leroy
     

15 Mar, 2017

1 commit

  • Pull networking fixes from David Miller:

    1) Ensure that mtu is at least IPV6_MIN_MTU in ipv6 VTI tunnel driver,
    from Steffen Klassert.

    2) Fix crashes when user tries to get_next_key on an LPM bpf map, from
    Alexei Starovoitov.

    3) Fix detection of VLAN fitlering feature for bnx2x VF devices, from
    Michal Schmidt.

    4) We can get a divide by zero when TCP socket are morphed into
    listening state, fix from Eric Dumazet.

    5) Fix socket refcounting bugs in skb_complete_wifi_ack() and
    skb_complete_tx_timestamp(). From Eric Dumazet.

    6) Use after free in dccp_feat_activate_values(), also from Eric
    Dumazet.

    7) Like bonding team needs to use ETH_MAX_MTU as netdev->max_mtu, from
    Jarod Wilson.

    8) Fix use after free in vrf_xmit(), from David Ahern.

    9) Don't do UDP Fragmentation Offload on IPComp ipsec packets, from
    Alexey Kodanev.

    10) Properly check napi_complete_done() return value in order to decide
    whether to re-enable IRQs or not in amd-xgbe driver, from Thomas
    Lendacky.

    11) Fix double free of hwmon device in marvell phy driver, from Andrew
    Lunn.

    12) Don't crash on malformed netlink attributes in act_connmark, from
    Etienne Noss.

    13) Don't remove routes with a higher metric in ipv6 ECMP route replace,
    from Sabrina Dubroca.

    14) Don't write into a cloned SKB in ipv6 fragmentation handling, from
    Florian Westphal.

    15) Fix routing redirect races in dccp and tcp, basically the ICMP
    handler can't modify the socket's cached route in it's locked by the
    user at this moment. From Jon Maxwell.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (108 commits)
    qed: Enable iSCSI Out-of-Order
    qed: Correct out-of-bound access in OOO history
    qed: Fix interrupt flags on Rx LL2
    qed: Free previous connections when releasing iSCSI
    qed: Fix mapping leak on LL2 rx flow
    qed: Prevent creation of too-big u32-chains
    qed: Align CIDs according to DORQ requirement
    mlxsw: reg: Fix SPVMLR max record count
    mlxsw: reg: Fix SPVM max record count
    net: Resend IGMP memberships upon peer notification.
    dccp: fix memory leak during tear-down of unsuccessful connection request
    tun: fix premature POLLOUT notification on tun devices
    dccp/tcp: fix routing redirect race
    ucc/hdlc: fix two little issue
    vxlan: fix ovs support
    net: use net->count to check whether a netns is alive or not
    bridge: drop netfilter fake rtable unconditionally
    ipv6: avoid write to a possibly cloned skb
    net: wimax/i2400m: fix NULL-deref at probe
    isdn/gigaset: fix NULL-deref at probe
    ...

    Linus Torvalds
     

14 Mar, 2017

1 commit

  • Make sure to check the number of endpoints to avoid dereferencing a
    NULL-pointer should a malicious device lack endpoints.

    Fixes: cf7776dc05b8 ("[PATCH] isdn4linux: Siemens Gigaset drivers -
    direct USB connection")
    Cc: stable # 2.6.17
    Cc: Hansjoerg Lipp

    Signed-off-by: Johan Hovold
    Signed-off-by: David S. Miller

    Johan Hovold
     

10 Mar, 2017

1 commit

  • Fix typos and add the following to the scripts/spelling.txt:

    disble||disable
    disbled||disabled

    I kept the TSL2563_INT_DISBLED in /drivers/iio/light/tsl2563.c
    untouched. The macro is not referenced at all, but this commit is
    touching only comment blocks just in case.

    Link: http://lkml.kernel.org/r/1481573103-11329-20-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

02 Mar, 2017

2 commits

  • …linux/sched/cputime.h>

    Introduce a trivial, mostly empty <linux/sched/cputime.h> header
    to prepare for the moving of cputime functionality out of sched.h.

    Update all code that relies on these facilities.

    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     
  • Instead of including the full , we are going to include the
    types-only header in , to further
    decouple the scheduler header from the signal headers.

    This means that various files which relied on the full need
    to be updated to gain an explicit dependency on it.

    Update the code that relies on sched.h's inclusion of the header.

    Acked-by: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar