linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: "Keller, Jacob E" <jacob.e.keller@intel.com>
Cc: Pavel Machek <pavel@denx.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Brelinski, TonyX" <tonyx.brelinski@intel.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.10 026/103] ice: do not abort devlink info if board identifier cant be found
Date: Thu, 2 Sep 2021 07:56:35 +0200	[thread overview]
Message-ID: <20210902055635.GA17629@duo.ucw.cz> (raw)
In-Reply-To: <8168c579-9ba7-2c31-42b3-9ad88760110a@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

Hi!

> >>> The devlink dev info command reports version information about the
> >>> device and firmware running on the board. This includes the "board.id"
> >>> field which is supposed to represent an identifier of the board design.
> >>> The ice driver uses the Product Board Assembly identifier for this.
> >>>
> >>> In some cases, the PBA is not present in the NVM. If this happens,
> >>> devlink dev info will fail with an error. Instead, modify the
> >>> ice_info_pba function to just exit without filling in the context
> >>> buffer. This will cause the board.id field to be skipped. Log a dev_dbg
> >>> message in case someone wants to confirm why board.id is not showing up
> >>> for them.
> >>
> >> Will it cause field to be skipped? I believe buffer will not be
> >> initialized which will result in some confusion...
> > 
> > IOW I believe this is good idea.
> 
> It's not necessary, but I agree its not obvious without the full
> context. The caller of ice_info_pba memsets the buffer before calling
> each info reporter. Its already a known semantics that leaving the
> buffer alone will skip the entry.
> 
> See the code below for what we do.
> 
> >                 memset(ctx->buf, 0, sizeof(ctx->buf));
> > 
> >                 err = ice_devlink_versions[i].getter(pf, ctx);
> >                 if (err) {
> >                         NL_SET_ERR_MSG_MOD(extack, "Unable to obtain version info");
> >                         goto out_free_ctx;
> >                 }

That memset is not present in 5.10 I was reviewing. I agree that
backporting the memset to 5.10 is better then my patch.

> We memset the buffer, call the getter, and if that doesn't modify the
> buffer, we call the fallack, and then check again if its still empty.
> 
> Because we memset each time, we don't need to assign *buf = 0.
> 
> I guess its more clear that we're doing the correct thing here, but
> these functions are build-for-purpose to use as pointers in this API and
> aren't public, so I think it is fine to leave it as is.

Yes, code is okay in mainline, but the memset is not present in
5.10-stable.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2021-09-02  5:56 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 12:27 [PATCH 5.10 000/103] 5.10.62-rc1 review Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 001/103] net: qrtr: fix another OOB Read in qrtr_endpoint_post Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 002/103] bpf: Fix ringbuf helper function compatibility Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 003/103] bpf: Fix NULL pointer dereference in bpf_get_local_storage() helper Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 004/103] ASoC: rt5682: Adjust headset volume button threshold Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 005/103] ASoC: component: Remove misplaced prefix handling in pin control functions Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 006/103] ARC: Fix CONFIG_STACKDEPOT Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 007/103] netfilter: conntrack: collect all entries in one cycle Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 008/103] once: Fix panic when module unload Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 009/103] blk-iocost: fix lockdep warning on blkcg->lock Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 010/103] ovl: fix uninitialized pointer read in ovl_lookup_real_one() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 011/103] net: mscc: Fix non-GPL export of regmap APIs Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 012/103] can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 013/103] ceph: correctly handle releasing an embedded cap flush Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 014/103] riscv: Ensure the value of FP registers in the core dump file is up to date Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 015/103] Revert "btrfs: compression: dont try to compress if we dont have enough pages" Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 016/103] drm/amdgpu: Cancel delayed work when GFXOFF is disabled Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 017/103] Revert "USB: serial: ch341: fix character loss at high transfer rates" Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 018/103] USB: serial: option: add new VID/PID to support Fibocom FG150 Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 019/103] usb: renesas-xhci: Prefer firmware loading on unknown ROM state Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 020/103] usb: dwc3: gadget: Fix dwc3_calc_trbs_left() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 021/103] usb: dwc3: gadget: Stop EP0 transfers during pullup disable Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 022/103] scsi: core: Fix hang of freezing queue between blocking and running device Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 023/103] RDMA/bnxt_re: Add missing spin lock initialization Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 024/103] IB/hfi1: Fix possible null-pointer dereference in _extend_sdma_tx_descs() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 025/103] RDMA/bnxt_re: Remove unpaired rtnl unlock in bnxt_re_dev_init() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 026/103] ice: do not abort devlink info if board identifier cant be found Greg Kroah-Hartman
2021-09-01 19:42   ` Pavel Machek
2021-09-01 20:10     ` Pavel Machek
2021-09-01 20:49       ` Keller, Jacob E
2021-09-02  5:56         ` Pavel Machek [this message]
2021-09-01 12:27 ` [PATCH 5.10 027/103] net: usb: pegasus: fixes of set_register(s) return value evaluation; Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 028/103] igc: fix page fault when thunderbolt is unplugged Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 029/103] igc: Use num_tx_queues when iterating over tx_ring queue Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 030/103] e1000e: Fix the max snoop/no-snoop latency for 10M Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 031/103] e1000e: Do not take care about recovery NVM checksum Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 032/103] RDMA/efa: Free IRQ vectors on error flow Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 033/103] ip_gre: add validation for csum_start Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 034/103] xgene-v2: Fix a resource leak in the error handling path of xge_probe() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 035/103] net: marvell: fix MVNETA_TX_IN_PRGRS bit number Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 036/103] ucounts: Increase ucounts reference counter before the security hook Greg Kroah-Hartman
2021-09-01 14:25   ` Eric W. Biederman
2021-09-01 16:40     ` Greg Kroah-Hartman
2021-09-01 17:26       ` Eric W. Biederman
2021-09-02 13:04         ` Sasha Levin
2021-09-02 14:28           ` Alexey Gladkov
2021-09-02 18:06           ` Eric W. Biederman
2021-09-03  4:57             ` Greg Kroah-Hartman
2021-09-03  5:00               ` Greg Kroah-Hartman
2021-09-03  6:50                 ` Greg Kroah-Hartman
2021-09-03 14:14                   ` Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 037/103] net/sched: ets: fix crash when flipping from strict to quantum Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 038/103] ipv6: use siphash in rt6_exception_hash() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 039/103] ipv4: use siphash instead of Jenkins in fnhe_hashfun() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 040/103] cxgb4: dont touch blocked freelist bitmap after free Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 041/103] rtnetlink: Return correct error on changing device netns Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 042/103] net: hns3: clear hardware resource when loading driver Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 043/103] net: hns3: add waiting time before cmdq memory is released Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 044/103] net: hns3: fix duplicate node in VLAN list Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 045/103] net: hns3: fix get wrong pfc_en when query PFC configuration Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 046/103] Revert "mmc: sdhci-iproc: Set SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN on BCM2711" Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 047/103] net: stmmac: add mutex lock to protect est parameters Greg Kroah-Hartman
2021-09-01 20:09   ` Pavel Machek
2021-09-02 13:51     ` Sasha Levin
2021-09-01 12:27 ` [PATCH 5.10 048/103] net: stmmac: fix kernel panic due to NULL pointer dereference of plat->est Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.10 049/103] drm/i915: Fix syncmap memory leak Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 050/103] usb: gadget: u_audio: fix race condition on endpoint stop Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 051/103] dt-bindings: sifive-l2-cache: Fix select matching Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 052/103] perf/x86/intel/uncore: Fix integer overflow on 23 bit left shift of a u32 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 053/103] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 054/103] iwlwifi: pnvm: accept multiple HW-type TLVs Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 055/103] opp: remove WARN when no valid OPPs remain Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 056/103] cpufreq: blocklist Qualcomm sm8150 in cpufreq-dt-platdev Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 057/103] virtio: Improve vq->broken access to avoid any compiler optimization Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 058/103] virtio_pci: Support surprise removal of virtio pci device Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 059/103] virtio_vdpa: reject invalid vq indices Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 060/103] vringh: Use wiov->used to check for read/write desc order Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 061/103] tools/virtio: fix build Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 062/103] qed: qed ll2 race condition fixes Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 063/103] qed: Fix null-pointer dereference in qed_rdma_create_qp() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 064/103] Revert "drm/amd/pm: fix workload mismatch on vega10" Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 065/103] drm/amd/pm: change the workload type for some cards Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 066/103] blk-mq: dont grab rqs refcount in blk_mq_check_expired() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 067/103] drm: Copy drm_wait_vblank to user before returning Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 068/103] drm/nouveau/disp: power down unused DP links during init Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 069/103] drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 070/103] net/rds: dma_map_sg is entitled to merge entries Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 071/103] btrfs: fix race between marking inode needs to be logged and log syncing Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 072/103] pipe: avoid unnecessary EPOLLET wakeups under normal loads Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 073/103] pipe: do FASYNC notifications for every pipe IO, not just state changes Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 074/103] mtd: spinand: Fix incorrect parameters for on-die ECC Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 075/103] tipc: call tipc_wait_for_connect only when dlen is not 0 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 076/103] vt_kdsetmode: extend console locking Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 077/103] Bluetooth: btusb: check conditions before enabling USB ALT 3 for WBS Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 078/103] riscv: Fixup wrong ftrace remove cflag Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 079/103] riscv: Fixup patch_text panic in ftrace Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 080/103] perf env: Fix memory leak of bpf_prog_info_linear member Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 081/103] perf symbol-elf: Fix memory leak by freeing sdt_note.args Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 082/103] perf record: Fix memory leak in vDSO found using ASAN Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 083/103] perf tools: Fix arm64 build error with gcc-11 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 084/103] perf annotate: Fix jump parsing for C++ code Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 085/103] powerpc/perf: Invoke per-CPU variable access with disabled interrupts Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 086/103] srcu: Provide internal interface to start a Tree SRCU grace period Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 087/103] srcu: Provide polling interfaces for Tree SRCU grace periods Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 088/103] srcu: Provide internal interface to start a Tiny SRCU grace period Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 089/103] srcu: Make Tiny SRCU use multi-bit grace-period counter Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 090/103] srcu: Provide polling interfaces for Tiny SRCU grace periods Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 091/103] tracepoint: Use rcu get state and cond sync for static call updates Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 092/103] usb: typec: ucsi: acpi: Always decode connector change information Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 093/103] usb: typec: ucsi: Work around PPM losing " Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 094/103] usb: typec: ucsi: Clear pending after acking connector change Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 095/103] net: dsa: mt7530: fix VLAN traffic leaks again Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 096/103] lkdtm: Enable DOUBLE_FAULT on all architectures Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 097/103] arm64: dts: qcom: msm8994-angler: Fix gpio-reserved-ranges 85-88 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 098/103] btrfs: fix NULL pointer dereference when deleting device by invalid id Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 099/103] kthread: Fix PF_KTHREAD vs to_kthread() race Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 100/103] Revert "floppy: reintroduce O_NDELAY fix" Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 101/103] Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 102/103] net: dont unconditionally copy_from_user a struct ifreq for socket ioctls Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.10 103/103] audit: move put_tree() to avoid trim_trees refcount underflow and UAF Greg Kroah-Hartman
2021-09-01 16:59 ` [PATCH 5.10 000/103] 5.10.62-rc1 review Fox Chen
2021-09-01 20:08 ` Pavel Machek
2021-09-01 21:21 ` Shuah Khan
2021-09-01 21:48 ` Florian Fainelli
2021-09-02  1:07 ` Samuel Zou
2021-09-02  8:06 ` Naresh Kamboju
2021-09-02 11:55 ` Sudip Mukherjee
2021-09-02 21:58 ` Guenter Roeck

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=20210902055635.GA17629@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=anthony.l.nguyen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tonyx.brelinski@intel.com \
    /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).