1. 22 8月, 2019 1 次提交
    • I
      libceph: fix PG split vs OSD (re)connect race · a5613724
      Ilya Dryomov 提交于
      We can't rely on ->peer_features in calc_target() because it may be
      called both when the OSD session is established and open and when it's
      not.  ->peer_features is not valid unless the OSD session is open.  If
      this happens on a PG split (pg_num increase), that could mean we don't
      resend a request that should have been resent, hanging the client
      indefinitely.
      
      In userspace this was fixed by looking at require_osd_release and
      get_xinfo[osd].features fields of the osdmap.  However these fields
      belong to the OSD section of the osdmap, which the kernel doesn't
      decode (only the client section is decoded).
      
      Instead, let's drop this feature check.  It effectively checks for
      luminous, so only pre-luminous OSDs would be affected in that on a PG
      split the kernel might resend a request that should not have been
      resent.  Duplicates can occur in other scenarios, so both sides should
      already be prepared for them: see dup/replay logic on the OSD side and
      retry_attempt check on the client side.
      
      Cc: stable@vger.kernel.org
      Fixes: 7de030d6 ("libceph: resend on PG splits if OSD has RESEND_ON_SPLIT")
      Link: https://tracker.ceph.com/issues/41162Reported-by: NJerry Lee <leisurelysw24@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Tested-by: NJerry Lee <leisurelysw24@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      a5613724
  2. 08 7月, 2019 4 次提交
  3. 08 5月, 2019 1 次提交
  4. 09 4月, 2019 1 次提交
    • S
      treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively · d75f773c
      Sakari Ailus 提交于
      %pF and %pf are functionally equivalent to %pS and %ps conversion
      specifiers. The former are deprecated, therefore switch the current users
      to use the preferred variant.
      
      The changes have been produced by the following command:
      
      	git grep -l '%p[fF]' | grep -v '^\(tools\|Documentation\)/' | \
      	while read i; do perl -i -pe 's/%pf/%ps/g; s/%pF/%pS/g;' $i; done
      
      And verifying the result.
      
      Link: http://lkml.kernel.org/r/20190325193229.23390-1-sakari.ailus@linux.intel.com
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: sparclinux@vger.kernel.org
      Cc: linux-um@lists.infradead.org
      Cc: xen-devel@lists.xenproject.org
      Cc: linux-acpi@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Cc: linux-mmc@vger.kernel.org
      Cc: linux-nvdimm@lists.01.org
      Cc: linux-pci@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Cc: linux-btrfs@vger.kernel.org
      Cc: linux-f2fs-devel@lists.sourceforge.net
      Cc: linux-mm@kvack.org
      Cc: ceph-devel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Acked-by: David Sterba <dsterba@suse.com> (for btrfs)
      Acked-by: Mike Rapoport <rppt@linux.ibm.com> (for mm/memblock.c)
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (for drivers/pci)
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      d75f773c
  5. 08 1月, 2019 1 次提交
  6. 22 10月, 2018 11 次提交
  7. 03 8月, 2018 3 次提交
    • I
      libceph: add authorizer challenge · 6daca13d
      Ilya Dryomov 提交于
      When a client authenticates with a service, an authorizer is sent with
      a nonce to the service (ceph_x_authorize_[ab]) and the service responds
      with a mutation of that nonce (ceph_x_authorize_reply).  This lets the
      client verify the service is who it says it is but it doesn't protect
      against a replay: someone can trivially capture the exchange and reuse
      the same authorizer to authenticate themselves.
      
      Allow the service to reject an initial authorizer with a random
      challenge (ceph_x_authorize_challenge).  The client then has to respond
      with an updated authorizer proving they are able to decrypt the
      service's challenge and that the new authorizer was produced for this
      specific connection instance.
      
      The accepting side requires this challenge and response unconditionally
      if the client side advertises they have CEPHX_V2 feature bit.
      
      This addresses CVE-2018-1128.
      
      Link: http://tracker.ceph.com/issues/24836Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      6daca13d
    • A
      libceph: use timespec64 for r_mtime · fac02ddf
      Arnd Bergmann 提交于
      The request mtime field is used all over ceph, and is currently
      represented as a 'timespec' structure in Linux. This changes it to
      timespec64 to allow times beyond 2038, modifying all users at the
      same time.
      
      [ Remove now redundant ts variable in writepage_nounlock(). ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      fac02ddf
    • I
      libceph: make ceph_osdc_notify{,_ack}() payload_len u32 · 6d54228f
      Ilya Dryomov 提交于
      The wire format dictates that payload_len fits into 4 bytes.  Take u32
      instead of size_t to reflect that.
      
      All callers pass a small integer, so no changes required.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      6d54228f
  8. 07 6月, 2018 1 次提交
    • K
      treewide: Use struct_size() for kmalloc()-family · acafe7e3
      Kees Cook 提交于
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct foo {
          int stuff;
          void *entry[];
      };
      
      instance = kmalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);
      
      This patch makes the changes for kmalloc()-family (and kvmalloc()-family)
      uses. It was done via automatic conversion with manual review for the
      "CHECKME" non-standard cases noted below, using the following Coccinelle
      script:
      
      // pkey_cache = kmalloc(sizeof *pkey_cache + tprops->pkey_tbl_len *
      //                      sizeof *pkey_cache->table, GFP_KERNEL);
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      identifier VAR, ELEMENT;
      expression COUNT;
      @@
      
      - alloc(sizeof(*VAR) + COUNT * sizeof(*VAR->ELEMENT), GFP)
      + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)
      
      // mr = kzalloc(sizeof(*mr) + m * sizeof(mr->map[0]), GFP_KERNEL);
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      identifier VAR, ELEMENT;
      expression COUNT;
      @@
      
      - alloc(sizeof(*VAR) + COUNT * sizeof(VAR->ELEMENT[0]), GFP)
      + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)
      
      // Same pattern, but can't trivially locate the trailing element name,
      // or variable name.
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      expression SOMETHING, COUNT, ELEMENT;
      @@
      
      - alloc(sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
      + alloc(CHECKME_struct_size(&SOMETHING, ELEMENT, COUNT), GFP)
      Signed-off-by: NKees Cook <keescook@chromium.org>
      acafe7e3
  9. 05 6月, 2018 11 次提交
  10. 10 5月, 2018 1 次提交
  11. 02 4月, 2018 5 次提交