linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Laura Abbott <labbott@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <alexander.levin@microsoft.com>
Subject: [PATCH 4.18 19/53] scsi: ibmvscsis: Ensure partition name is properly NUL terminated
Date: Thu, 18 Oct 2018 19:54:12 +0200	[thread overview]
Message-ID: <20181018175420.175850690@linuxfoundation.org> (raw)
In-Reply-To: <20181018175416.561567978@linuxfoundation.org>

4.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Laura Abbott <labbott@redhat.com>

[ Upstream commit adad633af7b970bfa5dd1b624a4afc83cac9b235 ]

While reviewing another part of the code, Kees noticed that the strncpy of the
partition name might not always be NUL terminated. Switch to using strscpy
which does this safely.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -3478,7 +3478,7 @@ static int ibmvscsis_probe(struct vio_de
 	snprintf(vscsi->eye, sizeof(vscsi->eye), "VSCSI %s", vdev->name);
 
 	vscsi->dds.unit_id = vdev->unit_address;
-	strncpy(vscsi->dds.partition_name, partition_name,
+	strscpy(vscsi->dds.partition_name, partition_name,
 		sizeof(vscsi->dds.partition_name));
 	vscsi->dds.partition_num = partition_number;
 



  parent reply	other threads:[~2018-10-18 18:14 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 17:53 [PATCH 4.18 00/53] 4.18.16-stable review Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 01/53] soundwire: Fix duplicate stream state assignment Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 02/53] soundwire: Fix incorrect exit after configuring stream Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 03/53] soundwire: Fix acquiring bus lock twice during master release Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 04/53] media: af9035: prevent buffer overflow on write Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 05/53] spi: gpio: Fix copy-and-paste error Greg Kroah-Hartman
2018-10-18 17:53 ` [PATCH 4.18 06/53] batman-adv: Avoid probe ELP information leak Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 07/53] batman-adv: Fix segfault when writing to throughput_override Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 08/53] batman-adv: Fix segfault when writing to sysfs elp_interval Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 09/53] batman-adv: Prevent duplicated gateway_node entry Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 10/53] batman-adv: Prevent duplicated nc_node entry Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 11/53] batman-adv: Prevent duplicated softif_vlan entry Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 12/53] batman-adv: Prevent duplicated global TT entry Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 13/53] batman-adv: Prevent duplicated tvlv handler Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 14/53] batman-adv: fix backbone_gw refcount on queue_work() failure Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 15/53] batman-adv: fix hardif_neigh " Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 16/53] cxgb4: fix abort_req_rss6 struct Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 17/53] clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 18/53] scsi: ibmvscsis: Fix a stringop-overflow warning Greg Kroah-Hartman
2018-10-18 17:54 ` Greg Kroah-Hartman [this message]
2018-10-18 17:54 ` [PATCH 4.18 20/53] intel_th: pci: Add Ice Lake PCH support Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 21/53] Input: atakbd - fix Atari keymap Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 22/53] Input: atakbd - fix Atari CapsLock behaviour Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 23/53] selftests: pmtu: properly redirect stderr to /dev/null Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 24/53] net: emac: fix fixed-link setup for the RTL8363SB switch Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 25/53] ravb: do not write 1 to reserved bits Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 26/53] net/smc: fix non-blocking connect problem Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 27/53] net/smc: fix sizeof to int comparison Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 28/53] qed: Fix populating the invalid stag value in multi function mode Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 29/53] qed: Do not add VLAN 0 tag to untagged frames in multi-function mode Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 30/53] PCI: dwc: Fix scheduling while atomic issues Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 31/53] RDMA/uverbs: Fix validity check for modify QP Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 32/53] scsi: lpfc: Synchronize access to remoteport via rport Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 33/53] drm: mali-dp: Call drm_crtc_vblank_reset on device init Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 34/53] scsi: ipr: System hung while dlpar adding primary ipr adapter back Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 35/53] scsi: sd: dont crash the host on invalid commands Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 36/53] bpf: sockmap only allow ESTABLISHED sock state Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 37/53] bpf: sockmap, fix transition through disconnect without close Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 38/53] bpf: test_maps, only support ESTABLISHED socks Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 39/53] net/mlx4: Use cpumask_available for eq->affinity_mask Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 40/53] clocksource/drivers/fttmr010: Fix set_next_event handler Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 41/53] RDMA/bnxt_re: Fix system crash during RDMA resource initialization Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 42/53] RISC-V: include linux/ftrace.h in asm-prototypes.h Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 43/53] iommu/rockchip: Free irqs in shutdown handler Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 44/53] pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 45/53] powerpc/tm: Fix userspace r13 corruption Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 46/53] powerpc/tm: Avoid possible userspace r1 corruption on reclaim Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 47/53] powerpc/numa: Use associativity if VPHN hcall is successful Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 48/53] iommu/amd: Return devid as alias for ACPI HID devices Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 49/53] x86/boot: Fix kexec booting failure in the SEV bit detection code Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 50/53] Revert "vfs: fix freeze protection in mnt_want_write_file() for overlayfs" Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 51/53] mremap: properly flush TLB before releasing the page Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 52/53] ARC: build: Get rid of toolchain check Greg Kroah-Hartman
2018-10-18 17:54 ` [PATCH 4.18 53/53] ARC: build: Dont set CROSS_COMPILE in archs Makefile Greg Kroah-Hartman
2018-10-19 12:43 ` [PATCH 4.18 00/53] 4.18.16-stable review Rafael David Tinoco
2018-10-19 15:44   ` Greg Kroah-Hartman
2018-10-19 15:50 ` Guenter Roeck
2018-10-20  6:42   ` Greg Kroah-Hartman
2018-10-19 20:43 ` Shuah Khan
2018-10-20  6:41   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181018175420.175850690@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@microsoft.com \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).