lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <62c8d25f-b8d2-4364-94e8-4de33b61a52b@linaro.org> Date: Fri, 6 Sep 2024 14:05:01 +0100 From: Bryan O'Donoghue <bryan.odonoghue@...aro.org> To: quic_dikshita@...cinc.com, Vikash Garodia <quic_vgarodia@...cinc.com>, Abhinav Kumar <quic_abhinavk@...cinc.com>, Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>, quic_dikshita@...cinc.com, Vikash Garodia <quic_vgarodia@...cinc.com>, Abhinav Kumar <quic_abhinavk@...cinc.com>, Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de> Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v3 11/29] media: iris: implement reqbuf ioctl with vb2_queue_setup On 06/09/2024 13:50, Bryan O'Donoghue wrote: >> + >> + ret = core->hfi_ops->session_open(inst); >> + if (ret) { >> + ret = -EINVAL; >> + dev_err(core->dev, "session open failed\n"); >> + goto unlock; >> + } > > I don't understand the lifetime of the core->lock mutex here. > > It has verified the state as !ISIR_CORE_ERROR and then _released_ the > lock so by the time you get to core->hfi_ops->session_open() you've not > guaranteed the state at all. > > Shouldn't you continue to hold the core mutex for the duration of the > core->does_stuff() operation ? > > i.e. the state was not !IRIS_CORE_ERROR at an indeterminate time prior > to the next use of core-> ... > > Perhaps this is all very obvious but, I'm not immediately understanding > what the mutex gurantees nor for how long it does that. You'd probably be better off - taking the mutex at the external facing API - validating state if you must - doing all of your core ops - dropping If I'm interpreting your code right, there's alot of checking state in function a -> lock/check/unlock with function a then calling function b - which again verifies core->state and then optionally modifies say the linked list. But since function b is called by function a, and function b requires the core->lock - you may as well have held that lock from a through b. Moreover - what's the use case of the very granular core->stat lock checking ? When is it valid for example for iris_vb2_queue_setup() to have core->state change state during the lifetime of iris_vb2_queue_setup() ? iris_vb2_queue_setup() checks core->state -> locks - checks - release -> calls iris_hfi_gen1_session_open or iris_hfi_gen2_session_open -> what is the assumed core->state @ that point? So that's what I mean, I'm not immediately understanding why this granular locking scheme is in use, seems way, way, way too granular ? --- bod
Powered by blists - more mailing lists