As Salamu alaikum,
it is forbidden for a Muslim to sell weapons and tools of war to the Kuffar who are at war with Muslims. I don’t know whether petroleum, natural gas, or semiconductor products are included, and I wanted to ask whether such things are also taken into account in the analysis.
Salam brother,
I appreciate your sentiment, and I think you may already know the answer to your question that no it cannot be taken into account like that if you want to make everything black and white.
If you mean by ownership of a stock you are representing those companies personally, you know that oppressive governments are buying from many of those companies whose primary business isn’t about war, besides some “defense” companies that supply the I"D"F besides others with weapons and are labeled non compliant in Zoya. A company can be making very generic technology and it is used by the same oppressors too, besides fuel etc.
You will have to draw your own line in a gray area if you disagree with the line drawn by others. Fear Allah as much as you are able to, and do some extra good to help offset the injustice you’re unwillingly taking part in.