Can, according to Cambridge Dictionary, is actually used to make requests (obviously, among other things):
used to request something
Their example sentences:
If you see Brett, can you tell him I'm in town next weekend?
Can you make a little less noise, please? I'm trying to work.
In answer to your question: making a request using the verb can is not ungrammatical nor uncommon.
As JonMark pointed out, responding to such a request with yes (or no) can come across as pedantic or annoying. On the one hand, I agree that might be the case , for example when you answer that on a test when expected to solve some equations or give an explanation.
On the other hand, in the example sentences by Cambridge Dictionary, yes is an appropriate response to indicate you will tell Brett or will be more quiet, respectively.
Therefore, as with many things, context is key. Respond when and how you think is appropriate in the situation you find yourself in.
Obviously, in your example your interlocutor is requesting the salt. Yes is an appropriate response provided you give it to them. Similarly, no, I can't right now, (I have my hands full) is also appropriate when you aren't able to hand it to them.
Attribution: (Definition of “can” from the Cambridge Advanced Learner's Dictionary & Thesaurus © Cambridge University Press)